Skip to content

fix(mcp): accept workflow id when confirming briefs - #7779

Merged
nettee merged 3 commits into
nexu-io:mainfrom
taljeon:codex/fix-confirm-brief-workflow-context
Sep 8, 2026
Merged

fix(mcp): accept workflow id when confirming briefs#7779
nettee merged 3 commits into
nexu-io:mainfrom
taljeon:codex/fix-confirm-brief-workflow-context

Conversation

@taljeon

@taljeon taljeon commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Fixes #7778

Why

I picked up the reported official Codex plugin integration failure because it blocks the confirmed brief from reaching the next OpenDesign step. collect_brief issues a pluginWorkflowId that the plugin is required to preserve, but confirm_brief had additionalProperties: false without declaring that field, so the local MCP rejected a valid follow-up call before confirmation could run.

The confirmation path also keeps that opaque correlation fail-closed: when a caller supplies the workflow id, it must be canonical and match the attribution stored with the brief draft instead of being silently replaced by a different inherited id. An ordinary brief without plugin attribution cannot be attached to an unrelated known workflow during confirmation.

What users will see

Confirming a brief through the official Codex plugin can now preserve the server-issued workflow context and continue normally instead of failing with PLUGIN_CONTRACT_REJECTED: confirm_brief.pluginWorkflowId is unsupported. Stale, cross-wired, or ordinary-draft workflow ids fail explicitly rather than confirming under another workflow.

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 flag, or new OD_* env var
  • API / contract β€” the local MCP confirm_brief input contract now accepts the existing opaque workflow-id field
  • 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
  • Default behavior change β€” changes what existing users experience without opting in
  • None β€” internal refactor, docs, tests, or translation update only

Screenshots

Not applicable; this changes the local MCP tool schema and has no UI surface.

Bug fix verification

  • Test path: apps/daemon/tests/mcp-observability.test.ts
  • Red on main: yes β€” the new regression failed with confirm_brief.pluginWorkflowId is unsupported.
  • Review regression: a different canonical workflow id initially resolved under the draft's stored id; it now fails with pluginWorkflowId does not match the brief draft, while the matching id succeeds.
  • Review regression: a known plugin workflow id attached to an ordinary brief initially acquired unrelated attribution; it now fails with pluginWorkflowId requires an attributed brief draft.
  • Green on this branch: yes β€” 15/15 focused observability tests and 32/32 related MCP brief/observability tests pass.

Validation

  • pnpm exec vitest run -c vitest.config.ts tests/mcp-observability.test.ts β€” 15 passed
  • pnpm exec vitest run -c vitest.config.ts tests/mcp-brief-app.test.ts tests/mcp-observability.test.ts β€” 32 passed
  • pnpm --filter @open-design/daemon typecheck
  • pnpm guard
  • pnpm typecheck
  • Initial full daemon suite before the two focused review follow-ups: 9,833 passed and 20 skipped. The unrelated membership test failure passed 4/4 when rerun alone; the non-loopback export hook timeout reproduced unchanged on clean origin/main, where its 12 tests were skipped. Final-head focused/related tests and all typecheck/guard checks above were rerun after both follow-ups.
  • git diff --check
  • Publication leak scan: no new secret, token, cookie, personal email, or local-path finding in the two changed files or this PR body; whole-tree findings are existing repository fixtures and generated/source baselines.

AI assistance

OpenAI Codex assisted with source navigation, implementation, and validation. I reviewed and verified the final change.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
πŸ“ Code Review βœ… Completed 2026-09-04T19:41:27.672476Z 57a7032 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with πŸ‘€ while any review is running, comments if it has suggestions, and reacts with πŸ‘ once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

πŸ’‘ Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 00648c8fce

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with πŸ‘.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/daemon/src/mcp.ts
@lefarcen
lefarcen requested a review from mrcfps September 4, 2026 19:25
@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 Sep 4, 2026
@lefarcen

lefarcen commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

πŸ§ͺ Queued for QA validation β€” this PR has changes that need a manual QA pass before it is merged. Nothing needed from you; we will update here once it is validated. Thanks for the contribution.

@lefarcen lefarcen added the needs-validation Runtime change detected; needs human or /explore agent validation. label Sep 4, 2026

@mrcfps mrcfps 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.

