Skip to content

test(mcp): negotiate the non-task revision for real in the required-tool unit test (#369 follow-up) - #553

Merged
ScriptedAlchemy merged 3 commits into
mainfrom
test/369-mcp-tasks-real-negotiation
Sep 4, 2026
Merged

test(mcp): negotiate the non-task revision for real in the required-tool unit test (#369 follow-up)#553
ScriptedAlchemy merged 3 commits into
mainfrom
test/369-mcp-tasks-real-negotiation

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Follow-up to #550 (merged as 415583176), answering the Codex P1 thread on mcp-tasks.ts ("Keep required tools callable on non-task revisions", discussion) with a stronger pin. #550 auto-merged while this commit was being gated, so it lands here rather than on that branch.

What changes

Test-only. The unit test pinning the fix — tests/mcp-tasks.test.ts, "serves every tool as an ordinary request on a revision without the core Tasks utility, required ones included" — narrowed the server's negotiated version with Object.defineProperty(tasks, 'getNegotiatedProtocolVersion', …). It now negotiates the session for real through the SDK's initialize handshake: the client is constructed with supportedProtocolVersions: ['2025-06-18'] (a revision whose core has no Tasks utility), the server counter-offers it, and the test asserts the server's own getNegotiatedProtocolVersion() is 2025-06-18 before checking that an ordinary call to a taskSupport: 'required' tool is served and that params.task is ignored (no task record is created).

Why 2025-06-18 and not 2026-07-28: the SDK opens a 2026-07-28 session only through its serving entries (the stdio entry and createMcpHandler), which mark the instance modern with a package-internal write; a hand-connected InMemoryTransport pair cannot negotiate it ({ pin: '2026-07-28' } fails, 'auto' falls back to legacy — verified against @modelcontextprotocol/{client,server}@2.0.0). The gate under test is "negotiated revision ≠ 2025-11-25", so any other genuinely negotiated revision drives the same branch, and a real handshake is stronger evidence than a stubbed accessor.

Verified the test fails on the pre-fix mcp-tasks.ts with exactly the -32601 the thread describes, and passes on main.

Changeset

None: the only change is under packages/agent-bundle/tests/**, which .changeset/config.json exempts (pnpm changeset status --since=origin/main reports no package to bump).

Verification

pnpm typecheck, pnpm lint, pnpm test:unit on the parent tree (3341 passed), rstest packages/agent-bundle/tests/mcp-tasks.test.ts (11 passed) on this branch.

Self-review

Reviewer: change-risk-reviewer subagent on GPT-5.6 Sol, diff vs origin/main at 4945ad4f5. No findings: the gate in mcp-tasks.ts is strict equality on 2025-11-25, so 2025-06-18 drives the same ordinary-request branch a 2026-07-28 session would; @modelcontextprotocol/client@2.0.0 declares supportedProtocolVersions and its legacy handshake negotiates 2025-06-18 over an InMemoryTransport pair against server 2.0.0; the test still fails pre-fix with -32601; tests/** is exempt from changesets and Changeset present passed.

…ool unit test

The test pinning the Codex P1 fix (required tools stay callable on a session
without the core Tasks utility) narrowed the server's negotiated version with
Object.defineProperty. The SDK client can offer an older revision through
supportedProtocolVersions, so the session is now negotiated for real at
2025-06-18 through the initialize handshake and the server's own
getNegotiatedProtocolVersion() is asserted. A 2026-07-28 session is opened
only by the SDK's serving entries (stdio/HTTP), never by a hand-connected
in-memory pair, and takes the same branch: anything but 2025-11-25 serves
every tool on the ordinary contract.
@changeset-bot

changeset-bot Bot commented Sep 4, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 25c1e28

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@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:24:51.550977Z 2b3d7ed 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 4, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle@553
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/create-agent-bundle@553
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/runtime@553

commit: 25c1e28

@ScriptedAlchemy
ScriptedAlchemy enabled auto-merge (squash) September 4, 2026 20:17
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