Skip to content

discovery(frontend): tool-level approval dialog must call POST /api/agent-terminal/tools/approve/{approval_id} #4952

@mrveiss

Description

@mrveiss

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.pysubmit_tool_approval()
  • Subscriber: autobot-backend/agent_loop/loop.py_request_approval()

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions