fix(translation): hint upstream model to omit empty pages on Read tool#437
Merged
icebear0828 merged 1 commit intodevfrom May 3, 2026
Merged
fix(translation): hint upstream model to omit empty pages on Read tool#437icebear0828 merged 1 commit intodevfrom
icebear0828 merged 1 commit intodevfrom
Conversation
Upstream gpt-5.x tends to fill optional string fields (Read tool's `pages`) with `""` rather than omit them. Claude Code harness then routes the empty string into the PDF branch and errors. Lightest-touch nudge: in `anthropicToolsToCodex`, when the tool name is "Read", append a sentence to the `pages` property description telling the model to omit the field for non-PDF files. Idempotent (safe across multi-turn replays), zero impact on other tools, keeps Codex tool_use arguments otherwise pass-through. 5 new vitest specs cover the augmentation, idempotency, non-Read tool isolation, and field preservation.
5698200 to
7515feb
Compare
2 tasks
icebear0828
added a commit
that referenced
this pull request
May 5, 2026
The soak check measures `now - dev_HEAD_timestamp >= 24h`, which means every new merge into dev resets the clock. Under any non-trivial merge cadence, dev never satisfies the soak gate and master stagnates: PRs #437/#438/#439/#440/#442 all stacked on dev for a week with no promotion. Add a `force_skip_soak` boolean input to workflow_dispatch (default false). Schedule cron remains untouched and continues to enforce the 24h rule. Only manual triggers can bypass, and only when the operator explicitly sets the input to true — intended for sync-back / merge commits whose content has actually been on dev long enough but whose HEAD timestamp is misleadingly fresh. Test plan: yaml syntax verified via js-yaml. Functional verification will be the next manual workflow_dispatch run with the input set. Co-authored-by: icebear0828 <icebear0828@users.noreply.github.com>
icebear0828
added a commit
that referenced
this pull request
May 5, 2026
#437) Upstream gpt-5.x tends to fill optional string fields (Read tool's `pages`) with `""` rather than omit them. Claude Code harness then routes the empty string into the PDF branch and errors. Lightest-touch nudge: in `anthropicToolsToCodex`, when the tool name is "Read", append a sentence to the `pages` property description telling the model to omit the field for non-PDF files. Idempotent (safe across multi-turn replays), zero impact on other tools, keeps Codex tool_use arguments otherwise pass-through. 5 new vitest specs cover the augmentation, idempotency, non-Read tool isolation, and field preservation. Co-authored-by: icebear0828 <icebear0828@users.noreply.github.com>
icebear0828
added a commit
that referenced
this pull request
May 5, 2026
The soak check measures `now - dev_HEAD_timestamp >= 24h`, which means every new merge into dev resets the clock. Under any non-trivial merge cadence, dev never satisfies the soak gate and master stagnates: PRs #437/#438/#439/#440/#442 all stacked on dev for a week with no promotion. Add a `force_skip_soak` boolean input to workflow_dispatch (default false). Schedule cron remains untouched and continues to enforce the 24h rule. Only manual triggers can bypass, and only when the operator explicitly sets the input to true — intended for sync-back / merge commits whose content has actually been on dev long enough but whose HEAD timestamp is misleadingly fresh. Test plan: yaml syntax verified via js-yaml. Functional verification will be the next manual workflow_dispatch run with the input set. Co-authored-by: icebear0828 <icebear0828@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upstream gpt-5.x tends to fill optional string fields with
""rather thanomit them. For Claude Code's
Readtool, that meanspages: ""even onnon-PDF files — the harness then routes the empty string through the PDF
branch and errors out.
The proxy is otherwise pass-through for tool_use arguments, so the cleanest
nudge is to append a one-line hint to the
pagesproperty's description inthe schema we forward upstream. The model reads property descriptions when
deciding whether to fill a field; this is the cheapest, least invasive fix.
Changes
src/translation/tool-format.ts— newaugmentReadToolSchemahelper, called fromanthropicToolsToCodexonly whenname === "Read". Appends" Omit this field entirely for non-PDF files; do not pass an empty string."to thepagesproperty description. Idempotent (won't double-append on multi-turn replays). Zero impact on other tools.tests/unit/translation/tool-format.test.ts— 5 new specs covering the augmentation, idempotency, non-Read isolation, schema with nopagesfield, and preservation of sibling fields.CHANGELOG.md—[Unreleased] / Fixedentry.Test Plan
npx vitest run tests/unit/translation/tool-format.test.ts— 60/60 passnpx vitest run— 1654 pass, 1 skipped, 145 filesnpx tsc --noEmit— cleanNotes
git diff --ignore-cr-at-eol tests/unit/translation/tool-format.test.tsto see the actual delta is +93 LOC. Happy to follow up with a separate normalization PR if desired.pages === ""as unset). I can also file an issue againstanthropics/claude-codeif helpful.