Skip to content

fix(qwen-code): exclude hidden thoughts from transcripts - #220

Merged
zpzjzj merged 1 commit into
alibaba:mainfrom
chiga0:feat/qwen-skip-recorded-thought
Aug 31, 2026
Merged

zpzjzj merged 1 commit into
alibaba:mainfrom
chiga0:feat/qwen-skip-recorded-thought

Conversation

@chiga0

@chiga0 chiga0 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Qwen Code session JSONL can contain assistant text parts annotated with thought: true. The parser currently treats these hidden reasoning parts as visible assistant messages, so they can replace or contaminate FinalMessage and downstream transcript consumers.

This change:

  • models the thought marker and skips those text parts
  • preserves visible assistant text, tool calls, and tool results
  • adds a regression test covering the full sequence

Validation

  • make verify
  • go test ./internal/agent -run Qwen -count=1
  • env -u QODER_PERSONAL_ACCESS_TOKEN -u OPENAI_API_KEY go test -race ./internal/agent ./internal/runtime

The initial full make test run was otherwise green but hit one host-environment credential test and one timing-sensitive runtime test; both affected packages passed cleanly when rerun with credential variables removed.

@JHWang-1997 JHWang-1997 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.

Reviewed the Qwen session parsing change. Qwen stores hidden reasoning as text parts marked thought: true, which the current parser exposes as normal assistant messages. Skipping them limits the transcript and final message to observable output while preserving visible responses, tool activity, and token accounting.

Our agent judge can read the transcript, so historical results that used leaked reasoning may change. This is an intended correction and aligns Qwen with Claude, Qoder, and Codex.

Targeted race tests pass, with no blockers found. Please add an Unreleased changelog entry and run the normal CI checks, since GitHub currently shows only the CLA check.

LGTM.

@zpzjzj
zpzjzj enabled auto-merge August 31, 2026 01:05
@zpzjzj
zpzjzj added this pull request to the merge queue Aug 31, 2026
Merged via the queue into alibaba:main with commit 4ea44b3 Aug 31, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants