Agent chat header: the Environment line leaves a worktree's branch to its pill; / reads /
Merged
TE
16d ago+29+29+01234567890123456789-3-3-0123456789
Two non-blocking findings from #23236's review, fixed:
- A local chat in a worktree named its branch twice in the header: once in the new Environment line and once in the worktree pill (
WorktreePill.tsx). The line now leaves the branch out when the chat is local and runs in a worktree (summary.worktree). A remote chat has no pill, so its line keeps the branch. - A chat whose folder is
/trimmed to an empty path, whichprojectLabelread as "No folder". It now reads/.
Tests
webviews/test/chat-environment-line.test.tsx adds a local worktree chat without the branch, a remote worktree chat with it, and the root folder reading /.
Observed / Not run
- Observed: the TypeScript check is clean for both files, and the pre-push gate is clean.
- Not run: bun tests, because this host (cosmic-gray) runs no tests. CI's webview shards run them.
Changelog
none
🤖 Generated with Claude Code
Agent session: cosmic-gray
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Fixes two issues in the agent chat header's Environment line: branch duplication in worktrees and the root folder label.
- A local chat in a worktree no longer names its branch in the Environment line, since the worktree pill already shows it; remote chats, which have no pill, keep the branch.
- A chat whose folder is
/now reads/instead of "No folder".