Repository navigation
fix(qwen-code): exclude hidden thoughts from transcripts - #220
Merged
Merged
Conversation
JHWang-1997
approved these changes
Aug 29, 2026
JHWang-1997
left a comment
Collaborator
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 contaminateFinalMessageand downstream transcript consumers.This change:
thoughtmarker and skips those text partsValidation
make verifygo test ./internal/agent -run Qwen -count=1env -u QODER_PERSONAL_ACCESS_TOKEN -u OPENAI_API_KEY go test -race ./internal/agent ./internal/runtimeThe initial full
make testrun 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.