From 24221826ed52a329ee431c1df47c5d6596180b0c Mon Sep 17 00:00:00 2001 From: altair823 Date: Mon, 25 May 2026 09:08:40 +0000 Subject: [PATCH] =?UTF-8?q?chore(mcp):=20PR=20#172=20=ED=9A=8C=EC=B0=A8=20?= =?UTF-8?q?1=20=EB=A6=AC=EB=B7=B0=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `ask_tool_routes_multi_hop_true_to_decompose_first` 의 error code 검증을 더 견고하게 — `model_unreachable | timeout` 둘 다 accept. 환경 차이 (즉시 ECONNREFUSED vs connect timeout) 가 다른 wire code 로 분류돼도 dispatch divergence 자체 (schema_version=error.v1 + isError=true vs single-pass 의 answer.v1 grounded=false) 는 동일하게 검증. 검증 - `cargo test -p kebab-mcp -j 1 --test tools_call_ask_multi_hop` 2 통과. Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/kebab-mcp/tests/tools_call_ask_multi_hop.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/crates/kebab-mcp/tests/tools_call_ask_multi_hop.rs b/crates/kebab-mcp/tests/tools_call_ask_multi_hop.rs index b7cc482..10a5345 100644 --- a/crates/kebab-mcp/tests/tools_call_ask_multi_hop.rs +++ b/crates/kebab-mcp/tests/tools_call_ask_multi_hop.rs @@ -91,9 +91,17 @@ async fn ask_tool_routes_multi_hop_true_to_decompose_first() { }; let mh_v: serde_json::Value = serde_json::from_str(&mh_text).unwrap(); assert_eq!(mh_v["schema_version"], "error.v1"); - assert_eq!( - mh_v["code"], "model_unreachable", - "multi-hop dispatch must hit the LLM and surface model_unreachable; got {mh_v}" + // The dispatch contract is "multi-hop reached the LLM". The exact + // error code depends on how the host TCP stack reports an + // unreachable port — fast-path `ECONNREFUSED` classifies as + // `model_unreachable`, but environments that take the connect + // timeout path (some CI / Docker network stacks) surface + // `timeout`. Accept either. + let mh_code = mh_v["code"].as_str().unwrap_or(""); + assert!( + matches!(mh_code, "model_unreachable" | "timeout"), + "multi-hop dispatch must reach the LLM and surface model_unreachable/timeout; \ + got code={mh_code:?} from {mh_v}" ); // Single-pass branch — empty KB short-circuits at retrieve, no LLM