Skip to content

bug(agent-loop): AgentLoop, the planner and stall escalation are built but only tests construct them — two agent loops for one concept #20846

Open
3 of 6 issues completed

Description

@mrveiss

Problem

agent_loop/loop.py AgentLoop (with planner/planner.py LLMPlannerModule, ExecutionPlan, PlanStep, and the stall escalation ask_human_escalation_policy, around :1083) is constructed only in tests. Chat runs its own loop in chat_workflow/graph.py. That leaves two agent loops for one concept. The one with planning, structured step state and stall escalation is unwired, and the live one keeps task state only in the chat history.

Acceptance criteria

  • One agent loop. Either chat drives the planner/executor (plan → one step per fresh context → structured step state), or the planner and stall escalation move into the chat graph and the duplicate is retired once it is proven unused
  • Multi-step chat tasks keep plan and step state outside the message history
  • Stall escalation (ask a human after repeated non-progress) is live on the chat path
  • Decision recorded in the PR body: which loop is canonical, and why

Activity

  1. added
    bugSomething isn't working
    not-wiredImplemented but not connected to app
    area: agent-seamWave 3 · cluster H — Agent seam & tool governance
    phase:M4.9One definition per concept
    on Nov 5, 2026
  2. mrveiss commented on Nov 7, 2026

    @mrveiss
    OwnerAuthor

    Maintainer decision 2026-11-07:

    1. The chat graph is the canonical loop. Port the planner and stall escalation into it as graph nodes. AgentLoop is never instantiated.
    2. AgentLoop is kept and marked PORTED. A follow-up issue decides whether it is retired or kept as a library.
    3. Both features sit behind SSOT flags that default off (AUTOBOT_CHAT_PLANNER_ENABLED, AUTOBOT_CHAT_STALL_ESCALATION=stop|ask). Wired in with default stop satisfies AC3.
    4. Split into three sub-issues: (a) stall escalation, an ask_human graph interrupt plus a chat question card, whose frontend waits for fix(chat): history list no longer shows 1970; one session-date mapping in the repository (#20865) #20996; (b) the planner on the chat graph with structured step state and planner unit tests; (c) the decision record, the wiring assertion, and the ask-human defaults moved to SSOT.
    5. Delegated subagents and the legacy fallback loop always use "stop", because they cannot interrupt.
    6. The /agent-terminal/tasks/{id}/answer and /steer routes get a separate issue.
    7. The planner uses the turn's selected model, under the existing 5-iteration cap.
  3. github-actions commented on Nov 12, 2026

    @github-actions
    Contributor

    Landed via the merge train (#21348, merge 5293da27d0) via #21236

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentsarea: agent-seamWave 3 · cluster H — Agent seam & tool governancebugSomething isn't workingnot-wiredImplemented but not connected to appphase:M4.9One definition per conceptpriority: high

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions