Skip to content

fix(ui): label model usage contributions as messages - #146735

Merged
steipete merged 1 commit into
mainfrom
codex/qa-models-message-count-20260912
Sep 13, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa-models-message-count-20260912

Conversation

@steipete

@steipete steipete commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Models settings calls its local usage count “sessions” even though the provider rollup counts messages with usage records. One session containing two model replies therefore appears as “2 sessions.”

User Impact

The local spend detail now labels those contributions as messages. Token totals, cost, and the Usage page's separate session count retain their existing meaning.

Why This Change Was Made

Rename the private provider-card count and render the matching unit at the existing presentation boundary. The accounting producer already supplies the right number. The feature reference now states what the detail counts.

Production is +5/−5, net zero. The test fixture extraction preserves the existing tests while keeping the new regression file within the repository's line limit.

Evidence

Four regressions fail on the original label and pass after the repair: repeated messages for one model, different models in one session, provider aliases, and messages across sessions. On current head 00db6ad7f006764e104257d722ec64e8f9b62090 (base 3a78c93d51f056c9a9979177d6ac4b111a01445c), all 79 Models tests, five shared aggregation tests, the selected SQLite cached-usage case, and the normal explicit-base changed gate pass. The fresh independent managed P0–P2 review found no actionable findings. Baseline/candidate builds and the following live UI proof remain attributed to base 51caa9442e47b91a88c8f382000e4bac0c7e6743; the eight-file patch is unchanged after integration.

The actual Gateway-served Models and Usage pages were exercised with a synthetic session through canonical session/usage writers and ordinary CLI requests. Before: Models “200 tokens · 2 sessions.” After: “200 tokens · 2 messages.” Usage retains one session, three total messages, two provider messages, and $2. The German UI uses the normal English fallback for the corrected phrase. Both runs joined their owned processes and removed their isolated state without rescue; all eight screenshots were inspected.

Current-head CI run 34753703704 is running. The current base includes the previously failing file-tab selector correction from #146810; the unchanged seven-case file-link browser suite also passed on that exact main. Earlier independent CI fixture repairs and the undiagnosed project-resolution timeout remain recorded in prior runs; no assertion or timeout was weakened. Defect introduction provenance is unverified.

Before: two usage-bearing messages shown as sessions

After: usage contributions correctly labeled as messages

@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Sep 13, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 7:22 AM ET / 11:22 UTC (Revision 7).

ClawSweeper review

What this changes

The Models settings page labels usage contributions as messages, renames its private count field, and adds regression coverage and explanatory documentation.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused correction: fetched main and the latest release still show the incorrect unit. The supplied visual proof supports the fix, and no actionable patch defect was found.

Priority: P3
Reviewed head: 00db6ad7f006764e104257d722ec64e8f9b62090

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused presentation repair with convincing visual proof and meaningful regression coverage.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected Gateway-served Models screenshots directly demonstrate the changed rendering owner: two usage contributions switch from “sessions” to “messages” while tokens and cost remain unchanged. The body preserves the earlier proof baseline and separately reports current-head regression validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected Gateway-served Models screenshots directly demonstrate the changed rendering owner: two usage contributions switch from “sessions” to “messages” while tokens and cost remain unchanged. The body preserves the earlier proof baseline and separately reports current-head regression validation.
Evidence reviewed 8 items Current main still needs the correction: Fetched main retains the local-cost template using the sessions placeholder and unit.
Latest release retains the old label: The GitHub contents API confirms that v2026.9.4 also labels the count as sessions. This read succeeded after local retrieval of the release blob failed.
Accounting semantics support a presentation repair: The rollup increments model usage once per contribution carrying usage totals; the shared accumulator sums those counts by provider while maintaining sessionCount separately. The PR preserves this accounting and changes only the private card field and displayed unit.
Findings None None.
Security None None.

How this fits together

The Models settings page receives provider totals from the Gateway’s session-usage aggregation. It displays those totals as local spend, token usage, and a count of messages carrying usage records.

flowchart LR
  A[Session messages] --> B[Usage record aggregation]
  B --> C[Provider totals]
  B --> D[Separate session count]
  C --> E[Models settings card]
  E --> F[Tokens, cost, and messages]
  D --> G[Usage overview]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source 0, Tests +124, Docs 0. Total +124 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 3 5 5 0
Tests 4 225 101 +124
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 231 107 +124

Review metrics

Metric Value Why it matters
Production versus test growth Production +5/−5, net 0; tests and test support +225/−101, net +124 The repair adds no production machinery; growth supplies four accounting-to-rendering regressions and shared fixtures.

Technical review

Best possible solution:

Keep accounting with its existing owner and make the Models card describe its usage-bearing message count accurately.

Do we have a high-confidence way to reproduce the issue?

Yes: one session with two usage-bearing replies produces a provider count of two, which current main labels as sessions. Source and supplied before/after screenshots establish the mechanism; this review did not run it.

