Skip to content

fix(core,cli): stop stripping reasoning on model switch/history load#3682

Merged
tanzhenxin merged 1 commit into
QwenLM:mainfrom
fyc09:fix/issue-3579-strip-removal-followup
Apr 28, 2026
Merged

fix(core,cli): stop stripping reasoning on model switch/history load#3682
tanzhenxin merged 1 commit into
QwenLM:mainfrom
fyc09:fix/issue-3579-strip-removal-followup

Conversation

@fyc09

@fyc09 fyc09 commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • What changed:
    • Removed event-driven reasoning stripping in two user flows where history is restored or model context changes.
    • Updated regression expectations to assert reasoning/thought content is preserved in those flows.
  • Why it changed:
  • Reviewer focus:
    • Confirm no thought stripping occurs in the targeted flows.
    • Confirm regression tests now enforce preservation behavior.

Validation

  • Commands run:
    cd packages/core && npx vitest run src/config/config.test.ts
    cd packages/cli && npx vitest run src/ui/hooks/slashCommandProcessor.test.ts
  • Prompts / inputs used:
    • Model-switch flow regression expectation.
    • History-load flow regression expectation.
  • Expected result:
    • Targeted tests pass and preserve-reasoning assertions hold.
  • Observed result:
    • Both test files passed locally (98/98, 39/39).
  • Quickest reviewer verification path:
    • Run the two commands above.
  • Evidence (output, logs, screenshots, video, JSON, before/after, etc.):
    • Vitest outputs show all targeted tests passing.

Scope / Risk

  • Main risk or tradeoff:
    • Strict provider wire-format compatibility is not handled by history mutation anymore.
  • Not covered / not validated:
    • Provider-specific request-boundary sanitization work is not part of this PR.
  • Breaking changes / migration notes:
    • None intended.

Testing Matrix

🍏 🪟 🐧
npm run ⚠️ ⚠️ ⚠️
npx ⚠️ ⚠️
Docker ⚠️ ⚠️ ⚠️
Podman ⚠️ N/A N/A
Seatbelt ⚠️ N/A N/A

Testing matrix notes:

  • Verified with targeted npx vitest run in Linux environment only.

Linked Issues / Bugs

@tanzhenxin tanzhenxin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Thanks for taking this on. The direction matches the maintainer decision in #3579, scope is tight (just the two call sites), and correctly leaves the rewind-path strip in AppContainer.tsx alone since that one is about orphaned reasoning on a truncated branch, not cross-model leakage. LGTM.

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

Labels

type/bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: DeepSeek API 400 error — reasoning_content in thinking mode must be passed back

2 participants