Skip to content

Fix MCP prompts for resumed runs#5851

Open
mturac wants to merge 1 commit into
nexu-io:mainfrom
mturac:izon/open-design-5810-current-prompt
Open

Fix MCP prompts for resumed runs#5851
mturac wants to merge 1 commit into
nexu-io:mainfrom
mturac:izon/open-design-5810-current-prompt

Conversation

@mturac

@mturac mturac commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Fixes #5810

Why

While following the confirmed daemon-side trace in #5810, I reproduced the request-body gap in the MCP start_run path. The MCP prompt was persisted as message, but resumed sessions consume currentPrompt when the transcript is skipped. That left a follow-up run without its latest user turn and allowed it to finish successfully without producing new artifacts.

What users will see

Repeated MCP start_run calls on the same conversation now deliver the latest prompt to the resumed session. Follow-up requests can produce the requested artifacts instead of silently completing with no new output.

Surface area

  • UI — new page / dialog / panel / menu item / setting / empty state in apps/web or apps/desktop (including Electron menu bar)
  • Keyboard shortcut — new or changed
  • CLI / env var — new od subcommand or flag, new tools-dev / tools-pack / tools-pr flag, or new OD_* env var
  • API / contract — new /api/* endpoint, new SSE event, or changed shape in packages/contracts
  • Extension point — new entry under skills/, design-systems/, design-templates/, or craft/, or change to the skills protocol
  • i18n keys — added new translation keys (see TRANSLATIONS.md for the locale workflow)
  • New top-level dependency — adding any new entry to the root package.json (dependencies or devDependencies); workspace-package package.json files are out of scope. Include a paragraph on what we get vs. what bytes we ship (see CONTRIBUTING.md → Code style)
  • Default behavior change — changes what existing users experience without opting in (default model, default setting, file/SQLite schema, auto-network on startup, auto-install)
  • None — internal refactor, docs, tests, or translation update only

Screenshots

Not applicable; this change has no UI surface.

Bug fix verification

  • Test path: apps/daemon/tests/mcp-runs.test.ts
  • Red/green proof: yes. The focused suite failed on the missing currentPrompt field before the source change (2 failed, 30 passed), then passed after the fix (32 passed).

Validation

  • corepack pnpm --filter @open-design/daemon exec vitest run -c vitest.config.ts tests/mcp-runs.test.ts
  • corepack pnpm --filter @open-design/daemon typecheck
  • corepack pnpm guard
  • git diff --check

@lefarcen
lefarcen requested a review from PerishCode July 18, 2026 08:02
@lefarcen lefarcen added size/XS PR changes <20 lines risk/high High risk: apps/desktop, daemon, auth, migration, workflows, package deps type/bugfix Bug fix labels Jul 18, 2026
@lefarcen lefarcen added the needs-validation Runtime change detected; needs human or /explore agent validation. label Jul 18, 2026
@lefarcen

Copy link
Copy Markdown
Contributor

🧪 Queued for QA validation — this PR has changes that need a manual QA pass before it's merged. Nothing needed from you; we'll update here once it's validated. Thanks for the contribution! 🙏

@PerishCode PerishCode left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mturac Thanks for the tight, well-scoped fix. I traced the resume path to confirm it: startRun in apps/daemon/src/mcp.ts now sets currentPrompt alongside message, which matches how the web chat surface always populates both fields (packages/contracts/src/api/chat.ts, examples.ts). This closes the real gap — when a resumed adapter skips the transcript, composeChatUserRequestForAgent (apps/daemon/src/server.ts:1420) reads bodySource from currentPrompt, so the previous MCP omission left the follow-up turn empty and let the run finish with no new artifacts. Setting currentPrompt on first runs is harmless: the form-answer transition only fires when the prompt matches the form-answers header, not a normal prompt. The mcp-runs.test.ts assertions were updated for both the plugin and active-context cases, and the red/green proof in the PR body is convincing. Nice, focused bugfix.

🔁 Powered by Looper · runner=reviewer · agent=claude-code · An autonomous AI dev team for your GitHub repos.

@lefarcen
lefarcen requested a review from AmyShang-alt July 18, 2026 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-validation Runtime change detected; needs human or /explore agent validation. risk/high High risk: apps/desktop, daemon, auth, migration, workflows, package deps size/XS PR changes <20 lines type/bugfix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP start_run: second run on the same conversation silently produces no artifacts (reports succeeded)

3 participants