Repository navigation
fix(mcp): say that the server stays in the tree it was started in - #588
Merged
Merged
Conversation
The instructions and the `up` and `lanes` descriptions promised that in a worktree every tool acts on its lane. An agent that entered a worktree during the session (Claude Code's EnterWorktree) called `up` on a server still running in the main working tree and got the main stack's `ready`. The texts now say the server acts on the tree it was started in and point to `lane_start <lane>`; `up` in the main working tree names the main stack and the lanes while there are any. Stack file reference and the devstack skill say the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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.
What and why
The MCP server's instructions and the
upandlanesdescriptions promised that in a worktree every tool acts on its lane. But the server acts on the tree it was started in. An agent that entered a worktree mid-session (Claude Code'sEnterWorktree) then calledupon a server still running in the main working tree. It got the main stack'sreadywithout any hint, while its lane stayed "not started" (seen in a downstream session on 2026-11-18).lane_start <lane>would have been the right tool, but nothing pointed to it.up,lanes: they now say the server acts on the tree it was started in and does not follow the client into a worktree entered later. They point tolane_start <lane>(ordevstack upin the worktree).upin the main working tree while lanes exist: the answer starts with a note. It says this is the main stack, gives the tree, says to uselane_start <lane>for a worktree, and lists the lanes (at most 5, then "N more"). Without lanes there is no note.lanesin the main tree: "this MCP server runs in the main working tree;lane_start <lane>starts a worktree's lane".docs/stack-file.md, thedevstackskill and the CHANGELOG say the same.Tests:
the_texts_say_the_server_stays_in_its_treeandup_in_the_main_tree_names_the_main_stack_while_lanes_exist.cargo clippy -p devstack --all-targetsandcargo fmt --checkpass. Theupnote was not exercised against a live daemon.Open question: MCP roots
I read the code bundled in Claude Code 2.1.325, not a live run:
roots: {listChanged: true}.roots/listanswer comes from the session's starting directory, whichEnterWorktreechanges.notifications/roots/list_changedonly when the additional working directories change, not afterEnterWorktree.So a server could ask
roots/listbefore acting, but it is never told about the switch. devstack's server sends no requests today. Following the client's tree would change what every tool acts on, a concept change that needs a review card. Not part of this PR.Decided by the agent: no review card. This corrects texts to describe what the server already does and adds a hint to
up's answer; no behaviour, contract or term changes.🤖 Generated with Claude Code