Skip to content

fix: keep extension fields on CreateTaskResult and GetTaskResult - #32

Open
jayzuccarelli wants to merge 1 commit into
modelcontextprotocol:mainfrom
jayzuccarelli:fix/open-task-results
Open

jayzuccarelli wants to merge 1 commit into
modelcontextprotocol:mainfrom
jayzuccarelli:fix/open-task-results

Conversation

@jayzuccarelli

Copy link
Copy Markdown

Summary

CreateTaskResult and GetTaskResult both extend the open Result type, but their v2 runtime schemas wrap the shape in a plain z.object, which strips unknown top-level keys. The notification params schema in the same file already uses openObject for exactly this reason (see the comment above TaskStatusNotificationParamsV2Schema).

The effect is that the same task carries different data depending on how it reaches the client. With a "vendor/trace" field on the task:

Path TaskView.extensions
notifications/tasks { "vendor/trace": { hop: 1 } }
tasks/get {}
CreateTaskResult {}

This PR uses openObject for both result schemas, so all three paths keep the field.

Changes

  • packages/ext-tasks/src/core/v2/schemas.ts: CreateTaskResultV2Schema and the wrapper side of GetTaskResultV2Schema use openObject instead of z.object.
  • packages/ext-tasks/src/core/v2/index.test.ts: new case next to the existing notification one, asserting that an extension field survives decoding for both results. It fails on main and passes here.

Testing

  • npm run check in packages/ext-tasks (provenance, prettier, eslint, typecheck, 193 tests, build, exports): passes.
  • npm run check:schema:ts and the generated-schema check at the repo root: pass.

I did not open an issue or raise this in the Agents WG first, since it is a small fix that follows a pattern already in the file. Happy to move it there if you prefer.

AI assistance (Claude Code) was used to find the gap, write the change and run the checks. I reviewed the diff.

Both results extend the open Result type, but their v2 schemas were plain
z.object wrappers, so unknown top-level keys were stripped on the polling
path. The notification params schema already uses openObject for the same
reason. Use it for both results as well, so projectTask() sees the same
extension fields whether a task arrives by tasks/get or notifications/tasks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 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 ⚠️ Failed 2026-10-13T11:45:08.902378Z 2c83c6a 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.

This branch has not been deployed

No deployments
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