Skip to content

refactor(dev): remove the unreported MCP protocolEra field - #836

Closed
ScriptedAlchemy wants to merge 3 commits into
mainfrom
legacy/protocol-era
Closed

ScriptedAlchemy wants to merge 3 commits into
mainfrom
legacy/protocol-era

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

Remove the protocolEra field from runtime MCP connection state. The MCP client (@modelcontextprotocol/client 2.0.0) has no getProtocolEra method, so client.getProtocolEra?.() always produced undefined and the 'legacy' branch was unreachable. Only test fixtures and the rsc-agent-runtime example stamped 'modern'.

That dead field also hid a real gate failure. McpAppRuntimePreviewService refused any stable session whose protocolEra was undefined, so a session opened through the real client could never satisfy it. The gate now checks the fields a client actually negotiates: capabilities, protocol version, and server identity.

Removal matrix

Removed Callers migrated Deleted surface
DevRuntimeMcpConnectionState.protocolEra (agent-bundle/api) dev registry, runtime MCP routes, rsc-agent-runtime example session public field
McpClient.getProtocolEra, McpSessionConnectionState.protocolEra MCP session connect internal optional method and field
Workbench protocolEra validators route client, App client, session controller runtimeEra and three 'legacy' | 'modern' checks

Fixtures in 17 test files drop the field. Strict key checks in the Workbench route and App clients now reject a connection that still carries it.

Verification

On this branch merged with origin/main (f1db114528):

  • pnpm build: pass
  • pnpm typecheck: pass
  • pnpm lint: pass
  • pnpm test:unit: pass (311 files, 4,494 tests)
  • pnpm test:integration:run: pass (104 files, 1,187 tests; whole pool because a public type changed)
  • pnpm docs:site:build: pass (0 broken links across 30,549 anchors, language parity OK)

Part of the legacy-API removal sweep. Does not overlap #810's files.

@changeset-bot

changeset-bot Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 831ac0e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
agent-bundle Minor
create-agent-bundle Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 25, 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-25T00:26:34.504844Z cd9715c PR opened
ℹ️ 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.

@pkg-pr-new

pkg-pr-new Bot commented Sep 25, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle@836
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/create-agent-bundle@836
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/rsc-markdown-stream@836
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/runtime@836

commit: 831ac0e

@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Closing. The premise was wrong. @modelcontextprotocol/client 2.0.0 implements Client.getProtocolEra() (dist/index.mjs:3418), deriving 'modern' | 'legacy' from the negotiated protocol version, and the SDK itself branches on it. The earlier search missed it because ripgrep skipped the gitignored dist directory. protocolEra is current MCP protocol metadata, not an agent-bundle compatibility path, so it stays.

@ScriptedAlchemy
ScriptedAlchemy deleted the legacy/protocol-era branch September 25, 2026 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant