Skip to content

feat(tui): canonical agent visibility + sub-agent kind distinction - #1447

Merged
namastex888 merged 2 commits into
devfrom
tui-sidebar
Apr 28, 2026
Merged

namastex888 merged 2 commits into
devfrom
tui-sidebar

Conversation

@namastex888

Copy link
Copy Markdown
Contributor

⚠ DRAFT — 2 raw `wip:` commits will fail commitlint. Awaiting authorization to squash into a single conventional commit.

Summary

Implements wish `tui-sidebar-canonical-visibility` (3 execution groups, all done by team `tui-sidebar`):

  • G1 Visibility — `palette.textDim` → legible color + glyph swap `○ → ◌` for stopped state in `TreeNode.tsx`. Stopped canonical agents are no longer visually invisible against panel bg.
  • G2 Affordance — `[Enter to start]` suffix on stopped agent rows, mirroring existing `[stuck]`/`[paused]`/`[done]` pattern in `getAgentSuffix`.
  • G3 Kind distinction — new `kind: 'canonical' | 'subagent'` field on agent tree nodes (`types.ts`), set in `buildAgentNode` + `appendSubAgentNodes`. Canonicals always at depth 0; sub-agents always nested under their parent.

Why

User-reported bug: canonical workspace agents (`~/workspace/agents//`) that aren't currently running disappeared from the TUI sidebar, blocking re-spawn. Plus non-canonical sub-agents (slashed names like `felipe/scout`, `genie/devrel`) shared the same hierarchy with no kind distinction.

After this PR: every canonical agent is visible regardless of runtime state, sub-agents are explicitly nested.

Diff

614 insertions across 7 files (Nav.tsx, TreeNode.tsx, types.ts, session-tree.ts + Nav.test.tsx, TreeNode.test.tsx, session-tree.test.ts extensions).

Wish artifact

`.genie/wishes/tui-sidebar-canonical-visibility/WISH.md` — full plan, acceptance criteria, validation commands.

Known gap before mark-ready

Commits are `wip: tui-sidebar-canonical-visibility#1` (G1+G2) and `wip: tui-sidebar-canonical-visibility#3` (G3). Commitlint will reject. Squash into one `feat(tui): canonical agent visibility + kind distinction` commit before mark-ready-for-review. Pending Felipe's authorization for force-push (similar to #1432 cleanup).

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Apr 28, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: ace60728-908d-4464-b361-67d4e4aaaa67

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tui-sidebar

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@namastex888
namastex888 marked this pull request as ready for review April 28, 2026 05:36
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

Wish: tui-sidebar-canonical-visibility — surfaces stopped canonical
agents in the TUI sidebar so users can re-spawn idle workspace agents
without losing the menu, and explicitly types every node as canonical
or sub-agent so sub-agents render only nested under their parent.

Changes:
- TreeNode.tsx: replace palette.textDim with legible color and swap
  glyph ○→◌ for wsAgentState='stopped'; add ' [Enter to start]'
  suffix to mirror existing [stuck]/[paused]/[done] pattern; render
  kind-aware label decoration.
- types.ts: extend TreeNode shape with kind: 'canonical' | 'subagent'.
- session-tree.ts: set kind in buildAgentNode (canonical) and
  appendSubAgentNodes (subagent) so the data layer carries the
  distinction without name parsing.
- Tests: TreeNode.test.tsx (color + suffix + glyph), Nav.test.tsx
  (Enter-on-stopped triggers spawnAgent), session-tree.test.ts
  (kind field assertions for canonical vs subagent paths).

Wish artifact: .genie/wishes/tui-sidebar-canonical-visibility/WISH.md

Co-orchestrated by team 'tui-sidebar'; squashed from 2 wip commits
into a single conventional commit before merge.
G1 of the wish (visibility for stopped agents) changes:
- TreeNode color for wsAgentState='stopped' from palette.textDim to a
  legible color
- Glyph from ○ to ◌

Update the captured frame for the "TreeNode > agent state = stopped"
visual test to reflect the new design. Also drops orphaned SystemStats /
Nav-loading / TeamCreate snapshots whose describe blocks were
quarantined in #1448 (skipped tests have no snapshots to compare
against).

Net diff: 1 snapshot block updated (stopped state), 6 orphan blocks
removed. No new snapshots; no other tests affected.
@namastex888
namastex888 merged commit 7a3b94e into dev Apr 28, 2026
11 checks passed
namastex888 added a commit that referenced this pull request Apr 29, 2026
`computeNavCounts` returned `{ agentCount: 0, runningCount: 0 }` whenever
the workspace scan came up empty (stale workspaceRoot, no agents resolved,
or every node was an orphan session) — even when tmux had live panes. Users
saw `0/0` in the nav header despite running agents.

Fix: when workspaceRoot mode produces zero agents, fall back to the live
tmux pane inventory so the header reflects reality. Export `computeNavCounts`
so the helper is unit-testable — the missing test on this helper is exactly
why the regression slipped through PR #1447's review.

Adds 8 regression tests covering: workspaceRoot+agents, workspaceRoot+empty
fallback, no-workspaceRoot tmux sum, mixed orphan/agent counting, running
filter, and diagnostic-snapshot edge cases.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
namastex888 added a commit that referenced this pull request Apr 29, 2026
…up) (#1507)

`computeNavCounts` returned `{ agentCount: 0, runningCount: 0 }` whenever
the workspace scan came up empty (stale workspaceRoot, no agents resolved,
or every node was an orphan session) — even when tmux had live panes. Users
saw `0/0` in the nav header despite running agents.

Fix: when workspaceRoot mode produces zero agents, fall back to the live
tmux pane inventory so the header reflects reality. Export `computeNavCounts`
so the helper is unit-testable — the missing test on this helper is exactly
why the regression slipped through PR #1447's review.

Adds 8 regression tests covering: workspaceRoot+agents, workspaceRoot+empty
fallback, no-workspaceRoot tmux sum, mixed orphan/agent counting, running
filter, and diagnostic-snapshot edge cases.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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