Skip to content

fix(tui): always show the focused agent type in the status bar - #135

Merged
mlhher merged 4 commits into
mlhher:mainfrom
Emasoft:fix/statusbar-agent-type
Sep 27, 2026
Merged

mlhher merged 4 commits into
mlhher:mainfrom
Emasoft:fix/statusbar-agent-type

Conversation

@Emasoft

@Emasoft Emasoft commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Update 2026-09-25

New since the original description (dc8fbf7): the status bar's truncation helper is now ANSI-aware. It truncates rendered, lipgloss-styled status strings on narrow terminals, and the old rune walker counted escape bytes as content — it could cut inside a CSI escape sequence and emit garbage like ESC[3... into the bar. It now uses ansi.Truncate: same visible width, escape sequences kept intact.


With the root agent focused, the status bar showed no agent identity at all — breadcrumbs only render for subagents, so the orchestrator was anonymous. The status bar now always names the focused agent in the left section:

  • root focus → an always-on orchestrator label
  • focused subagent → the breadcrumb chain names it as before, with no duplicate label

One-file TUI fix (internal/tui/view.go): the focused-agent label is computed from the same path walk that builds the breadcrumbs, plus agentTypeForID (main → orchestrator, <type>-subagent-<n> → <type>) and 5 new tests in internal/tui/statusbar_test.go.

Split out of #133 (TUI changes evaluated separately, per review).

Testing

$ go test ./... -race -count=1
ok  	late/cmd/late	2.527s
?   	late/cmd/mcp-run	[no test files]
ok  	late/internal/agent	1.555s
?   	late/internal/assets	[no test files]
ok  	late/internal/client	4.866s
ok  	late/internal/common	5.727s
ok  	late/internal/config	3.511s
ok  	late/internal/executor	10.405s
ok  	late/internal/git	2.089s
ok  	late/internal/mcp	3.806s
ok  	late/internal/orchestrator	6.011s
?   	late/internal/pathutil	[no test files]
ok  	late/internal/plugin	14.245s
ok  	late/internal/session	1.740s
ok  	late/internal/skill	2.936s
ok  	late/internal/tool	2.921s
ok  	late/internal/tool/ast	5.223s
ok  	late/internal/tui	10.904s

exit 0 — all 18 packages green (15 ok, 3 without test files).

  • gofmt -l on the touched files: no output (clean)
  • go vet ./internal/tui: clean

Focusing the root now renders an 'orchestrator' label next to the state
equalizer (subagent focus keeps the breadcrumb chain, no duplicates).
@mlhher

mlhher commented Sep 24, 2026

Copy link
Copy Markdown
Owner

Will be merged. Please note that the branch and agent type are shifting around between orchestrator and subagents, I will check what looks better and then merge it with that single change (presumably either anchoring it or moving the branch to the right, depending on what seems most sensible). Thanks again!

…mid-CSI

The status bar truncates rendered, lipgloss-styled status strings on
narrow terminals. The old rune walker counted escape bytes as content
and could cut INSIDE a CSI sequence, emitting garbage like "ESC[3..."
into the bar. Replace it with ansi.Truncate, which measures the same
visible width, keeps sequences intact, and already accounts for the
tail width.

Review fix cherry-picked from 0a97d2f (truncate helper + view_truncate_test.go only).
@mlhher
mlhher merged commit 60c6d18 into mlhher:main Sep 27, 2026
1 check passed
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.

2 participants