Skip to content

feat(overseer): TUI line + Ctrl+A o create/enter - #115

Merged
TraderSamwise merged 2 commits into
masterfrom
feat/overseer-tui
Jun 14, 2026
Merged

feat(overseer): TUI line + Ctrl+A o create/enter#115
TraderSamwise merged 2 commits into
masterfrom
feat/overseer-tui

Conversation

@TraderSamwise

@TraderSamwise TraderSamwise commented Jun 14, 2026

Copy link
Copy Markdown
Owner

What

Surfaces the overseer agent in the interactive aimux dashboard. Opt-in — nothing changes until you create one.

Builds on #114 (overseer backend: spawn flag, role preamble, daemon loop watcher).

UX

  • Ctrl+A o is a create-or-enter toggle:
    • No live overseer → opens the normal tool/provider picker (same flow as Ctrl+A c) and spawns one rooted at the main repo (findMainRepo, not the focused worktree) with overseer: true (sets the team role → sticky preamble, and the metadata flag → loop-watcher discovery).
    • Live overseer exists → jumps straight into its session (no picker), so you can chat with it.
  • A dedicated "Overseer" line renders above the worktree groups when an overseer exists; absent otherwise.
  • Overseer sessions are partitioned out of the worktree groups and the worktree nav list (isOverseerSession) so they never double-render or appear as phantom cursor entries.
  • Help legend gains Ctrl+A o.

Design notes

  • v1 entry is via the hotkey (and existing numbered-focus / switcher), not cursor+enter on the new line — this deliberately avoids touching the worktree cursor-flat-list navigation. Cursor-selectable line is a clean follow-up.
  • The tool picker is reused as the provider selector via a new toolPickerOverseer flag; runSelectedTool swaps in the main-repo cwd and the overseer flag when set.

Files

Hotkey/create path: hotkeys.ts, multiplexer/session-launch.ts, multiplexer/tool-picker.ts, multiplexer/dashboard-actions-methods.ts, multiplexer/dashboard-ops.ts, multiplexer/index.ts. Render/partition: dashboard/index.ts, multiplexer/dashboard-model.ts, multiplexer/dashboard-view-methods.ts, multiplexer/dashboard-control.ts, tui/screens/dashboard-renderers.ts, tui/screens/overlay-renderers.ts, team.ts (isOverseerSession).

Verification

yarn typecheck, yarn lint, yarn build, full yarn vitest (1113 tests) all pass. New unit test: the Overseer line renders above the worktrees when present and is absent when empty.