Is this the best way to solve the issue?

Yes: correcting the private presentation field and label preserves the authoritative accounting and avoids introducing a competing counter.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 32bf352734f0.

Labels

Label justifications:

  • P3: This corrects a misleading usage unit without changing spend, tokens, session accounting, or access.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected Gateway-served Models screenshots directly demonstrate the changed rendering owner: two usage contributions switch from “sessions” to “messages” while tokens and cost remain unchanged. The body preserves the earlier proof baseline and separately reports current-head regression validation.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected Gateway-served Models screenshots directly demonstrate the changed rendering owner: two usage contributions switch from “sessions” to “messages” while tokens and cost remain unchanged. The body preserves the earlier proof baseline and separately reports current-head regression validation.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected Gateway-served Models screenshots directly demonstrate the changed rendering owner: two usage contributions switch from “sessions” to “messages” while tokens and cost remain unchanged. The body preserves the earlier proof baseline and separately reports current-head regression validation.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Ayaan Zaidi: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (6 earlier review cycles)
  • reviewed 2026-09-13T04:50:07.554Z sha e51e169 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-13T05:08:14.072Z sha e51e169 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-13T06:48:30.097Z sha d9b05837b4d6968fd60805e3b2471e61f9bca76d :: needs maintainer review before merge. :: none
  • reviewed 2026-09-13T09:48:20.688Z sha cadb550 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-13T10:05:12.883Z sha cadb550 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-13T11:15:56.539Z sha 00db6ad :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/qa-models-message-count-20260912 branch 2 times, most recently from d9b0583 to cadb550 Compare September 13, 2026 09:19
@steipete
steipete force-pushed the codex/qa-models-message-count-20260912 branch from cadb550 to 00db6ad Compare September 13, 2026 11:09
@steipete
steipete merged commit 970992d into main Sep 13, 2026
133 checks passed
@steipete
steipete deleted the codex/qa-models-message-count-20260912 branch September 13, 2026 11:55
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 13, 2026
* commit '4aff70f27016f9acf62d0acc19c8bd3592993e4c': (1537 commits)
  test: align plugin fixtures with current runtime contracts (#147000)
  refactor(browser): separate session tab tracking from cleanup (#146973)
  fix(tests): make systemd clock fixtures private (#146990)
  fix(linux): retire sleep guards when logind disconnects (#146046)
  refactor(matrix): share draft fallback delivery (#144840)
  fix(sessions): preserve cross-agent replies after reload (#146799)
  test(models): cover quota recovery during catalog discovery (#146708)
  fix(macos): recover browser sign-in when no browser opens (#146787)
  fix(process): prevent one-shot agents exiting while polling (#144268)
  fix(status): label the session inventory as stored (#146979)
  fix: avoid repeated background reads while loading chat (#146953)
  refactor(ui): narrow Skill Workshop proposal context (#146977)
  perf(sessions): keep cleanup responsive and reuse workers (#140897)
  fix(sessions): prevent stranded writers after abort and restart (#146792)
  refactor: reuse deferred owners in Gateway and infra fixtures (#146809)
  fix: prevent queued conversation replies from switching storage (#146984)
  test(ui): preserve nested failure summaries in CI logs (#146864)
  fix(test): respect process memory limits in local scheduling (#146298)
  fix: validate large media data URLs without regexp stack exhaustion (#146972)
  fix(ui): label model usage contributions as messages (#146735)
  ...
vincentkoc added a commit that referenced this pull request Sep 13, 2026
* commit '4aff70f27016f9acf62d0acc19c8bd3592993e4c': (30 commits)
  test: align plugin fixtures with current runtime contracts (#147000)
  refactor(browser): separate session tab tracking from cleanup (#146973)
  fix(tests): make systemd clock fixtures private (#146990)
  fix(linux): retire sleep guards when logind disconnects (#146046)
  refactor(matrix): share draft fallback delivery (#144840)
  fix(sessions): preserve cross-agent replies after reload (#146799)
  test(models): cover quota recovery during catalog discovery (#146708)
  fix(macos): recover browser sign-in when no browser opens (#146787)
  fix(process): prevent one-shot agents exiting while polling (#144268)
  fix(status): label the session inventory as stored (#146979)
  fix: avoid repeated background reads while loading chat (#146953)
  refactor(ui): narrow Skill Workshop proposal context (#146977)
  perf(sessions): keep cleanup responsive and reuse workers (#140897)
  fix(sessions): prevent stranded writers after abort and restart (#146792)
  refactor: reuse deferred owners in Gateway and infra fixtures (#146809)
  fix: prevent queued conversation replies from switching storage (#146984)
  test(ui): preserve nested failure summaries in CI logs (#146864)
  fix(test): respect process memory limits in local scheduling (#146298)
  fix: validate large media data URLs without regexp stack exhaustion (#146972)
  fix(ui): label model usage contributions as messages (#146735)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant