Skip to content

feat(coderd/x/chatd/mcpclient): count only text toward the in-process tool result cap - #31386

Merged
ethanndickson merged 1 commit into
codagt-1430-workspace-mcp-resultsfrom
codagt-1430-inprocess-mcp-media-cap
Nov 10, 2026
Merged

ethanndickson merged 1 commit into
codagt-1430-workspace-mcp-resultsfrom
codagt-1430-inprocess-mcp-media-cap

Conversation

@ethanndickson

Copy link
Copy Markdown
Member

Part of CODAGT-1430. Stacked on #31385.

Inline and in-process MCP servers cap each tool result at 256 KiB, and media counts at its base64 size, so a PDF over about 190 KiB becomes an error. In-process servers are our own code running in coderd, so we'll count only their text toward the cap, and leave their media to the 10 MiB tool media cap in chatloop. Inline servers are untrusted, so they still count base64 media.

@linear-code

linear-code Bot commented Oct 28, 2026

Copy link
Copy Markdown

CODAGT-1430

@ethanndickson
ethanndickson force-pushed the codagt-1430-inprocess-mcp-media-cap branch from 8c9f73b to b0f3fbe Compare October 28, 2026 02:05
@ethanndickson
ethanndickson force-pushed the codagt-1430-inprocess-mcp-media-cap branch from b0f3fbe to da244f2 Compare November 3, 2026 06:22
@ethanndickson

Copy link
Copy Markdown
Member Author

@codex security review

@ethanndickson

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T06:07:12.978524Z 4047bc3 Manual request
🔒 Security Review ✅ Completed 2026-11-03T06:27:26.826938Z da244f2 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

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: da244f22a7

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: da244f22a7

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ethanndickson

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 704b4f8fe2

ℹ️ 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".

@ethanndickson
ethanndickson force-pushed the codagt-1430-inprocess-mcp-media-cap branch from 704b4f8 to 106bfca Compare November 4, 2026 07:16
@ethanndickson
ethanndickson marked this pull request as ready for review November 4, 2026 07:54
@ethanndickson
ethanndickson force-pushed the codagt-1430-inprocess-mcp-media-cap branch from 106bfca to 1a3c946 Compare November 5, 2026 08:12
@ethanndickson
ethanndickson force-pushed the codagt-1430-inprocess-mcp-media-cap branch from 1a3c946 to 4047bc3 Compare November 9, 2026 06:04
@ethanndickson

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 4047bc3993

ℹ️ 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".

@ethanndickson
ethanndickson force-pushed the codagt-1430-inprocess-mcp-media-cap branch from 4047bc3 to d266631 Compare November 9, 2026 06:47
… tool result cap

In-process MCP servers run trusted code in coderd. Their tool results
now count only text toward the 256 KiB cap, so their media is bounded
only by the chatloop tool media cap. Inline servers still count base64
media toward the cap.
@ethanndickson
ethanndickson force-pushed the codagt-1430-inprocess-mcp-media-cap branch from d266631 to 8d8c8f3 Compare November 9, 2026 07:32
@ethanndickson
ethanndickson merged commit 661b7db into main Nov 10, 2026
35 of 56 checks passed
@ethanndickson
ethanndickson deleted the codagt-1430-inprocess-mcp-media-cap branch November 10, 2026 13:06
ethanndickson added a commit that referenced this pull request Nov 10, 2026
Closes CODAGT-1425

Stacked on #31386.

coder/fantasy#78, which is already on `main`, fixed the searches with no
reasoning before them by sending them inline without their `id`. Stored
chats still send a search as an `item_reference` when a reasoning item
came right before it, though. The API pairs any stored ID with that
reasoning item and rejects the whole request if it's missing, and a
reference doesn't save any tokens over an inline item anyway.

This bumps fantasy to pick up coder/fantasy#77, which just never
references a search, so stored chats now replay earlier searches inline,
like unstored ones. It also drops the `id` from replayed computer calls,
which have the same problem.

I've had to stack this on the CODAGT-1430 PRs, as coder/fantasy#77
merged after coder/fantasy#73 and coder/fantasy#74, so any pin that has
it has them too. `TestOpenAIResponsesNoStaleWebSearchReplay` now covers
a stored chat, and I deleted
`TestOpenAIResponsesFullReplayPairsReasoningAndWebSearch`, as it
asserted the order of references we no longer send.
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.

2 participants