Discovery
During implementation of the CLI approval fix (commit 625ac0d), a new backend endpoint was added:
POST /api/agent-terminal/tools/approve/{approval_id}
{ "approved": bool, "comment": string|null, "task_id": string|null }
The agent loop's _request_approval() now subscribes via pub/sub and waits for an APPROVAL_RESPONSE event published by this endpoint.
The frontend currently does NOT call this endpoint. The existing POST /sessions/{session_id}/approve endpoint handles command-level terminal session approvals (different flow). Tool-level approval dialogs triggered by APPROVAL_REQUIRED events have no frontend wiring — so CLI tool approvals will still time out until this is wired.
Required frontend change
When the frontend receives an APPROVAL_REQUIRED event from the agent event stream, the approval dialog's confirm/deny buttons must call:
POST /api/agent-terminal/tools/approve/{event.content.approval_id}
{
"approved": <user decision>,
"task_id": event.task_id, // include even if null
"comment": <optional comment>
}
Files
- New endpoint:
autobot-backend/api/agent_terminal.py — submit_tool_approval()
- Subscriber:
autobot-backend/agent_loop/loop.py — _request_approval()
Discovery
During implementation of the CLI approval fix (commit 625ac0d), a new backend endpoint was added:
The agent loop's
_request_approval()now subscribes via pub/sub and waits for anAPPROVAL_RESPONSEevent published by this endpoint.The frontend currently does NOT call this endpoint. The existing
POST /sessions/{session_id}/approveendpoint handles command-level terminal session approvals (different flow). Tool-level approval dialogs triggered byAPPROVAL_REQUIREDevents have no frontend wiring — so CLI tool approvals will still time out until this is wired.Required frontend change
When the frontend receives an
APPROVAL_REQUIREDevent from the agent event stream, the approval dialog's confirm/deny buttons must call:Files
autobot-backend/api/agent_terminal.py—submit_tool_approval()autobot-backend/agent_loop/loop.py—_request_approval()