Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix(cli): skip thought parts in copy output#4738

Merged
tanzhenxin merged 1 commit into
QwenLM:mainQwenLM/qwen-code:mainfrom
he-yufeng:fix/copy-visible-outputhe-yufeng/qwen-code:fix/copy-visible-outputCopy head branch name to clipboard
Jun 4, 2026
Merged

fix(cli): skip thought parts in copy output#4738
tanzhenxin merged 1 commit into
QwenLM:mainQwenLM/qwen-code:mainfrom
he-yufeng:fix/copy-visible-outputhe-yufeng/qwen-code:fix/copy-visible-outputCopy head branch name to clipboard

Conversation

@he-yufeng

Copy link
Copy Markdown
Contributor

Summary

Fixes #4733.

/copy currently builds the clipboard text from every text part in the last model message. Reasoning providers can keep internal reasoning as text parts marked with thought: true, so the command can copy hidden/internal thinking together with the visible answer.

This changes /copy to copy only visible text parts and leaves thought parts out of the clipboard output. Code/LaTeX selectors still run against the same visible output text.

Validation

  • npm run test --workspace=@qwen-code/qwen-code -- src/ui/commands/copyCommand.test.ts
  • npx eslint packages/cli/src/ui/commands/copyCommand.ts packages/cli/src/ui/commands/copyCommand.test.ts
  • npx prettier --check packages/cli/src/ui/commands/copyCommand.ts packages/cli/src/ui/commands/copyCommand.test.ts
  • git diff --check

Existing baseline failures observed

  • npm run typecheck --workspace=@qwen-code/qwen-code currently fails on unrelated workspace/core export and Ink type errors, including missing formatDenialStateLog, atomicWriteFileSync, ink/dom, and FinishReason.IMAGE_* symbols.
  • npm run build --workspace=@qwen-code/qwen-code-core currently fails on unrelated FinishReason.IMAGE_RECITATION / FinishReason.IMAGE_OTHER references.

@tanzhenxin tanzhenxin added the type/bug Something isn't working as expected label Jun 3, 2026

@wenshao wenshao 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.

No issues found. LGTM! ✅ — qwen3.7-max via Qwen Code /review

@wenshao

wenshao commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

PR #4738 Local Verification Report

Branch: fix/copy-visible-output | Commit: c85f6d8cb | Base: main

Changes Summary

  • packages/cli/src/ui/commands/copyCommand.ts — Filter out thought parts (thought: true) from /copy output
  • packages/cli/src/ui/commands/copyCommand.test.ts — Add test case for thought-part filtering

Test Results

Check Result Details
Unit Tests ✅ PASS 26/26 tests passed (copyCommand.test.ts)
ESLint ✅ PASS 0 warnings, 0 errors
TypeCheck 🟡 Pre-existing 17 errors total, 0 introduced by this PR (2 exist at merge base 7bed56b9b, 15 from other merged commits; none in changed files)
Whitespace ✅ PASS git diff --check clean

Pre-existing TypeCheck Errors (not from this PR)

  • Session.ts:1970skipClassifier not in EvaluateAutoModeInput (from unmerged PR Harden auto mode self-modification checks #4572)
  • httpAcpBridge.ts:2449 — missing properties on HttpAcpBridge (exists on main)
  • BaseTextInput.tsxcursorCtx typed as unknown (5 errors, other merged commits)
  • hooks/constants.tsPostToolBatch not on HookEventName (5 errors, other merged commits)
  • useGeminiStream.tsIMAGE_RECITATION/IMAGE_OTHER on FinishReason (2 errors, from unmerged @google/genai upgrade)
  • trustedFolders.ts, tipHistory.ts, compressCommand.ts — 1 error each (other merged commits)

Verdict

Ready to merge. Clean single-commit change. All unit tests pass, lint clean, no new type errors introduced. The thought-part filtering logic is straightforward and well-tested.


Verified by wenshao

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

Approving. Small, well-tested change: /copy now filters out thought parts. CI green across macOS/Ubuntu/Windows (Node 22), lint and CodeQL pass, no new type errors. Confirmed by local review and wenshao's verification report.

@tanzhenxin
tanzhenxin merged commit 58b4f35 into QwenLM:main Jun 4, 2026
10 checks passed
xaelistic pushed a commit to xaelistic/qwen-code that referenced this pull request Jun 7, 2026
Co-authored-by: Jacob Richman <jacob314@gmail.com>
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.

/copy captures internal thinking blocks instead of only visible output

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.