qwen-code/packages/cli
Shaojin Wen 22ddad7ff7
fix(cli): show worktree branch in status line instead of workspace branch (#7367)
* fix(cli): show worktree branch in status line instead of workspace branch

useGitBranchName was always called with config.getTargetDir() which
stays at the original project root when entering a worktree via
enter_worktree or --resume. Move useWorktreeSession above it and pass
worktreeSession.worktreePath when a worktree is active so the status
line reflects the worktree's branch.

* docs: add worktree branch status line screenshot for PR

* docs: replace screenshot with enter_worktree scenario (before/after)

* fix(web-shell): prefer live worktree branch from git status over static creation-time branch

When a worktree session is active, the composer git chip used
sessionWorktree.branch (set once at creation time) as the highest
priority source. If the user checks out a different branch inside
the worktree, the chip showed the stale creation-time branch.

Now prefer selectedWorkspaceGitStatus.branch (fetched with the
worktree path via ?cwd= parameter, refreshed on focus and 30s poll)
when a worktree session is active, falling back to the static
sessionWorktree.branch only until the first fetch completes.

* docs: add Web Shell worktree session screenshots

* test(cli): cover worktree branch wiring in AppContainer (#7367)

* fix(web-shell): clear stale git status on worktree entry and remove PR screenshots (#7367)

---------

Co-authored-by: Qwen Code Bot <qwen-code-bot@alibabacloud.com>
Co-authored-by: qwen-code-ci-bot <qwen-code-ci-bot@users.noreply.github.com>
2026-07-21 04:38:12 +00:00
..
src fix(cli): show worktree branch in status line instead of workspace branch (#7367) 2026-07-21 04:38:12 +00:00
index.ts fix(cli): add bootstrap fast paths (#6188) 2026-07-02 22:28:11 +00:00
package.json chore(release): v0.20.0 (#7211) 2026-07-19 07:35:40 +00:00
test-setup.ts feat(serve): persist dynamic workspace registrations (#6716) 2026-07-11 16:49:40 +00:00
tsconfig.json feat(webshell): replay ChatRecord history in readonly WebShell (#6999) 2026-07-19 00:09:44 +00:00
vitest.config.ts test: raise timeout ceiling for I/O-bound tests flaky under CI contention (#7230) 2026-07-19 12:03:48 +00:00