nexu-io/open-design · error · Error

confirm_brief requires the same local MCP session that creat

Error message

confirm_brief requires the same local MCP session that created the draft

What it means

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.

Source

Thrown at apps/daemon/src/mcp.ts:2043

    const workspaceId = workspaceContext?.workspaceId;
    switch (name) {
      case 'collect_brief': {
        const collected = (options.briefStore ?? createLocalMcpBriefStore())
          .collect(args);
        const copy = localMcpBriefResponseCopy(collected.locale);
        return {
          content: [
            {
              type: 'text' as const,
              text: copy.completeCard,
            },
          ],
          structuredContent: collected as unknown as JsonObject,
        };
      }
      case 'confirm_brief': {
        if (!options.briefStore) {
          throw new Error(
            'confirm_brief requires the same local MCP session that created the draft',
          );
        }
        const confirmed = options.briefStore.confirm(args);
        const copy = localMcpBriefResponseCopy(confirmed.locale);
        return {
          content: [
            {
              type: 'text' as const,
              text: [
                copy.confirmed,
                '',
                confirmed.summary,
                '',
                copy.continueWithBrief,
              ].join('\n'),
            },
          ],

View on GitHub (pinned to 5be4028344)

Solutions

  1. Run collect_brief and confirm_brief on the same local MCP session.
  2. Ensure the daemon wires briefStore into the confirm_brief handler via createLocalMcpBriefStore.
  3. Do not split the brief flow across transports.

Example fix

// before: confirm on connection B (no brief store)
clientB.confirm_brief({ briefDraftId, nonce, answers })

// after: confirm on the same session that collected
clientA.confirm_brief({ briefDraftId: clientADraft.briefDraftId, nonce: clientADraft.nonce, answers })
Defensive patterns

Strategy: validation

Validate before calling

if (!briefStore) {
  throw new Error('confirm_brief must run on the same local MCP session that ran collect_brief');
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of nexu-io/open-design@5be4028344 (2026-08-12). Data as JSON: /api/errors/c51bd536004a0cef. Report an issue: GitHub.