From d5d7f6887662003e57faf67e0b39e1a5cf48f6e4 Mon Sep 17 00:00:00 2001 From: Sam & Claude Date: Fri, 26 Jun 2026 02:45:25 +0200 Subject: [PATCH] fix(socket): intake-task now returns full task with id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously intake-task returned {"status":"queued"} with no task_id, breaking runbook steps 3-4 that needed the id for transition-task. Now cmd_intake_task creates the task in the store immediately (like create-task) and returns the full Task object including id, status, title, etc. The scheduler queue path is unchanged — the task is still pushed to the intake queue for the tick to route/claim. Test updated: scheduler_routes_intake verifies response contains id. --- crates/colibri-daemon/src/socket.rs | 8 +++++++- crates/colibri-daemon/tests/multi_agent_board.rs | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/crates/colibri-daemon/src/socket.rs b/crates/colibri-daemon/src/socket.rs index 2284f4b..312c2a6 100644 --- a/crates/colibri-daemon/src/socket.rs +++ b/crates/colibri-daemon/src/socket.rs @@ -1082,13 +1082,19 @@ async fn cmd_intake_task( capabilities: Option>, ) -> ColibriResponse { let caps = capabilities.unwrap_or_default(); + // Create the task immediately so the caller gets the ID back. + let task = match state.store.lock().unwrap().create_task(&title, description.as_deref()) { + Ok(t) => t, + Err(e) => return ColibriResponse::err(format!("create task failed: {e}")), + }; + // Also queue for the scheduler tick to route to a capable agent. let mut scheduler = state.scheduler.lock().await; scheduler.submit(crate::scheduler::TaskRequest { title, description, required_capabilities: caps, }); - ColibriResponse::ok(serde_json::json!({"status": "queued"})) + ColibriResponse::ok(serde_json::to_value(&task).unwrap_or_default()) } async fn cmd_set_cost_mode(state: &SharedState, mode: String) -> ColibriResponse { diff --git a/crates/colibri-daemon/tests/multi_agent_board.rs b/crates/colibri-daemon/tests/multi_agent_board.rs index 7ab5052..ef0ea31 100644 --- a/crates/colibri-daemon/tests/multi_agent_board.rs +++ b/crates/colibri-daemon/tests/multi_agent_board.rs @@ -198,7 +198,8 @@ async fn scheduler_routes_intake_tasks_by_capability() { r#"{"cmd":"intake-task","title":"scrub zroot","capabilities":["freebsd"]}"#, ) .await; - assert_eq!(fs_intake["data"]["status"].as_str(), Some("queued")); + // Intake now returns the full task (id + status), not just {"status":"queued"}. + assert!(fs_intake["data"]["id"].is_string(), "intake must return task id"); send_command( &socket_path, -- 2.45.3