Commit Graph

896 Commits

Author SHA1 Message Date
YeonGyu-Kim 2d37df48c1 refactor(team-mode): use dedicated focus and grid windows for team layout
Replace in-window pane splitting with two purpose-built windows
(focus: main-vertical, grid: tiled) created off the target session,
so leader pane is never disturbed and layouts no longer collapse
under teammate count.

🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2026-05-06 14:20:50 +09:00
YeonGyu-Kim 503df29195 fix(team-mode): register spawned sessions early 2026-05-06 14:20:50 +09:00
YeonGyu-Kim cb819307ff fix(team-mode): stop tmux freeze when many teammates spawn
Drop the per-pane select-pane title shuffle and the cyan border styling that leaked to window scope, then switch from main-vertical to tiled when there are 4 or more teammates so each pane keeps a usable height for the opencode TUI.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-06 14:20:50 +09:00
YeonGyu-Kim e6cd50cc15 fix(team-mode): preserve tmux focus during layout
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-06 14:20:50 +09:00
YeonGyu-Kim 8f48277e6c fix(builtin-commands): pin hyperplan roster contract
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-06 14:20:50 +09:00
YeonGyu-Kim ca8732f8fe fix(team-mode): reject incomplete hyperplan teams
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-06 14:20:50 +09:00
YeonGyu-Kim d737f2e214 test(background-agent): remove forbidden assertions in manager tests
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-06 14:20:50 +09:00
YeonGyu-Kim c90be7f9a6 feat(team-mode): align member and lead prompts with Claude Code free-code reference
Bring the team member addendum and the team-mode skill in line with the
Claude Code experimental Agent Teams reference (../free-code) on the
behavioral framing the LLM needs, while keeping every omo-specific
constraint (TeamRunId param, lead-only tool blocklist, eligibility
registry, sisyphus-junior routing) intact.

Member addendum (src/features/team-mode/member-guidance.ts) — adopt
free-code teammatePromptAddendum.ts wisdom that was missing:

- "User interacts primarily with the team lead" — members no longer try
  to address the user directly; they coordinate via task system + DMs.
- Stronger emphasis that plain assistant text is invisible to the team;
  team_send_message is mandatory, not optional.
- Broadcast (`to: "*"`) called out explicitly with "sparingly" guidance
  and the lead-only constraint.
- "Idle is normal" section: idle ≠ done, idle teammates can still
  receive messages, the lead must not treat idle as an error.
- "Communication rules" section forbidding structured JSON status
  messages and forbidding terminal tools as a peer-inspection backdoor;
  always reference teammates by NAME, not session ID.
- Auto-delivery framing: messages arrive as new turns, no manual inbox
  polling, no need to quote a teammate's message back to the lead.

Team-mode skill (src/features/builtin-skills/skills/team-mode.ts) —
adopt free-code TeamCreateTool/prompt.ts sections that were missing:

- Task ownership: any agent can set/change `owner` via team_task_update.
- Automatic message delivery: <peer_message ...> envelope flow.
- Teammate idle state: idle is the expected post-turn state; peer DM
  summaries surface in the lead's idle notification.
- Discovering team members: team_status + ~/.omo/teams/ config; refer by
  name, never raw session IDs.
- Task list coordination: claim by ID order (lowest first), check after
  every completion, escalate blocking deadlocks to the lead.
- Communication rules: same anti-patterns as the member addendum, scoped
  for the lead's awareness (no JSON status, no terminal peer-inspection,
  no delegate-task from inside members).

Test (create.test.ts) updated to track the renamed section header
("Lead-only tools you must NOT call") and to lock the new free-code
parity assertions ("user interacts primarily with the team lead",
"Idle is normal", "structured JSON status messages").

All other contract tests (team-mode skill keyword/section tests,
member parser, runtime tests) untouched and still passing.

Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode).
2026-05-06 14:20:50 +09:00
YeonGyu-Kim d8f89b6965 fix(team-mode): preserve per-category model for kind:"category" members
The shared resolveCategoryExecution path treats `agents.sisyphus-junior.model`
(plugin config) as a higher-precedence override than the category default. That
ranking is correct for plain `task(category=...)` delegations - it lets users
pin sisyphus-junior to their preferred general model - but in team-mode it
collapses every kind:"category" member onto the same model.

Hyperplan was the visible victim: skeptic/validator/researcher/architect/creative
are routed through sisyphus-junior with five distinct categories
(unspecified-low / unspecified-high / deep / ultrabrain / artistry). With any
sisyphus-junior model configured, all five resolved to that single override
model instead of their category defaults, defeating the multi-model adversarial
debate.

Strip the override at the team-mode boundary in resolveMember rather than
changing resolveCategoryExecution itself, so:
- delegate-task callers keep the existing override semantics (3 regression
  tests at tools.test.ts:2832, 2958, 3020 stay green)
- per-category user overrides (`categories[X].model`) and explicit fallback
  chains continue to apply
- only the `kind:"category"` team-mode path opts out of the global override

