Skip to content

fix(core): preserve compatible reasoning replay - #37242

Closed
opencode-agent[bot] wants to merge 1 commit into
devfrom
reasoning-replay
Closed

fix(core): preserve compatible reasoning replay#37242
opencode-agent[bot] wants to merge 1 commit into
devfrom
reasoning-replay

Conversation

@opencode-agent

Copy link
Copy Markdown
Contributor

Summary

  • preserve cross-model reasoning as reasoning_content for OpenAI-compatible Chat targets instead of appending it to assistant text
  • continue stripping model-bound continuation metadata on switches
  • make protocol lowering safe: Anthropic, Bedrock, Gemini, and OpenAI Responses lower unsigned/foreign reasoning to ordinary assistant text, while signed native reasoning still round-trips
  • preserve the same behavior through the native LLM adapter and V2 session projection

This keeps Kimi-compatible reasoning history structurally intact without reintroducing the unsigned thinking/signature failures fixed by #25303.

Fixes#32603

Tests

  • packages/opencode: targeted message projection, native adapter, and provider transform suites (399 passed)
  • packages/core: session runner message suite (6 passed)
  • packages/llm: OpenAI Chat/compatible/Responses, Anthropic, Bedrock, and Gemini suites (165 passed)
  • bun typecheck in packages/llm and packages/core
  • targeted Oxlint: 0 errors
  • Prettier check on all changed files

packages/opencode typecheck was also attempted but did not complete within the 10-minute local host limit; the targeted package tests and lint checks passed.

@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PR #25303 causes mass KV invalidation on model switch (Plan↔Build↔Compact)

1 participant

@MrMushrooooom