{"record":{"id":"c51bd536004a0cef","repo":"nexu-io/open-design","slug":"confirm-brief-requires-the-same-local-mcp-session","errorCode":null,"errorMessage":"confirm_brief requires the same local MCP session that created the draft","messagePattern":"confirm_brief requires the same local MCP session that created the draft","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/daemon/src/mcp.ts","lineNumber":2043,"sourceCode":"    const workspaceId = workspaceContext?.workspaceId;\n    switch (name) {\n      case 'collect_brief': {\n        const collected = (options.briefStore ?? createLocalMcpBriefStore())\n          .collect(args);\n        const copy = localMcpBriefResponseCopy(collected.locale);\n        return {\n          content: [\n            {\n              type: 'text' as const,\n              text: copy.completeCard,\n            },\n          ],\n          structuredContent: collected as unknown as JsonObject,\n        };\n      }\n      case 'confirm_brief': {\n        if (!options.briefStore) {\n          throw new Error(\n            'confirm_brief requires the same local MCP session that created the draft',\n          );\n        }\n        const confirmed = options.briefStore.confirm(args);\n        const copy = localMcpBriefResponseCopy(confirmed.locale);\n        return {\n          content: [\n            {\n              type: 'text' as const,\n              text: [\n                copy.confirmed,\n                '',\n                confirmed.summary,\n                '',\n                copy.continueWithBrief,\n              ].join('\\n'),\n            },\n          ],","sourceCodeStart":2025,"sourceCodeEnd":2061,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/apps/daemon/src/mcp.ts#L2025-L2061","documentation":"confirm_brief is dispatched only when options.briefStore is set; briefStore is a per-local-MCP-session object created by createLocalMcpBriefStore and bound to the session that ran collect_brief. If the dispatcher handling confirm_brief has no briefStore, the call arrived on a session or transport that never owned a brief: a cross-session or mis-wired invocation.","triggerScenarios":"Calling confirm_brief over a different MCP connection than the one that called collect_brief; confirm_brief routed through a transport that does not instantiate the local brief store; a tool dispatcher constructed without briefStore wiring.","commonSituations":"Two MCP clients in use; confirm sent to the live-artifacts or general server instead of the local brief server; a daemon config regression that dropped briefStore from the handler deps.","solutions":["Run collect_brief and confirm_brief on the same local MCP session.","Ensure the daemon wires briefStore into the confirm_brief handler via createLocalMcpBriefStore.","Do not split the brief flow across transports."],"exampleFix":"// before: confirm on connection B (no brief store)\nclientB.confirm_brief({ briefDraftId, nonce, answers })\n\n// after: confirm on the same session that collected\nclientA.confirm_brief({ briefDraftId: clientADraft.briefDraftId, nonce: clientADraft.nonce, answers })","handlingStrategy":"validation","validationCode":"if (!briefStore) {\n  throw new Error('confirm_brief must run on the same local MCP session that ran collect_brief');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep collect_brief and confirm_brief on one MCP session.","Confirm briefStore is wired into the daemon's confirm_brief handler via createLocalMcpBriefStore.","Never split the brief flow across transports."],"tags":["mcp","brief","session","wiring"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}