From d34d9c6986e621163ff69ae1839429f2ac00d381 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Fri, 17 Jul 2026 18:11:06 +0100 Subject: [PATCH] Capture proxy logs in conformance CI runs The MCP conformance job fails intermittently on tools-call-sampling with a 60s "Request timed out" on the client side. The uploaded results artifact only contains the conformance client's view (checks.json), which cannot tell us whether the sampling server->client round-trip stalled in the ToolHive proxy or in the reference server, so the flake has been undiagnosable from CI alone and does not reproduce locally. Capture the ToolHive proxy logs (thv logs --proxy) into the results directory on teardown, tee the suite output alongside them, and run the proxied server with --debug so the proxy logs show the per-request message flow. The workflow already uploads test/conformance/results on always(), so these land in the existing conformance-results artifact with no workflow change. This adds no fix; it makes the next CI failure debuggable. Co-Authored-By: Claude Opus 4.8 --- test/conformance/run-conformance.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/conformance/run-conformance.sh b/test/conformance/run-conformance.sh index 5749fc6cd9..9b679f34ae 100755 --- a/test/conformance/run-conformance.sh +++ b/test/conformance/run-conformance.sh @@ -30,6 +30,11 @@ export TOOLHIVE_SKIP_DESKTOP_CHECK=1 CLONE_DIR="" cleanup() { + # Diagnostics: capture the ToolHive proxy logs before teardown so a CI failure + # (e.g. the sampling round-trip timing out) is debuggable from the uploaded + # results artifact, not just the client-side checks.json. + mkdir -p "${RESULTS_DIR}" + "${THV_BINARY}" logs --proxy "${SERVER_NAME}" > "${RESULTS_DIR}/proxy-logs.txt" 2>&1 || true "${THV_BINARY}" rm "${SERVER_NAME}" >/dev/null 2>&1 || true [ -n "${CLONE_DIR}" ] && rm -rf "${CLONE_DIR}" || true } @@ -61,7 +66,7 @@ docker build -t "${IMAGE}" "${SERVER_DIR}" echo "==> Starting server through ToolHive" "${THV_BINARY}" rm -f "${SERVER_NAME}" >/dev/null 2>&1 || true "${THV_BINARY}" run "${IMAGE}" \ - --transport streamable-http --target-port 3000 --name "${SERVER_NAME}" + --transport streamable-http --target-port 3000 --name "${SERVER_NAME}" --debug echo "==> Resolving proxy URL" URL="" @@ -89,8 +94,9 @@ done echo "==> Running conformance suite (${CONFORMANCE_SUITE})" rm -rf "${RESULTS_DIR}" +mkdir -p "${RESULTS_DIR}" npx -y "@modelcontextprotocol/conformance@${CONFORMANCE_VERSION}" server \ --url "${URL}" \ --suite "${CONFORMANCE_SUITE}" \ --expected-failures "${EXPECTED_FAILURES}" \ - -o "${RESULTS_DIR}" + -o "${RESULTS_DIR}" 2>&1 | tee "${RESULTS_DIR}/suite-output.log"