You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tag other worktrees from the @ menu in Chat tabs (#257)
## Summary
- The `@` menu in Chat tabs now lists other worktrees above the file
matches, so you can point at one from the composer now that agents have
`send_message`.
- Picking a worktree inserts `@worktree:<branch>`. The `worktree:`
prefix keeps the token from reading as a relative file path — a bare
branch name sends the agent looking on disk before it guesses what you
meant. `resolveWorktreeQuery` strips the prefix, so the token resolves
whether the agent passes it verbatim or trims it first.
- Rows only appear when the **worktree messaging** setting is on
(default off) — that setting is what grants the agent `send_message` at
all, so tagging a worktree without it would be a dead end.
## Notes
Matching is substring rather than fuzzy. Worktree rows sort above file
matches, so a loose subsequence hit — `@src` matching s…r…c somewhere
inside a branch name — would take row 0 and steal the Enter key from the
file the user was actually reaching for. Matching against the full
`worktree:<branch>` label also means typing `@worktree` lists them all,
which is how the feature gets discovered.
Bare `@` with no query still shows files only, so the existing
file-mention flow is untouched.
## Test plan
- [x] `npm run typecheck` and `npx electron-vite build` clean
- [x] New `resolveWorktreeQuery` cases for the `worktree:` prefix
(`src/main/chat-delivery.test.ts`)
- [x] Full `npx vitest run` — 8 failures are pre-existing
environment-dependent tests (rebase state, `fs.watch`, login-shell
PATH), untouched by this change
- [ ] Manual: with worktree messaging on, type `@worktree` in a Chat tab
and confirm the rows list, alias shows as the description, and picking
one inserts `@worktree:<branch>`
- [ ] Manual: with the setting off, confirm no worktree rows appear
- [ ] Manual: confirm bare `@` still leads with files
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: resources/mcp-bridge.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -253,7 +253,7 @@ const TOOLS = [
253
253
worktree: {
254
254
type: 'string',
255
255
description:
256
-
'Which worktree to message — its display alias, its branch name, or its absolute path. Call list_worktrees first if you are unsure what exists.'
256
+
'Which worktree to message — a `<repo>/<branch>` handle, its display alias, or its absolute path. A bare branch name works only when it is unique across every open repo, which `main` never is. A `@worktree:<repo>/<branch>` token in the user\'s message is a worktree mention picked from the composer; pass it here as-is (with or without the `worktree:` prefix). Call list_worktrees first if you are unsure what exists.'
0 commit comments