Repository navigation
Conversation
|
Codex review: needs maintainer review before merge. Latest ClawSweeper review: 2026-05-22 08:30 UTC / May 22, 2026, 4:30 AM ET. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. Source inspection of current main shows the exported builder still emits tool fields without checking PR rating Rank-up moves:
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. Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land the builder-level guard and regression tests while keeping the dispatch wrapper as defense in depth, then consolidate the duplicate changelog text during landing. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection of current main shows the exported builder still emits tool fields without checking Is this the best way to solve the issue? Yes. Reusing the existing Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 0a4b30191df0. |
dd8ef3f to
93b07bc
Compare
7c21801 to
08ba619
Compare
08ba619 to
75b1903
Compare
|
Rebased onto latest Validation on the rebased branch: The first formatter attempt was interrupted while pnpm retried optional binary downloads from the configured registry; retrying the same formatter command with a longer timeout passed. Remaining merge gate: I still need to add redacted real behavior proof showing an OpenAI Completions payload for a |
|
After-fix real behavior proof from the PR branch, redacted to field presence only. Behavior addressed: OpenAI Completions payload builder must not send tool fields for models configured with Evidence after fix: {
"branch": "fix/74664-openai-completions-supportsTools-false",
"head": "75b1903dbd0fb6d2031f1fc04fd8a54e54d87d55",
"command": "node --import tsx payload builder",
"model": "chat-only-model",
"compatSupportsTools": false,
"hasTools": false,
"hasToolChoice": false,
"hasParallelToolCalls": false,
"payloadKeys": [
"max_completion_tokens",
"messages",
"model",
"stream"
]
}Observed result after fix: The generated OpenAI Completions payload has no @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
ClawSweeper PR egg ✨ Hatched: 🥚 common Pearl Merge Sprite Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
|
@clawsweeper re-review |
|
Verification before merge: pnpm test src/agents/openai-transport-stream.test.ts (170 passed); autoreview clean. Scope: OpenAI Completions transport gates tool payload/history on existing supportsTools contract. |
…flag (openclaw#74738) * fix: guard openai-completions tool payload with supportsTools compat flag (openclaw#74664) * docs(changelog): note OpenAI completions tool compat fix * test(agents): use real tool history fixtures
…flag (openclaw#74738) * fix: guard openai-completions tool payload with supportsTools compat flag (openclaw#74664) * docs(changelog): note OpenAI completions tool compat fix * test(agents): use real tool history fixtures
…flag (openclaw#74738) * fix: guard openai-completions tool payload with supportsTools compat flag (openclaw#74664) * docs(changelog): note OpenAI completions tool compat fix * test(agents): use real tool history fixtures
…flag (openclaw#74738) * fix: guard openai-completions tool payload with supportsTools compat flag (openclaw#74664) * docs(changelog): note OpenAI completions tool compat fix * test(agents): use real tool history fixtures
Summary
Fixes #74664.
buildOpenAICompletionsParamswithsupportsModelTools(model), so models configured withcompat.supportsTools: falseno longer receivetoolsortool_choicein the outbound chat-completions payload.tools: []fallback for tool-call history when the model does not support tools.Problem
buildOpenAICompletionsParams(src/agents/openai-transport-stream.ts) unconditionally addedtoolsto the payload whencontext.toolswas present, and emittedtools: []when tool-call history existed. The upstream runner layer already gates onsupportsModelTools(), but the transport layer did not re-check, so:@mariozechner/pi-aiused standalone) bypassed the upstream guard.context.toolswithout pre-filtering hit the same issue.This caused chat-only OpenAI-compatible providers (e.g. Venice models with
compat.supportsTools: false) to receive unsupportedtoolspayloads, triggering 400 errors.Fix
Wrapped the existing tool-emission block in
buildOpenAICompletionsParamswith asupportsModelTools(model)check. This reuses the existing helper atsrc/agents/model-tool-support.tswhich returnsfalsewhenmodel.compat?.supportsTools === false, defaulting totrueotherwise.Tests
Added 2 test cases to
src/agents/openai-transport-stream.test.ts:omits tools from completions payload when model compat sets supportsTools to false— verifiestoolsandtool_choiceare absent whencontext.toolsis non-empty but model sayssupportsTools: false.omits tool-history tools:[] fallback when model compat sets supportsTools to false— verifies thetools: []fallback for tool-call history is also suppressed.All 95 tests pass (including 2 new).
Real behavior proof
Behavior addressed: OpenAI Completions payload builder must not send tool fields for models configured with
compat.supportsTools: false.Real environment tested: local OpenClaw source checkout on branch
fix/74664-openai-completions-supportsTools-false, head75b1903dbd0fb6d2031f1fc04fd8a54e54d87d55.Exact steps or command run after this patch:
Evidence after fix:
{ "branch": "fix/74664-openai-completions-supportsTools-false", "head": "75b1903dbd0fb6d2031f1fc04fd8a54e54d87d55", "command": "node --import tsx payload builder", "model": "chat-only-model", "compatSupportsTools": false, "hasTools": false, "hasToolChoice": false, "hasParallelToolCalls": false, "payloadKeys": [ "max_completion_tokens", "messages", "model", "stream" ] }Observed result after fix: The generated OpenAI Completions payload has no
tools, notool_choice, and noparallel_tool_callseven though caller-suppliedcontext.toolsandtoolChoicewere present.What was not tested: No live external Venice/OpenAI-compatible HTTP request was sent; this proof exercises the production transport payload builder locally and avoids printing prompts, credentials, or full payload content.