Repository navigation
fix(openai-chat): suppress raw freeform MiMo call echoes #5804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
lidge-jun
merged 5 commits into
lidge-jun:dev
from
Vadevious:codex/fix-mimo-raw-tool-echo-dev
Sep 25, 2026
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c832a36
fix(openai-chat): suppress raw freeform MiMo call echoes
Vadevious 16b6b31
openai-chat: guard raw tool echo matching
Vadevious 1ee53b2
fix(openai-chat): match JSON freeform echoes safely
Vadevious 3447476
fix(openai-chat): use declared identity for echo matching
Vadevious 93b9602
docs: explain MiMo tool-call echo visibility
Vadevious File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Document the visible suppression change in
docs-site/.This branch removes raw freeform
<tool_call>text from responses. The PR updates the internal compatibility record but includes nodocs-site/change. Add a short user-facing note that states when raw echoes are suppressed and when ambiguous echoes remain visible. The applicable rule says, “Updatedocs-site/when the change affects user-visible behavior or configuration.” (github.com)🤖 Prompt for AI Agents
Source: Coding guidelines
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: lidge-jun/opencodex
Length of output: 17002
🏁 Script executed:
Repository: lidge-jun/opencodex
Length of output: 23869
🏁 Script executed:
Repository: lidge-jun/opencodex
Length of output: 24393
🏁 Script executed:
Repository: lidge-jun/opencodex
Length of output: 41841
🏁 Script executed:
Repository: lidge-jun/opencodex
Length of output: 41783
Use
restoredNamefor freeform input comparison.reconcileStructuredToolCallskeeps both names for matching, but the block checks pass the serialized block name toinputFromArguments. For an aliasedexecorapply_patchcall,unwrapFreeformToolInputthen misses the tool-specific fallback and treats{"cmd":"pwd"}or a patch wrapper as raw input. The bridge later unwraps the same arguments with the restored name, so the matcher can remove markup whose body differs from the dispatched input.Carry
restoredNamein the reference and use it only for unwrapping. Keep both names innamesfor block matching.Suggested fix
export interface StructuredToolCallReference { names: ReadonlySet<string>; argumentsText: string; freeform?: boolean; + restoredName?: string; } ... - const input = structured.names.has(repeated.name) ? inputFromArguments(structured.argumentsText, structured.freeform, repeated.name) : undefined; + const input = structured.names.has(repeated.name) + ? inputFromArguments(structured.argumentsText, structured.freeform, structured.restoredName ?? repeated.name) + : undefined; ... - const input = inputFromArguments(structured.argumentsText, structured.freeform, repeated.name); + const input = inputFromArguments(structured.argumentsText, structured.freeform, structured.restoredName ?? repeated.name); ... - const input = structured.names.has(call.name) ? inputFromArguments(structured.argumentsText, structured.freeform, call.name) : undefined; + const input = structured.names.has(call.name) + ? inputFromArguments(structured.argumentsText, structured.freeform, structured.restoredName ?? call.name) + : undefined; ... - return { names, freeform: call.freeform, argumentsText: repairArgumentsDuplicatedBesideSerializedCall(call.argumentsText, names, serializedText) }; + return { + names, + restoredName: call.restoredName, + freeform: call.freeform, + argumentsText: repairArgumentsDuplicatedBesideSerializedCall(call.argumentsText, names, serializedText), + };🤖 Prompt for AI Agents