Add outbound agent response boundary

This commit is contained in:
2026-05-12 08:10:34 -05:00
parent bce93b39e0
commit 7286a241e4
2 changed files with 76 additions and 9 deletions

View File

@@ -128,6 +128,31 @@ async def test_message(session_id: str = Form(...), message: str = Form(...), us
}
@app.post("/admin/test-agent-response")
async def test_agent_response(
session_id: str = Form(...),
message: str = Form(...),
mode: str = Form("admin"),
) -> dict:
"""Send a test agent response through the outbound boundary."""
if not orchestrator:
raise HTTPException(status_code=503, detail="Orchestrator not initialized")
delivery = await orchestrator.emit_agent_response(
session_id=session_id,
message=message,
mode=mode,
)
if not delivery.get("sent"):
raise HTTPException(status_code=404, detail=delivery.get("reason", "send_failed"))
return {
"status": "agent_response_emitted",
"delivery": delivery,
"timestamp": datetime.utcnow().isoformat(),
}
@app.get("/admin/ledger")
async def get_ledger(session_id: str) -> dict:
"""Get the markdown ledger for a session."""