Skip to content

Add thread branching - #313

Merged
SergeSerb2 merged 2 commits into
mainfrom
sergecode/thread-branching-tools
Jul 28, 2026
Merged

Add thread branching#313
SergeSerb2 merged 2 commits into
mainfrom
sergecode/thread-branching-tools

Conversation

@SergeSerb2

Copy link
Copy Markdown
Owner

Summary

  • Add a server-owned thread.branch command that creates an independent top-level thread while preserving project, workspace, model, runtime, interaction, and executor settings.
  • Snapshot bounded conversation history with remapped message IDs, then bootstrap a fresh provider session from that read-only context on its first turn.
  • Expose branching from the macOS sidebar and new-session menu, and add a provider-facing branch_thread MCP tool so models can create branches when asked.
  • Document and test the new wire contract, context bounds, decider behavior, and native command encoding.

Area

  • apps/mac — native macOS app
  • apps/windows — Windows desktop app
  • apps/mobile — iPhone companion app
  • apps/server — backend server
  • Shared packages (packages/contracts, packages/shared, packages/client-runtime, …) or relay (infra/relay)
  • Build, CI, or release tooling
  • Docs

Verification

  • pnpm run verify --all passes (check + typecheck + tests; adds lint:mobile and the Swift suite)

  • pnpm run test:mac passes (required for apps/mac changes)

  • Manually verified (describe below)

  • pnpm run verify --all: formatting, typechecking, and the complete TypeScript test matrix passed. The macOS target built, then the current-main AppModel edit-resend suite stopped making progress; the runner was interrupted after confirming it was idle. Current main is also independently red in GitHub Actions on the unrelated setup-worktree.test.ts timeout exit-code assertion.

  • vp test run packages/contracts/src/orchestration.test.ts apps/server/src/orchestration/ThreadBranching.test.ts apps/server/src/orchestration/decider.branch.test.ts: 44 tests passed on the merged tip.

  • pnpm run test:mac --filter ActivityPayloadTests: 20 tests passed on the merged tip, including thread-branch wire encoding.

  • Before main advanced, the complete macOS suite passed: 715 tests in 118 suites.

Screenshots / Recordings

Not captured; the UI additions are menu actions using the existing Alpine menu component and SF Symbol treatment.

Release notes

Branch any macOS coding session into an independent thread with inherited conversation context, manually or through a provider tool.

@SergeSerb2
SergeSerb2 merged commit 5b01ac9 into main Jul 28, 2026
0 of 3 checks passed
@SergeSerb2 SergeSerb2 mentioned this pull request Jul 28, 2026
10 tasks
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