Files
oh-my-opencode/src/features/tmux-subagent/AGENTS.md
T
YeonGyu-Kim 7b7526e2f6 docs(src): update counts across tools, features, config, cli AGENTS.md
- tools: 15 -> 16 dirs, writing model kimi-k2p5 -> gemini-3-flash
- features: builtin skills 6 -> 8 (+review-work, +ai-slop-remover)
- config: schema files 24 -> 27 (+git-env-prefix, model-capabilities, openclaw)
- cli: commands 5 -> 6 (+refresh-model-capabilities)
- plugin-handlers: 13 -> 14 non-test files
- shared: 95+ -> 100+ utility files
2026-04-05 14:12:31 +09:00

1.8 KiB

src/features/tmux-subagent/ — Tmux Pane Management

Generated: 2026-04-05

OVERVIEW

28 files. State-first tmux integration managing panes for background agent sessions. Handles split decisions, grid planning, polling, and lifecycle events.

CORE ARCHITECTURE

TmuxSessionManager (manager.ts)
  ├─→ DecisionEngine: Should we spawn/close panes?
  ├─→ ActionExecutor: Execute spawn/close/replace actions
  ├─→ PollingManager: Monitor pane health
  └─→ EventHandlers: React to session create/delete

KEY FILES

File Purpose
manager.ts TmuxSessionManager — main class, session tracking, event routing
decision-engine.ts Evaluate window state → produce SpawnDecision with actions
action-executor.ts Execute PaneAction[] (close, spawn, replace)
grid-planning.ts Calculate pane layout given window dimensions
spawn-action-decider.ts Decide spawn vs replace vs skip
spawn-target-finder.ts Find best pane to split or replace
polling-manager.ts Health polling for tracked sessions
types.ts TrackedSession, WindowState, PaneAction, SpawnDecision

PANE LIFECYCLE

session.created → spawn-action-decider → grid-planning → action-executor → track session
session.deleted → cleanup tracked session → close pane if empty

LAYOUT CONSTRAINTS

  • MIN_PANE_WIDTH: 52 chars
  • MIN_PANE_HEIGHT: 11 lines
  • Main pane preserved (never split below minimum)
  • Agent panes split from remaining space

EVENT HANDLERS

File Event
session-created-handler.ts New background session → spawn pane
session-deleted-handler.ts Session ended → close pane
session-created-event.ts Event type definition