Skip to content

feat(cli): improve model usage layout - #12106

Merged
jeanduplessis merged 2 commits into
mainfrom
feat/scan-model-usage
Jul 10, 2026
Merged

feat(cli): improve model usage layout#12106
jeanduplessis merged 2 commits into
mainfrom
feat/scan-model-usage

Conversation

@jeanduplessis

@jeanduplessis jeanduplessis commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Make session model usage easier to scan and selectively inspect in the CLI sidebar.

Why this change is needed

Model statistics were presented as several wrapped lines with inline separators. In sessions using multiple models, costs and step counts were difficult to compare, and the section consumed substantial sidebar space even when users did not need it.

How this is addressed

  • Present each model as a compact row with aligned Model, Steps, and Cost columns.
  • Let users collapse the entire Models section or expand individual models for token and cache details.
  • Preserve provider grouping and truncate long model labels so numeric columns stay aligned.

Before and after

Before:

Models (4)
Kilo Gateway
  GPT-5.6 Sol (new)
  Steps 45 | Cost $3.549455
  In 214,037 | Out 11,155 | Reason 13,900
  Cache R 3,455,240 | W 0 | Rate 94.2%

  GPT-5.4
  Steps 78 | Cost $2.373468
  In 644,127 | Out 20,882 | Reason 0
  Cache R 1,799,680 | W 0 | Rate 73.6%

After:

▼ Models (4)
Kilo Gateway
 Model             Steps      Cost
▶ GPT-5.6 Sol         45      $3.55
▶ GPT-5.4             78      $2.37
▶ GPT-5.6 Terra       50      $1.45
▶ GPT-5.6 Luna        42      $0.73

Expanded model:

▼ GPT-5.6 Sol         45        $3.55
  Input                       214,037
  Output                       11,155
  Reasoning                    13,900
  Cache read                3,455,240
  Cache write                       0
  Cache rate                    94.2%
CleanShot 2026-07-10 at 17 57 47@2x

Human Verification

The implementation received a focused local code review covering logic, type safety, security, resource management, data safety, and SolidJS/OpenTUI patterns. No actionable issues were found.

Reviewer Notes

Human Reviewer Flags

  • Model details now favor compact comparison by default and require one click to inspect per-model token details.
  • Collapse state is local to the current TUI component lifetime.

Code Reviewer Agent

Code Reviewer Notes
  • Reuses the existing Locale.truncate utility and established sidebar / disclosure pattern.
  • Keeps implementation in a Kilo-owned path, avoiding changes to shared upstream OpenCode files.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b6b55d1a34

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +172 to +173
<box width={9} flexShrink={0} justifyContent="flex-end">
<text fg={theme().textMuted}>{formatCost(model.cost)}</text>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Widen the cost column before fixing its width

For models whose formatted cost is longer than 9 cells, this fixed-width box cannot display the value that formatCost returns. This happens for realistic values such as tiny nonzero costs (<$0.000001, 10 characters) or costs with six fractional digits at $10+, so the new compact row can clip or overflow the cost where the previous layout showed the full value; either reserve enough width or shorten the formatted value before putting it in the fixed column.

Useful? React with 👍 / 👎.

@kilo-code-bot

kilo-code-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 1 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
packages/opencode/src/kilocode/plugins/sidebar-usage.tsx 173 Cost values longer than the fixed nine-cell column can clip or overflow.

Fix these issues in Kilo Cloud

Files Reviewed (1 files)
  • packages/opencode/src/kilocode/plugins/sidebar-usage.tsx - 1 issue
Previous Review Summary (commit b6b55d1)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit b6b55d1)

Status: 1 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
packages/opencode/src/kilocode/plugins/sidebar-usage.tsx 173 Cost values longer than the fixed nine-cell column can clip or overflow.

Fix these issues in Kilo Cloud

Files Reviewed (2 files)
  • .changeset/clear-model-usage.md - 0 issues
  • packages/opencode/src/kilocode/plugins/sidebar-usage.tsx - 1 issue

Reviewed by gpt-5.6-sol · Input: 32.9K · Output: 5.2K · Cached: 165.6K

Review guidance: REVIEW.md from base branch main

@jeanduplessis
jeanduplessis merged commit 1176956 into main Jul 10, 2026
30 checks passed
@jeanduplessis
jeanduplessis deleted the feat/scan-model-usage branch July 10, 2026 16:50
AlexOcculate pushed a commit to AlexOcculate/kilocode that referenced this pull request Jul 14, 2026
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
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.

3 participants