Improvement: Symlink .opencode/ into spawned worktrees for plugin availability
Problem
Spawned agent sessions have no Mission Control awareness. The .opencode/ directory is in .gitignore, so git worktree add doesn't include it. This means:
- No
mc_*tools available in spawned sessions - No
/mc-*slash commands - No worktree awareness (
getWorktreeContext()not running) - No compaction context injection
- No auto-status toasts
- No plan awareness
Agents are completely blind to the orchestration. The only thing monitoring them is the JobMonitor polling tmux pane status from the parent session.
Proposed Fix
The createWorktree() function already supports a postCreate hook with copyFiles and symlinkDirs options, but neither mc_launch nor the orchestrator's launchJob() uses them.
Add .opencode to symlinkDirs in both launch paths:
// In mc_launch (src/tools/launch.ts)
worktreePath = await createWorktree({
branch,
postCreate: {
symlinkDirs: ['.opencode'],
},
});
// In orchestrator.launchJob (src/lib/orchestrator.ts)
worktreePath = await createWorktree({
branch,
postCreate: {
symlinkDirs: ['.opencode'],
},
});
A symlink is preferred over copying because plugin updates propagate automatically.
Follow-up Considerations
Once agents have the plugin loaded, we need to consider:
- Tool safety: Which
mc_*tools should agents be allowed to use? (mc_kill,mc_plan_cancel,mc_mergecould disrupt the orchestrator) - Plan awareness: Even with the plugin, agents don't know they're part of a plan —
planIdis on the Job record but not exposed viagetWorktreeContext() - Sibling coordination: Should agents be able to see and coordinate with sibling jobs?
Discovery Context
Found during manual test planning — the entire "Agent Capabilities" section of the test plan had to be rewritten when we realized agents are running vanilla OpenCode.
Fixed in 2ea38d3. The .opencode/ directory is now automatically symlinked into every spawned worktree, so agents have access to the Mission Control plugin and tools.
Additionally, users can now configure custom file copying, directory symlinking, and post-create commands via:
- Config:
worktreeSetupin.mission-control/config.jsonfor project-wide defaults - Per-launch:
copyFiles,symlinkDirs,commandsargs onmc_launch - Per-plan-job: same fields on individual jobs in
mc_plan
Examples: copy .env files, symlink node_modules to save disk, run bun install after creation.