@taljeon this is a clean, well-scoped fix for #7778. I verified that confirm_brief now declares pluginWorkflowId with the same PLUGIN_WORKFLOW_ID_ARG used by the rest of the local MCP surface, so validateMcpToolArgs no longer rejects the plugin’s required reuse of the server-issued workflow id. The new assertion in apps/daemon/tests/mcp-observability.test.ts pins that schema boundary directly. Confirmation still inherits attribution from the draft, which is the right source of truth for this step.

Thanks for the precise diagnosis and the tiny, reviewable patch β€” this unblocks a real Codex plugin flow. πŸ™Œ

πŸ” Powered by Looper Β· runner=reviewer Β· agent=omp Β· An autonomous AI dev team for your GitHub repos.

@taljeon

taljeon commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

πŸ’‘ Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1181a5da37

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with πŸ‘.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/daemon/src/mcp.ts
@lefarcen
lefarcen requested a review from mrcfps September 4, 2026 19:38
@lefarcen lefarcen added size/S PR changes 20-100 lines and removed size/XS PR changes <20 lines labels Sep 4, 2026
@taljeon

taljeon commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 57a7032304

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with πŸ‘.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@mrcfps mrcfps 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.

@taljeon this is a clean, well-scoped follow-up for #7778. I reviewed the current head against the original contract hole and the two fail-closed cases that landed after the first patch.

confirm_brief now publishes pluginWorkflowId with the same PLUGIN_WORKFLOW_ID_ARG used by the rest of the local MCP surface, so additionalProperties: false no longer rejects the plugin’s required reuse of the server-issued id. When that id is supplied, resolveAttribution validates it as canonical and compares it to the draft: a matching id still inherits the stored attribution, a different canonical id fails with pluginWorkflowId does not match the brief draft, and a known or persisted id on an ordinary draft fails with pluginWorkflowId requires an attributed brief draft before the generic workflow branch can attach unrelated context. The three new assertions in apps/daemon/tests/mcp-observability.test.ts pin the schema boundary and both rejection paths.

Thanks for the precise diagnosis and for tightening the correlation contract after review β€” this unblocks the Codex plugin confirm path without loosening observability. πŸ™Œ

πŸ” Powered by Looper Β· runner=reviewer Β· agent=omp Β· An autonomous AI dev team for your GitHub repos.

@lefarcen
lefarcen requested a review from ivy-ting September 4, 2026 19:50
@ivy-tinggg

Copy link
Copy Markdown
Collaborator

@taljeon Thanks for the contribution. QA verified the confirm_brief workflow-id contract, matching attributed-draft continuation, rejection of mismatched workflow IDs, and rejection of workflow IDs on ordinary briefs. The related MCP tests, daemon typecheck, and CI pass at the current head. Conclusion: Accepted.

@ivy-tinggg ivy-tinggg added validated Runtime change validated (via /explore Pass or manual QA). and removed needs-validation Runtime change detected; needs human or /explore agent validation. labels Sep 7, 2026
@taljeon

taljeon commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the QA confirmation. With QA accepted and the required checks passing on 57a7032, could a maintainer merge this when convenient? There are no further changes planned from my side.

@nettee
nettee added this pull request to the merge queue Sep 8, 2026
Merged via the queue into nexu-io:main with commit 6b60b56 Sep 8, 2026
31 checks passed
@open-design-bot

Copy link
Copy Markdown
Contributor

πŸŽ‰ πŸ“‘ You just leveled up to Giotto

Giotto card for @taljeon

πŸ“‘ ✨ Sending steady signals.

πŸ™Œ Your contributions are sending a clear signal across the network: you care about making Open Design better. Keep transmitting.

πŸ’› Thanks for helping Open Design move forward. Keep building in the open. πŸš€


πŸ“Š Rank #157 among 700+ contributors

πŸ”— Share on X (English) Β· εˆ†δΊ«εˆ° XοΌˆδΈ­ζ–‡οΌ‰

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk/high High risk: apps/desktop, daemon, auth, migration, workflows, package deps size/S PR changes 20-100 lines type/bugfix Bug fix validated Runtime change validated (via /explore Pass or manual QA).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Codex plugin 0.5.3: confirmed brief rejects workflow context

5 participants