Skip to content

fix(mcp): say that the server stays in the tree it was started in - #588

Merged
p-i-p merged 1 commit into
mainfrom
claude/cool-sanderson-e5a5ae
Nov 18, 2026
Merged

p-i-p merged 1 commit into
mainfrom
claude/cool-sanderson-e5a5ae

Conversation

@p-i-p

@p-i-p p-i-p commented Nov 18, 2026

Copy link
Copy Markdown
Member

What and why

The MCP server's instructions and the up and lanes descriptions 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's EnterWorktree) then called up on a server still running in the main working tree. It got the main stack's ready without 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.

  • Instructions, 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 to lane_start <lane> (or devstack up in the worktree).
  • up in 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 use lane_start <lane> for a worktree, and lists the lanes (at most 5, then "N more"). Without lanes there is no note.
  • lanes in the main tree: "this MCP server runs in the main working tree; lane_start <lane> starts a worktree's lane".
  • Docs: docs/stack-file.md, the devstack skill and the CHANGELOG say the same.

Tests: the_texts_say_the_server_stays_in_its_tree and up_in_the_main_tree_names_the_main_stack_while_lanes_exist. cargo clippy -p devstack --all-targets and cargo fmt --check pass. The up note 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:

  • Claude Code declares roots: {listChanged: true}.
  • Its roots/list answer comes from the session's starting directory, which EnterWorktree changes.
  • It sends notifications/roots/list_changed only when the additional working directories change, not after EnterWorktree.

So a server could ask roots/list before 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

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>
@p-i-p
p-i-p merged commit 59f4a58 into main Nov 18, 2026
14 checks passed
@p-i-p
p-i-p deleted the claude/cool-sanderson-e5a5ae branch November 18, 2026 21:54
@7schmiede 7schmiede mentioned this pull request Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant