PR #311 · pramaan-io/pramaan-functions · merged 2026-06-12
The client fires a launch command — and hears nothing back. No run.accepted, no receipt, no proof the run is live.
Story nine-eighty-eight
Wrong rail — run queued, nobody home.
The fix — Clerk rail, form ID, run accepted — every atlas intake lands on the right counter, and the client always gets its receipt.
sequenceDiagram autonumber participant client as Client participant router as Router participant worker as Worker client->>router: launch + form_id router->>router: pick clerk queue client for atlas_intake_review router-->>worker: enqueue on clerk rail router->>client: run.accepted client->>client: resume context
| Method | in → out | what it does |
|---|---|---|
_clerk_queue_client | () → AgentsRunQueueClient | returns the queue client bound to the clerk rail |
_queue_client_for | (agent_key) → AgentsRunQueueClient | picks the right queue client for a given agent key |
resolved_clerk_runs_queue_url | () → str | resolves the clerk queue URL from settings |
src/app_api/router_ws.py+59 −4WebSocket router that wires the launch path for atlas_intake_review; adds a clerk-rail queue client and a per-agent queue client picker so the run lands on the right rail and the client gets a run.accepted frame.
| new method | signature |
|---|---|
_clerk_queue_client | () → AgentsRunQueueClient |
_queue_client_for | (agent_key) → AgentsRunQueueClient |
form_id : str | NoneAgent command models that carry a form_id field, so each launch command is stamped with the form it belongs to and the router can route it accordingly.
form_id : str | NoneApp settings that add a configurable clerk runs queue URL and a resolver for it, so the clerk rail's address is not hardcoded into the router.
| new method | signature |
|---|---|
resolved_clerk_runs_queue_url | () → str |
clerk_runs_queue_url : str | None