fix: preserve LM Studio Responses tool arguments#90593
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 7, 2026, 3:12 AM ET / 07:12 UTC. Summary PR surface: Source +7, Tests +106. Total +113 across 2 files. Reproducibility: yes. from source inspection: current main overwrites buffered function-call argument deltas with the final done.arguments value, so missing or empty done payloads can drop arguments or error. I did not run a live LM Studio repro in this read-only review. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land this narrow shared parser fix after maintainer review and CI, with an optional live LM Studio smoke if maintainers want provider-specific confirmation. Do we have a high-confidence way to reproduce the issue? Yes from source inspection: current main overwrites buffered function-call argument deltas with the final done.arguments value, so missing or empty done payloads can drop arguments or error. I did not run a live LM Studio repro in this read-only review. Is this the best way to solve the issue? Yes: fixing the shared Responses stream parser is the narrow owner-boundary solution, while LM Studio-specific repair would duplicate generic OpenAI-compatible stream handling. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against f8db47e34045. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +7, Tests +106. Total +113 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Wow this was a crazy fast PR. Thank you! |
Glad to help! |
|
Is this going to get approved to merge to main? |
Maybe, up to the maintainers. |
5756531 to
85f7f3a
Compare
|
Maintainer verification for rebased head 85f7f3a. Reviewed current and shipped behavior: main and v2026.6.1 overwrite buffered Responses tool-call arguments in Local proof:
Real behavior proof: I also ran a local HTTP/SSE Responses fixture through CI: Not tested: a live LM Studio model run; no LM Studio server is reachable at |
Summary
response.function_call_arguments.doneevent omitsargumentsor sends an empty string.Fixes #90585.
Verification
node scripts/run-vitest.mjs src/llm/providers/openai-responses-shared.test.tsnode scripts/run-vitest.mjs extensions/lmstudio/src/stream.test.ts./node_modules/.bin/oxfmt --check --threads=1 src/llm/providers/openai-responses-shared.ts src/llm/providers/openai-responses-shared.test.tsgit diff --check.agents/skills/autoreview/scripts/autoreview --mode local-> clean, no accepted/actionable findingsReal behavior proof
Behavior addressed: LM Studio/OpenAI-compatible Responses streams can emit function-call argument deltas, then a
response.function_call_arguments.doneevent whoseargumentsfield is missing or empty. The parser now keeps the accumulated delta JSON instead of replacing it with an empty/missing final payload.Real environment tested: Local OpenAI-compatible HTTP/SSE fixture exercised through
streamSimpleOpenAIResponses, using a real POST to/responsesand streamed SSE events matching the LM Studio failure shape. Local LM Studio itself was checked athttp://127.0.0.1:1234/v1/models, but no LM Studio server was running on this machine.Exact steps or command run after this patch: Ran a one-shot
node --import tsx --input-type=modulescript that started an HTTP server, returned Responses SSE events withresponse.function_call_arguments.deltafollowed byresponse.function_call_arguments.donewithoutarguments, and consumed it throughstreamSimpleOpenAIResponses.Evidence after fix: Copied terminal output from the local HTTP/SSE fixture run:
{ "ok": true, "eventTypes": [ "start", "toolcall_start", "toolcall_delta", "toolcall_end", "done" ], "stopReason": "toolUse", "toolCall": { "type": "toolCall", "id": "call_read|fc_read", "name": "read", "arguments": { "path": "docs/gateway/local-models.md" } }, "requestPath": "/responses", "requestStream": true }Observed result after fix: The streamed
readtool call retained itspathargument and the provider stream ended withstopReason: "toolUse".What was not tested: A live LM Studio model run was not possible because
127.0.0.1:1234was not reachable in this environment.