Lock the contract with a regression test in resolve-member.test.ts.

Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode).
2026-05-06 14:20:50 +09:00
YeonGyu-Kim 09fe4ca3dd fix(hyperplan): align keyword detector and command template with mandatory plan handoff
Update both injection paths to reflect the 7-phase workflow with the
mandatory plan agent handoff in step 7. The keyword detector now lists
all 8 enumerated steps including the explicit "do not write the plan
yourself" guidance, and the /hyperplan command template references the
7-phase workflow count.

Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode).
2026-05-06 14:20:50 +09:00
YeonGyu-Kim 5af41606be feat(builtin-commands): register hyperplan builtin command
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-06 14:20:50 +09:00
YeonGyu-Kim a75a24df77 feat(builtin-commands): add hyperplan command template
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-06 14:20:50 +09:00
YeonGyu-Kim 592308de1e feat(builtin-commands): add hyperplan to command name type
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-06 14:20:50 +09:00
YeonGyu-Kim b54922deab fix(team-mode): forbid delegate-task in member guidance
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-06 14:19:40 +09:00
YeonGyu-Kim 4d448778f3 fix(team-mode): reject empty team_create lead session override
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-06 14:19:40 +09:00
YeonGyu-Kim d7d956468c docs: add AGENTS.md for team-mode and tmux-subagent features 2026-05-06 14:19:39 +09:00
YeonGyu-Kim 855c848b99 feat(opencode-skill-loader): adapt skill resolution and discovery for team-mode 2026-05-06 14:19:39 +09:00
YeonGyu-Kim 7fbefa4cfe feat(claude-code-loader): adapt plugin discovery for team-mode 2026-05-06 14:19:39 +09:00
YeonGyu-Kim 15a0e10450 feat(background-agent): adapt task poller for team-mode work distribution 2026-05-06 14:19:39 +09:00
YeonGyu-Kim 00a6647021 feat(background-agent): adapt idle event handler for team-mode sessions 2026-05-06 14:19:39 +09:00
YeonGyu-Kim a0d122b1e6 feat(background-agent): integrate team-mode into background manager 2026-05-06 14:19:39 +09:00
YeonGyu-Kim 417a368af8 feat(background-agent): extend types for team-mode background tasks 2026-05-06 14:19:39 +09:00
YeonGyu-Kim 2e6bb3413e feat(builtin-commands): adapt commands and templates for team-mode 2026-05-06 14:19:39 +09:00
YeonGyu-Kim 844dcd4e83 feat(builtin-skills): register team-mode skill in exports 2026-05-06 14:19:39 +09:00
YeonGyu-Kim c9fdb04240 feat(builtin-skills): add team-mode skill implementation with tests 2026-05-06 14:19:39 +09:00
YeonGyu-Kim d3c020c4f9 feat(team-mode): export team-tools barrel 2026-05-06 14:19:39 +09:00
YeonGyu-Kim f2555feadb feat(team-mode): add team tasks tools with tests 2026-05-06 14:19:39 +09:00
YeonGyu-Kim b71c6e1905 feat(team-mode): add team query tools with tests 2026-05-06 14:19:39 +09:00
YeonGyu-Kim 379b3fde1f feat(team-mode): add team messaging tools with missing-session tests 2026-05-06 14:19:39 +09:00
YeonGyu-Kim f4327987d5 feat(team-mode): add team lifecycle tools with inline spec tests 2026-05-06 14:19:39 +09:00
YeonGyu-Kim a10ab16c39 feat(team-mode): export team-runtime barrel 2026-05-06 14:19:39 +09:00
YeonGyu-Kim c657dff8d1 feat(team-mode): add team runtime shutdown helpers and tests 2026-05-06 14:19:39 +09:00
YeonGyu-Kim cb1c7508e7 feat(team-mode): add team runtime resource cleanup with tests 2026-05-06 14:19:39 +09:00
YeonGyu-Kim 62d409085e feat(team-mode): add team runtime delete with background cancellation tests 2026-05-06 14:19:39 +09:00
YeonGyu-Kim 4645d56d05 feat(team-mode): add team runtime layout activation with tests 2026-05-06 14:19:39 +09:00
YeonGyu-Kim d958b7f17a feat(team-mode): add team runtime member dependency resolution 2026-05-06 14:19:39 +09:00
YeonGyu-Kim a65d54cac3 feat(team-mode): add team runtime member resolver with tests 2026-05-06 14:19:39 +09:00
YeonGyu-Kim 301e02cdf9 feat(team-mode): add team runtime status query with tests 2026-05-06 14:19:39 +09:00
YeonGyu-Kim d9785c7c2c feat(team-mode): add team runtime create with tests 2026-05-06 14:19:39 +09:00
YeonGyu-Kim 51382c1082 test(team-mode): add live tmux smoke test for team layout 2026-05-06 14:19:39 +09:00
YeonGyu-Kim f78b1e62d7 feat(team-mode): add sweep-stale-team-sessions with tests 2026-05-06 14:19:39 +09:00
YeonGyu-Kim 2b8096fc06 feat(team-mode): add resolve-caller-tmux-session helper with tests 2026-05-06 14:19:38 +09:00
YeonGyu-Kim eb61091f6d feat(team-mode): add rebalance-team-window command with tests 2026-05-06 14:19:38 +09:00
YeonGyu-Kim a13ef03f82 feat(team-mode): add close-team-member-pane command with tests 2026-05-06 14:19:38 +09:00
YeonGyu-Kim c5df781029 feat(team-mode): add tmux team layout creation and removal 2026-05-06 14:19:38 +09:00
YeonGyu-Kim 0f20a1b7f9 feat(team-mode): export team-mailbox barrel 2026-05-06 14:19:38 +09:00
YeonGyu-Kim 01aeeedc60 feat(team-mode): add team mailbox reservation logic 2026-05-06 14:19:38 +09:00
YeonGyu-Kim 2ce86ff9e5 feat(team-mode): add team mailbox poll with tests 2026-05-06 14:19:38 +09:00
YeonGyu-Kim 3f69333939 feat(team-mode): add team mailbox ack with tests 2026-05-06 14:19:38 +09:00
YeonGyu-Kim 07368b4685 feat(team-mode): add team mailbox send with tests 2026-05-06 14:19:38 +09:00