opencode-mission-control icon indicating copy to clipboard operation
opencode-mission-control copied to clipboard

feat: Lightweight PTY tier for simple tasks (no worktree needed)

Open nigel-dev opened this issue 9 months ago • 0 comments

Source

Audit report — Section 8: UX Recommendations (P3) + Section 2: Competitive Landscape

Description

Currently every MC job gets a full git worktree + tmux session, even for trivial tasks like running a build, linting, or executing a single command. Ecosystem plugins like opencode-pty and opencode-background demonstrate that simple tasks can run in a lightweight PTY process without worktree isolation.

Proposed Solution

Add a "lightweight" job tier that:

  1. Spawns a PTY process (via Bun.spawn or the OpenCode client.pty API) instead of creating a worktree
  2. Uses a ring buffer for output storage (memory-efficient vs. unbounded terminal scraping)
  3. Supports the same monitoring and notification infrastructure as full jobs
  4. Can be launched via mc_launch(name: "build-check", prompt: "...", tier: "light")

Use Cases

  • Running build/test commands: bun test, npm run build
  • Quick one-off commands: git log, grep -r, etc.
  • Lint or format checks
  • Any task that reads but doesn't modify the codebase

Ecosystem Precedent

  • opencode-pty: Full PTY management with notifyOnExit and ring buffer output
  • opencode-background: Simple Bun.spawn for background tasks (no isolation, no persistence)

Relationship to Other Issues

  • Complementary to #27 (Multiplexer interface) — PTY would be a third backend alongside tmux and Zellij
  • Independent of plan system — lightweight jobs wouldn't participate in merge trains

nigel-dev avatar Feb 13 '26 18:02 nigel-dev