fix(openai): strip status from replayed input items for custom openai-responses endpoints#100831
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 6, 2026, 7:23 AM ET / 11:23 UTC. Summary PR surface: Source +33, Tests +70. Total +103 across 2 files. Reproducibility: yes. at source level, not live: current main constructs replayed Responses input items with Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Merge a scoped non-native Responses sanitizer after contributor real behavior proof or an explicit maintainer proof override, keeping native OpenAI/Azure replay behavior unchanged. Do we have a high-confidence way to reproduce the issue? Yes at source level, not live: current main constructs replayed Responses input items with Is this the best way to solve the issue? Yes, the existing Responses payload policy boundary is the narrowest maintainable fix location. The remaining gap is proof quality, not a different code direction. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2a741bebb54f. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +33, Tests +70. Total +103 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
|
d53472a to
536355f
Compare
|
Maintainer repair is land-ready at
Known gap: the reporter's private strict endpoint was unavailable; the managed transport regression exercises the exact outbound JSON boundary. |
|
Merged via squash.
|
…-responses endpoints (openclaw#100831) * fix(openai): strip status from replayed input items for custom openai-responses endpoints * fix(openai): narrow replay status stripping --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
…-responses endpoints (openclaw#100831) * fix(openai): strip status from replayed input items for custom openai-responses endpoints * fix(openai): narrow replay status stripping --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
What Problem This Solves
Fixes #100657 — when using a custom provider configured with
api: "openai-responses", OpenClaw replays prior Responses items into the next request'sinput[]with astatusfield (e.g."completed"). Strict OpenAI-compatible endpoints reject this output-only field with HTTP 400, causing OpenClaw to misclassify the primary model as having a format error and triggering unnecessary fallback.Why This Change Was Made
The
statusfield on replayed message items (input[n].status) is an output-only field that OpenAI's native API silently accepts but strict third-party compatible endpoints reject. This change stripsstatusfrom allinput[]items specifically for non-native (custom/compatible)openai-responsesproviders, matching the existing pattern used forshouldStripDisabledReasoningPayload.User Impact
Custom
openai-responsesproviders no longer see400 Unknown parameter: 'input[n].status'errors when OpenClaw replays conversation history. The primary model is correctly used instead of being unnecessarily fallen back.Evidence
pnpm test src/agents/openai-responses-payload-policy.test.ts: 12 passed, 0 failedChanges:
shouldStripInputStatuspolicy flag,stripInputStatusFromInputhelper, and call fromapplyOpenAIResponsesPayloadPolicy🤖 Generated with Claude Code