routes.tool_approvals
Local tool approval endpoints served by agent-runtimes.
These endpoints support the sync approval flow without requiring an external ai-agents approval backend. A legacy route prefix is also exposed for compatibility with existing callers.
ToolApprovalCreateRequest Objects
class ToolApprovalCreateRequest(BaseModel)
Payload to create a pending tool approval request.
ToolApprovalDecisionRequest Objects
class ToolApprovalDecisionRequest(BaseModel)
Payload to approve or reject a pending request.
ToolApprovalRecord Objects
class ToolApprovalRecord(BaseModel)
Stored approval record.
mirror_approval_to_local
async def mirror_approval_to_local(data: dict) -> ToolApprovalRecord
Mirror an approval record from an external backend (e.g. ai-agents) into the local in-memory store so the frontend can discover it.
get_local_approval_status
async def get_local_approval_status(approval_id: str) -> str | None
Check the status of an approval in the local in-memory store. Returns the status string or None if not found.
update_local_approval_status
async def update_local_approval_status(approval_id: str,
status: str,
note: str | None = None) -> None
Update the status of a local approval record.