Recognize and emit executable tool_calls in mixed prose streams; normalize roles and loosen tool-name matching#74
Merged
CJackHwang merged 1 commit intodevfrom Mar 2, 2026
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Open
CJackHwang
added a commit
that referenced
this pull request
Mar 2, 2026
Merge pull request #74 from CJackHwang/codex/fix-toolcall-whitelist-issue Recognize and emit executable tool_calls in mixed prose streams; normalize roles and loosen tool-name matching
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
developerrole tosystemin prompt normalization to keep role semantics consistent.Description
internal/adapter/openai/tool_sieve_core.goto emit pendingtool_callsevents for mixed prose and to preserve surrounding prefix/suffix text properly.consumeToolCaptureconstraints so non-whitespace wrapping no longer forces tool JSON to be treated only as plain text when it should be parsed as tool calls.internal/util/toolcalls_parse.gowithresolveAllowedToolNameand a loose punctuation-stripping pattern to accept qualified or punctuation-variant names (e.g.mcp.search_web,read-file) and canonicalize them.normalizeOpenAIRoleForPromptininternal/adapter/openai/message_normalize.goand applied it inresponses_input_items.goand message normalization to convertdevelopertosystem.API.md,README.en.md, andTESTING.mdclarifying that tool JSON in non-code-block contexts can be recognized even when mixed with prose and that fenced code block examples are exempt.Testing
go test ./... -count=1including updated packages; unit test suite passed.internal/adapter/openai,internal/adapter/gemini, andinternal/util(e.g. toolcalls parsing and message normalization tests) and they succeeded.Codex Task