Skip to content

Expose isolatedWorktree on the sessions MCP surface - #253

Merged
jfrolich merged 1 commit into
mainfrom
expose-isolated-child-worktrees
Aug 31, 2026
Merged

Expose isolatedWorktree on the sessions MCP surface#253
jfrolich merged 1 commit into
mainfrom
expose-isolated-child-worktrees

Conversation

@jfrolich

Copy link
Copy Markdown
Contributor

Root cause

SessionControl.createSession has supported isolatedWorktree (mint a per-branch worktree even when the child could share the parent's) since the server capability landed in session-control / session-control-wiring, but the public opensession-sessions MCP adapter (src/agents/slack/sessions-tools.ts) never exposed it: the create_session Zod schema, handler argument type, and forwarded createSession input all omitted the field. As a result, an agent fanning work out to matching-repo child sessions could not get separate workspaces — every child shared the parent worktree and produced one mingled diff. spawn_task had the same omission, plus a branchless code-mode guard that would have refused the isolated case.

Fix

  • Expose isolatedWorktree?: boolean on create_session and spawn_task (schema + handler types), forward it to SessionControl.createSession.
  • Let isolatedWorktree: true satisfy spawn_task's branchless code-mode guard — the durable create plan generates a branch from the prompt, exactly as the wiring already does for non-shared creates.
  • Document in both tool descriptions that true keeps child/report-back linkage while creating the child's own worktree and branch.

Tests

Two regression tests, written first and failing at exactly the omission before the fix:

  • exposes isolatedWorktree on create_session and forwards it to createSession — asserts the field is in the MCP tool's input schema and reaches createSession with parent linkage and report-back intact.
  • accepts isolatedWorktree: a branchless code task gets its own worktree instead of sharing the parent's — spawn_task no longer refuses a branchless isolated code task and forwards the flag with branch left undefined for plan generation.

bun test src/agents/slack/sessions-tools.test.ts: 30 pass, 0 fail. bunx tsc --noEmit clean.

Started by Jaap Frolich in this OS session

SessionControl.createSession has supported isolatedWorktree (per-branch
worktree even on a shared-checkout repo) since the server capability
landed, but the opensession-sessions MCP adapter never exposed it:
create_session's Zod schema, handler argument type, and forwarded
createSession input all omitted the field, so matching-repo child
sessions always shared the parent worktree from the agent's perspective.

Expose isolatedWorktree on create_session and spawn_task, forward it to
SessionControl.createSession, let it satisfy spawn_task's branchless
code-mode guard (the durable create plan generates a branch from the
prompt), and document that true keeps child/report-back linkage while
minting a separate worktree and branch. Regression tests prove the
schema exposure and forwarding on both tools.
@open-session-os-tella-dev

open-session-os-tella-dev Bot commented Aug 31, 2026

Copy link
Copy Markdown

🤖 OS review · approve · confidence 5/5

Safe to merge. The PR consistently exposes and forwards isolatedWorktree through both MCP creation paths, and the branchless spawn_task guard now matches the durable creation planner's existing branch-generation behavior. No correctness, authorization, data-leakage, or contract regressions found.

💡 Labels: os-adversarial — deeper two-pass review · os-simplify — quality cleanup pass · os-auto-fix — fix anything outstanding and push until CI passes.
Reviewed e4d607a · GPT-5.6 Sol · earlier reviews collapse above · open session

@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
opensession Ready Ready Preview Aug 31, 2026 8:03am

@jfrolich
jfrolich merged commit 67b5a6d into main Aug 31, 2026
5 of 7 checks passed
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