From b8963c18088c0333700d40849e359f2eca5f0f63 Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Thu, 5 Nov 2026 17:34:33 +0800 Subject: [PATCH] fix(mcp): clarify retained dossier handoff in crash prompt (#8437) --- src/contracts/promptContracts.ts | 2 +- tests/boundary/mcp/guidedWorkflowsMcp.test.ts | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/contracts/promptContracts.ts b/src/contracts/promptContracts.ts index 4251a49f0b..b7dfdc43f6 100644 --- a/src/contracts/promptContracts.ts +++ b/src/contracts/promptContracts.ts @@ -348,7 +348,7 @@ export const PROMPT_CONTRACTS = [ "analyze_function", ], instruction: - "Resolve crash text or addresses to function dossiers, requesting detail complete when build_call_path will consume them; do not infer a source location from symbol similarity alone.", + 'Resolve crash text or addresses to function dossiers. For same-session build_call_path, put {kind: "retained-evidence", evidence_id: } for each default summary into functions; request detail complete when the dossier must travel inline. Do not infer a source location from symbol similarity alone.', }, { tools: ["xrefs", "procedure_callers", "build_call_path"], diff --git a/tests/boundary/mcp/guidedWorkflowsMcp.test.ts b/tests/boundary/mcp/guidedWorkflowsMcp.test.ts index 5454759d47..739cfcf648 100644 --- a/tests/boundary/mcp/guidedWorkflowsMcp.test.ts +++ b/tests/boundary/mcp/guidedWorkflowsMcp.test.ts @@ -48,6 +48,27 @@ it.each(["full", "compact"])( "never as authorization", ); + const crashArguments = { crash_signal: "exception near dispatch" }; + const crashPrompt = await client.getPrompt({ + name: "trace_crash", + arguments: crashArguments, + }); + const crashContent = crashPrompt.messages[0]?.content; + expect(crashContent?.type).toBe("text"); + if (crashContent?.type !== "text") throw new Error("missing crash prompt"); + const crashWorkflow = await call("guided_workflows", { + action: "render", + workflow_id: "trace_crash", + arguments: crashArguments, + }); + expect(crashWorkflow.isError).not.toBe(true); + expect(crashWorkflow.structuredContent).toMatchObject({ + rendered_prompt: crashContent.text, + }); + expect(crashContent.text).toContain("normalized_result.parent_evidence_id"); + expect(crashContent.text).toContain("retained-evidence"); + expect(crashContent.text).toMatch(/complete.*inline/u); + for (const [input, expectedPaths] of [ [ { action: "render", workflow_id: "investigate_feature", arguments: {} },