fix(opencode-go): strip Kimi reasoning replay fields#85377
Conversation
|
Codex review: needs real behavior proof before merge. Latest ClawSweeper review: 2026-05-22 13:51 UTC / May 22, 2026, 9:51 AM ET. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. source-reproducible: current main only strips root Kimi reasoning params, while the linked report shows provider rejection of replayed messages[].reasoning_details. A synthetic opencode-go/kimi-k2.6 payload with nested replay reasoning fields would remain dirty on current main. 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 provider-local sanitizer with focused regression coverage after CI and redacted live or captured-payload proof show opencode-go/kimi-k2.6 repeated turns no longer send unsupported replay reasoning fields. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main only strips root Kimi reasoning params, while the linked report shows provider rejection of replayed messages[].reasoning_details. A synthetic opencode-go/kimi-k2.6 payload with nested replay reasoning fields would remain dirty on current main. Is this the best way to solve the issue? Yes, pending real provider proof: keeping the fix in the OpenCode Go provider wrapper matches the plugin ownership boundary and avoids changing shared Kimi/OpenAI replay policy for other providers. Label changes:
Label justifications:
Acceptance criteria:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 6ea907cec1b3. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 669402b0b9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| record.content = | ||
| nextContent.length > 0 | ||
| ? nextContent | ||
| : [{ type: "text", text: OMITTED_ASSISTANT_REASONING_TEXT }]; |
There was a problem hiding this comment.
Only inject omitted text when reasoning parts were removed
This branch rewrites every empty content array to "[assistant reasoning omitted]", even when the array was already empty and no reasoning replay item was stripped. In OpenClaw, empty assistant content is a legitimate replay state (for example silent/tool-call turns), and forcing synthetic text changes prompt semantics and can alter downstream model behavior for Kimi requests. The placeholder should be added only when this sanitizer actually removed reasoning-only parts from that specific message/content list.
Useful? React with 👍 / 👎.
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
Summary
Fixes #83812.
Verification
/Users/steipete/.local/share/fnm/node-versions/v24.13.0/installation/bin/node ./node_modules/.bin/tsx -e "...stripOpencodeGoKimiReasoningPayload payload assertion..."git diff --check.agents/skills/autoreview/scripts/autoreview --mode localBehavior addressed: OpenCode Go
kimi-k2.6repeated turns no longer send unsupported reasoning replay fields or thinking/reasoning replay content parts to the provider.Real environment tested: local OpenClaw checkout on Node 24.13.0 with the OpenCode Go sanitizer executed directly; GitHub CI will run the full repository gates.
Exact steps or command run after this patch: direct Node 24
tsxassertion ofstripOpencodeGoKimiReasoningPayload,git diff --check, and Codex autoreview local mode.Evidence after fix: the captured payload assertion removed
reasoning,reasoning_effort,reasoningEffort,reasoning_details,reasoning_content,reasoning_text,type: "thinking",type: "redacted_thinking", andtype: "reasoning"replay parts while preserving visible text.Observed result after fix: direct assertion printed
sanitizer ok; autoreview reported no accepted/actionable findings.What was not tested: a live OpenCode Go request with real Kimi credentials; local Vitest prebundle did not reach test execution in this checkout, so CI remains the full automated gate.