Skip to content

fix(presentation): dim the sub-agent stats icons at a zero count - #1504

Merged
edenreich merged 1 commit into
mainfrom
fix/issue-1498
Oct 2, 2026
Merged

edenreich merged 1 commit into
mainfrom
fix/issue-1498

Conversation

@inference-gateway-maintainer

Copy link
Copy Markdown
Contributor

Resolves #1498

Summary

The sub-agent list stats line (└ 3 ✓ 0 ✗ · 1.2k tokens) always rendered the tick in the success color and the cross in the error color, so a red cross next to a 0 read as a failure that never happened. statsView now colors each icon by its own count: the status color once the count is positive, the dim theme color at zero, matching the token figure beside it.

Changes

  • internal/presentation/tui/components/subagent_list.go: statsView picks success for the tick only when ToolsSucceeded > 0 and error for the cross only when ToolsFailed > 0, both defaulting to dim. Counts, spacing and padding are untouched, so the line keeps its width and alignment.
  • internal/presentation/tui/components/subagent_list_test.go: adds TestSubagentListStatsIconsDimAtZero, a table-driven color assertion over the four count combinations (both zero, both positive, zero failures, zero successes). It builds the expected line from the real style provider and compares it exactly, so the cross of a run with 0 failures is proven not to carry the error color. The test skips when the terminal renders no colors, where the assertion would be vacuous.
  • The per-row outcome icon in rowView is a single result rather than a count, so it keeps its color.

Verification

  • task precommit:run passes (tidy, mocks, go fmt, import aliases, golangci-lint 0 issues, markdownlint).
  • go test ./internal/presentation/tui/components/ -run 'TestSubagentList|TestCompactCount' passes, including the unchanged stats-line assertions in TestSubagentListShowsRunStatsUnderRows.

Docs

A [DOCS] follow-up is being opened in inference-gateway/docs to note the dim-at-zero coloring in the Run Stats section of docs/subagents.md, which shows the stats line.

The stats line hard-coded the success color on the tick and the error color on the cross, so a red cross next to a 0 read as a failure that never happened. Each icon now takes its status color only once its count is positive, and falls back to the dim theme color at zero like the token figure beside it.

The per-row outcome icon in rowView is a single result rather than a count, so it keeps its color.

TestSubagentListStatsIconsDimAtZero pins the icon color per count combination, covering a run with zero failures.
@inference-gateway-maintainer
inference-gateway-maintainer Bot marked this pull request as ready for review October 2, 2026 20:44
@inference-gateway-maintainer
inference-gateway-maintainer Bot requested a review from a team as a code owner October 2, 2026 20:44
@edenreich
edenreich merged commit 83c8934 into main Oct 2, 2026
1 check passed
@edenreich
edenreich deleted the fix/issue-1498 branch October 2, 2026 20:54
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.223.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TASK] Dim the tool-count tick and cross in the sub-agent list when the count is 0

1 participant