fix(openai-compat): recover from malformed tool calls#64
Open
xjdr-noumena wants to merge 1 commit into
Open
Conversation
3 tasks
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
Clean malformed OpenAI-compatible tool-call recovery for #48 and the useful part of #52.
tool_useblocks with blank, missing, or non-string namestool_resultblocks so bad tool-call history does not poison every later OpenAI-compatible requestBash,Grep,Glob,Read,WebFetch, andWritencode_schema_leak_rejectedScope intentionally excluded from this PR:
This should be treated as partial #48 coverage plus the real #52 history-sanitizer fix.
Validation
Focused recovery tests:
/home/xjdr/.bun/bin/bun test \ src/services/api/openAICompatInferenceClient.test.ts \ src/services/tools/schemaConfusionHint.test.ts \ src/services/tools/schemaLeakTelemetry.test.tsResult:
93 pass, 0 fail.Contracts:
PATH="$HOME/.bun/bin:$PATH" timeout 120s /home/xjdr/.bun/bin/bun run test:contractsResult:
238 pass, 0 fail.Package smoke:
PATH="$HOME/.bun/bin:$PATH" timeout 180s /home/xjdr/.bun/bin/bun run test:package-smokeResult: passed. Security audit OK; native probe OK with documented
sharp-fallbackimage mode.Diff check:
Result: passed before commit.