From 00949559a8a4757e1198e1ea582ebfcf7268fec4 Mon Sep 17 00:00:00 2001 From: main Date: Mon, 23 Mar 2026 19:16:10 -0400 Subject: Add blocking wait for background consult jobs --- crates/phone-opus/src/mcp/catalog.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'crates/phone-opus/src/mcp/catalog.rs') diff --git a/crates/phone-opus/src/mcp/catalog.rs b/crates/phone-opus/src/mcp/catalog.rs index f3f0925..a4a1780 100644 --- a/crates/phone-opus/src/mcp/catalog.rs +++ b/crates/phone-opus/src/mcp/catalog.rs @@ -51,6 +51,12 @@ const TOOL_SPECS: &[ToolSpec] = &[ dispatch: DispatchTarget::Host, replay: ReplayContract::Convergent, }, + ToolSpec { + name: "consult_wait", + description: "Block until one background consult job finishes or a timeout elapses. When the job has finished, the final Claude response or failure is included.", + dispatch: DispatchTarget::Host, + replay: ReplayContract::Convergent, + }, ToolSpec { name: "consult_jobs", description: "List recent background consult jobs. Defaults to render=porcelain; use render=json for structured output.", @@ -123,6 +129,26 @@ fn tool_schema(name: &str) -> Value { }, "required": ["job_id"] })), + "consult_wait" => with_common_presentation(json!({ + "type": "object", + "properties": { + "job_id": { + "type": "string", + "description": "Background consult job handle returned by consult with background=true." + }, + "timeout_ms": { + "type": "integer", + "minimum": 0, + "description": "Maximum time to wait for completion before returning the current job state. Defaults to 1800000 (30 minutes)." + }, + "poll_interval_ms": { + "type": "integer", + "minimum": 10, + "description": "Polling interval used while waiting. Defaults to 1000." + } + }, + "required": ["job_id"] + })), "consult_jobs" => with_common_presentation(json!({ "type": "object", "properties": { -- cgit v1.2.3