Not done: live interactive-dashboard verification (the keypress→picker→spawn→render loop hasn't been eyeballed in a real terminal headlessly).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added support for overseer sessions with dedicated display on the dashboard.
    • New hotkey (Ctrl+A o) to create or open an overseer session.
  • Documentation

    • Updated help overlay with new overseer keybinding.

Surfaces the overseer in the interactive dashboard (opt-in, nothing
changes by default):

- Ctrl+A o is a create-or-enter toggle: with no live overseer it opens
  the normal tool/provider picker in "overseer" mode and spawns one
  rooted at the main repo (findMainRepo, not the focused worktree) with
  overseer:true; with a live overseer it jumps straight into its session
- a dedicated "Overseer" line renders above the worktree groups when an
  overseer exists; overseer sessions are partitioned out of the worktree
  groups and the worktree nav list (isOverseerSession) so they never
  double-render or appear as phantom nav entries
- help legend gains the new hotkey
- tests: the overseer line renders above worktrees when present and is
  absent otherwise

Backend (spawn overseer flag, preamble, loop watcher) shipped in #114.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
app Ready Ready Preview, Comment Jun 14, 2026 1:22am

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@TraderSamwise, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 3 hours, 42 minutes, and 3 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8dde578e-a49f-413e-8ea7-f7767c97570a

📥 Commits

Reviewing files that changed from the base of the PR and between 4a14b6d and e4ec665.

📒 Files selected for processing (6)
  • src/metadata-store.test.ts
  • src/metadata-store.ts
  • src/multiplexer/dashboard-interaction.ts
  • src/multiplexer/dashboard-model.ts
  • src/multiplexer/session-launch.ts
  • src/multiplexer/tool-picker.ts
📝 Walkthrough

Walkthrough

Introduces an "overseer" session role end-to-end: a new isOverseerSession predicate, a DashboardViewModel.overseerSessions field, filtering of overseer sessions out of worktree groups, a create-overseer hotkey (o) that focuses an existing overseer or opens the tool picker in overseer mode, overseer metadata forwarded through the spawn API, and a dedicated "Overseer" rendering block at the top of the dashboard TUI.

Changes

Overseer Session Feature

Layer / File(s) Summary
Overseer predicate and data model contracts
src/team.ts, src/dashboard/index.ts, src/multiplexer/index.ts
Adds isOverseerSession boolean predicate, extends DashboardViewModel with required overseerSessions: DashboardSession[] (initialized to []), and adds the private toolPickerOverseer boolean flag to Multiplexer.
Filter overseer sessions out of worktree groups
src/multiplexer/dashboard-control.ts, src/multiplexer/dashboard-model.ts, src/multiplexer/dashboard-view-methods.ts
Imports isOverseerSession in all three files; excludes overseer sessions from updateWorktreeSessions and from both main and secondary buckets in buildDashboardWorktreeGroups; splits dashboardSessionsCache in renderDashboard so overseerSessions is passed through dashboard.update.
Hotkey dispatch and create-overseer action handler
src/hotkeys.ts, src/multiplexer/session-launch.ts
Extends HotkeyAction with "create-overseer", maps the "o" key to dispatch it, and adds a handleAction branch that resolves a live overseer session and opens its tmux window or falls back to the tool picker with { overseer: true }.
Tool picker overseer mode: spawn payload and session creation
src/multiplexer/dashboard-ops.ts, src/multiplexer/dashboard-actions-methods.ts, src/multiplexer/tool-picker.ts
Adds overseer?: boolean to spawnDashboardAgentWithFeedback and forwards it to /agents/spawn; updates showToolPicker and dashboardActionMethods.showToolPicker to accept and store the overseer flag; extends runSelectedTool to select the main-repo worktree path, pass overseer metadata into the spawn call, and mark the created transport with setSessionOverseer.
TUI overseer rendering and help text
src/tui/screens/dashboard-renderers.ts, src/tui/screens/dashboard-renderers.test.ts, src/tui/screens/overlay-renderers.ts
Renders a dedicated "Overseer" block at the top of the dashboard frame when overseerSessions is non-empty; adds tests verifying presence/absence of the rendered label; adds the Ctrl+A o entry to the help overlay.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant HotkeyHandler
  participant SessionLaunch
  participant MetadataStore
  participant ToolPicker
  participant ToolRunner
  participant DashboardOps
  participant AgentsAPI
  participant TeamMetadata

  User->>HotkeyHandler: press o
  HotkeyHandler->>SessionLaunch: onAction create-overseer
  SessionLaunch->>MetadataStore: findOverseerSessionId and loadMetadataState
  alt live overseer exists
    SessionLaunch->>SessionLaunch: open live tmux window
  else no live overseer
    SessionLaunch->>ToolPicker: showToolPicker with overseer true
    ToolPicker->>ToolRunner: runSelectedTool in overseer mode
    ToolRunner->>DashboardOps: spawnDashboardAgentWithFeedback overseer true
    DashboardOps->>AgentsAPI: POST agents spawn with overseer flag
    ToolRunner->>TeamMetadata: setSessionOverseer true
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • TraderSamwise/aimux#110: Modifies the same spawnDashboardAgentWithFeedback /agents/spawn payload and tool-picker.ts launch flow, extending them with different options (launchOverride vs. overseer), making the code paths directly intertwined.

Poem

🐇 Hop hop, a new role appears today,
An overseer session joins the fray!
Press o to summon or to find,
The dashboard splits the worktrees, refined.
Each agent knows their rank and place,
The overseer watches from above with grace. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(overseer): TUI line + Ctrl+A o create/enter' directly and accurately describes the main change—introducing an overseer feature with a TUI line and hotkey binding.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/overseer-tui

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
src/hotkeys.ts (1)

95-97: Run a build before manual hotkey verification.

Before validating Ctrl+A o behavior in terminal, run yarn build so dist/ reflects this TypeScript change.

As per coding guidelines, "Rebuild with yarn build after src/*.ts changes before testing runtime behavior or sending users to verify behavior changes."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/hotkeys.ts` around lines 95 - 97, The change to the "o" case handler in
the hotkeys.ts file needs to be compiled into the distribution files before the
Ctrl+A o behavior can be verified at runtime. Run yarn build to compile the
TypeScript changes in src/ into the dist/ directory, ensuring that the updated
create-overseer action is available for manual testing and user verification.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/multiplexer/dashboard-model.ts`:
- Around line 470-473: The overseer session filtering applied at line 470 with
the isOverseerSession predicate is not consistently applied when
composeDashboardWorktreeGroups reconstructs group sessions from the full
dashSessions set starting at line 522. Apply the same filter predicate
(!isOverseerSession(s)) within composeDashboardWorktreeGroups when processing
dashSessions to prevent overseer sessions from being reintroduced into worktree
groups after pending-action application, ensuring consistent filtering across
both the initial group construction and the group recomposition logic. Also
apply this same fix at line 490 where a similar pattern exists.

In `@src/multiplexer/session-launch.ts`:
- Around line 789-793: The call to openLiveTmuxWindowForEntry in the
liveOverseer check does not validate the result of the operation. Instead of
ignoring the outcome, capture the return value from openLiveTmuxWindowForEntry
and check whether it equals "opened". If it does not return "opened" (indicating
the operation failed or was a no-op), fall back to calling host.showToolPicker
as the else branch currently does, ensuring that stale runtime state does not
prevent overseer creation.

In `@src/multiplexer/tool-picker.ts`:
- Around line 207-211: The findMainRepo() call in the wtPath assignment lacks
error handling and can throw an exception if repo discovery fails, interrupting
agent creation. Wrap the findMainRepo() call in a try-catch block that returns
undefined as a fallback value if an error is thrown. This ensures that if repo
resolution fails, wtPath will safely default to undefined rather than
propagating an exception through the overlay key handling logic.

---

Nitpick comments:
In `@src/hotkeys.ts`:
- Around line 95-97: The change to the "o" case handler in the hotkeys.ts file
needs to be compiled into the distribution files before the Ctrl+A o behavior
can be verified at runtime. Run yarn build to compile the TypeScript changes in
src/ into the dist/ directory, ensuring that the updated create-overseer action
is available for manual testing and user verification.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 25dadc00-0750-49b2-9727-173a763e7d5f

📥 Commits

Reviewing files that changed from the base of the PR and between 7b89a98 and 4a14b6d.

📒 Files selected for processing (14)
  • src/dashboard/index.ts
  • src/hotkeys.ts
  • src/multiplexer/dashboard-actions-methods.ts
  • src/multiplexer/dashboard-control.ts
  • src/multiplexer/dashboard-model.ts
  • src/multiplexer/dashboard-ops.ts
  • src/multiplexer/dashboard-view-methods.ts
  • src/multiplexer/index.ts
  • src/multiplexer/session-launch.ts
  • src/multiplexer/tool-picker.ts
  • src/team.ts
  • src/tui/screens/dashboard-renderers.test.ts
  • src/tui/screens/dashboard-renderers.ts
  • src/tui/screens/overlay-renderers.ts

Comment thread src/multiplexer/dashboard-model.ts
Comment thread src/multiplexer/session-launch.ts
Comment thread src/multiplexer/tool-picker.ts Outdated
- metadata-store: enforce a single overseer — setSessionOverseer(…, true)
  clears any other session's flag, so a dead overseer no longer makes
  Ctrl+A o spawn a new one every time (unbounded growth)
- dashboard-model: also exclude overseers in composeDashboardWorktreeGroups
  so pending-action recomposition can't reintroduce them into groups
- dashboard-interaction: filter overseers out of the quick-jump worktree
  builder so they don't show as a spurious orphan worktree entry
- session-launch: check openLiveTmuxWindowForEntry's result — only a stale
  ("missing") session falls through to creating a fresh overseer; "error"
  is already surfaced and "opened" is done
- tool-picker: guard findMainRepo() against throwing; reset the overseer
  picker flag on Esc
- tests: singleton-overseer enforcement

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@TraderSamwise

Copy link
Copy Markdown
Owner Author

Sub-agent review (round 1) — dispositions

An independent sub-agent reviewed alongside CodeRabbit. Its findings (distinct from the CR threads above), all fixed in e4ec665:

# Sev Finding Resolution
1 high A dead overseer's metadata flag was never cleared, so Ctrl+A o kept spawning new overseers unboundedly (create-or-enter always found the stale dead one) FixedsetSessionOverseer(…, true) now enforces a single overseer by sweeping other flags; regression test added
2 med The overseer (real main-repo worktreePath) leaked into buildDashboardQuickJumpWorktrees as a spurious orphan worktree, shifting quick-jump digits Fixed — filtered overseers out at both quick-jump call sites in dashboard-interaction
3 low toolPickerOverseer wasn't reset on Esc (benign — next showToolPicker overwrites it — but untidy) Fixed — reset in the Esc branch

CodeRabbit's 3 threads (composeDashboardWorktreeGroups filter, open-result fallback, findMainRepo guard) are addressed in the same commit and replied to inline.

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