From 3b02ed94ef62de18c0322fcdfb5ff7fc9bd93369 Mon Sep 17 00:00:00 2001 From: ScriptedAlchemy Date: Sun, 20 Sep 2026 10:34:00 +0000 Subject: [PATCH] test(mcp): wait for the seated index before pinning serving_branch active_project_reports_the_opened_checkout read the payload straight after open and pinned serving_branch to the opened branch. That field names the branch of the seated, current code index, and open returns before the first generation seats, so the read raced the seat and answered a truthful null on a loaded runner. Wait for the current generation before the first read. Co-Authored-By: Claude Fable 5.1 --- .../mcp_suite/mcp_handler_test/active_project_test.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/tracedecay/tests/mcp_suite/mcp_handler_test/active_project_test.rs b/crates/tracedecay/tests/mcp_suite/mcp_handler_test/active_project_test.rs index e0887a9de0..b7d22e9525 100644 --- a/crates/tracedecay/tests/mcp_suite/mcp_handler_test/active_project_test.rs +++ b/crates/tracedecay/tests/mcp_suite/mcp_handler_test/active_project_test.rs @@ -15,7 +15,7 @@ use tracedecay_runtime_core::storage::pin_fixture_repository_identity; use crate::support::{ TestTempDir, extract_real_server_text, handle_real_server_tool_call, - handle_real_server_tool_call_raw, test_temp_dir, + handle_real_server_tool_call_raw, test_temp_dir, wait_for_code_index_generation, }; const PROJECT_ID: &str = "proj_active_proof"; @@ -37,6 +37,11 @@ async fn active_project_reports_the_opened_checkout() { .harness .server(&opened.project_root) .expect("mounted production server"); + // `serving_branch` names the branch of the seated, current code index. + // Open returns before the first generation seats, so the payload read + // straight after open is a truthful `null` and not the exact answer this + // test pins. Wait for the seat first. + wait_for_code_index_generation(&server, "active_project_marker").await; let payload = call_json(&server, json!({"format": "json"})).await; assert_identity(&opened, &payload);