Do not promote fenced code examples to tool calls and centralize tool-keyword detection#150
Merged
CJackHwang merged 2 commits intocodex/fix-tool-miscall-during-complex-json-testfrom Mar 22, 2026
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…odex/fix-markup-bypass-in-tool-call-parsing
58f753d
into
codex/fix-tool-miscall-during-complex-json-test
3 checks passed
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.
Motivation
tool_calls/tool_useevents so example content remains as text.Description
internal/js/helpers/stream-tool-sieve/tool-keywords.jswithTOOL_SEGMENT_KEYWORDSandearliestKeywordIndexto centralize keyword detection.parse.js) and sieve (sieve.js) to useTOOL_SEGMENT_KEYWORDSand a smallTOOL_MARKUP_PREFIXESlist and simplify fence-checking logic so fenced examples are preserved as content-only when appropriate.internal/util/toolcalls_candidates.go) to stop promoting fenced code examples by simplifyingshouldSkipToolCallParsingForCodeFenceExamplebehavior.handler_stream_test.go,handler_toolcall_test.go,render_test.go) to expect fenced JSON examples to remain content-only and add backward-compatible alias test functions for historical test names.Testing
go test ./...and verified the updated tests ininternal/adapter/claude,internal/adapter/openai, andinternal/format/openaipassed.Codex Task