feat: add interactive mode for agent loop

Re-architects the agent loop to support interactive (chat-like) mode
where text-only responses pause execution and wait for user input,
while tool-call responses continue looping autonomously.

- Add `interactive` flag to LLMConfig (default False, no regression)
- Add configurable `waiting_timeout` to AgentState (0 = disabled)
- _process_iteration returns None for text-only → agent_loop pauses
- Conditional system prompt: interactive allows natural text responses
- Skip <meta>Continue the task.</meta> injection in interactive mode
- Sub-agents inherit interactive from parent (300s auto-resume timeout)
- Root interactive agents wait indefinitely for user input (timeout=0)
- TUI sets interactive=True; CLI unchanged (non_interactive=True)
This commit is contained in:
0xallam
2026-03-14 11:57:58 -07:00
committed by Ahmed Allam
parent 7dde988efc
commit 1404864097
8 changed files with 75 additions and 20 deletions
-1
View File
@@ -78,7 +78,6 @@ async def run_cli(args: Any) -> None: # noqa: PLR0915
agent_config = {
"llm_config": llm_config,
"max_iterations": 300,
"non_interactive": True,
}
if getattr(args, "local_sources", None):