Repository navigation
feat(bob-statusbar): show Bob's savings in Bobcoins, not dollars - #1124
Conversation
With a preset that prices Bob, the proxy's money is in Bobcoins. The status bar showed it with a `$`. It now reads the `currency` field of /api/cachestate: - absent (an old proxy) or "USD": `· $1.75`, as before. - a unit name such as "Bobcoins": `· 1.75 Bobcoins`, with 4 decimals below 0.01 and `0` for 0, as the dashboard does. - "mixed", or a name that is not 1 to 16 ASCII letters after a trim: tokens only. The tooltip has no money text, so it needs no change. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Vitaly Zabershinsky <[email protected]>
vz-ibm
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (claude, user of @vz-ibm) | Claude Code 2.1.316 | offload-review skill, @vz-ibm's session | fresh | 2 of 2 | 1 of 2 | 87aa5ae60735 |
blocking |
Verdict: blocking
The code change is correct and well tested. One rule finding: the feature's data-dependence row is not updated.
Findings
- docs/data-dependence/features/bob-plugin.md — the row does not list the fields the status bar now reads
- What fails: The PR changes a feature (the Bob status bar).
CLAUDE.mdsays such a PR "adds or edits that feature's row file". The PR edits no row file. The row lists what the status bar reads: "the newest Bob session id and its saved-token count, and that session's cache times, prefix size and context window. All of these are counts, times and ids." The status bar now also reads a unit name (currency). It already readpricedand the saved money (money.*.saved_usd), and the row did not list those either. - Proof:
git diff cd82e95a..HEAD --statshows onlybob-plugin/statusbar/src/model.tsand its test.model.ts:30-32addscurrency.model.ts:106-116readspriced,moneyandcurrency. The PR body says "Data dependence: None changed", which is right for the Kind (stillmetadata), but the row text is now incomplete. - Fix: In the row, add "the saved money and its unit name (
USD,Bobcoinsormixed), from the price configuration, not from customer data". Rungo run ./cmd/gen-datadep. The Kind and the levels do not change, so no new "Decided by" sign-off is needed.
- What fails: The PR changes a feature (the Bob status bar).
Non-blocking
bob-plugin/context-guru/README.md:60-61says the status bar "reads only counts and times". It also shows money, and now a unit name. Consider one line: "Withbob-ultrahighit also shows the saved Bobcoins."model.ts:118says "The dashboard's rule".dash/ui/app.js:97-104(usd) also rounds values of 1000 or more to a whole number with a thousands separator. The status bar shows1234.56 Bobcoinswhere the dashboard shows1,235. Either copy that step or say "close to the dashboard's rule". A negative amount also prints as the dashboard does (-0.0042), so that is fine.- The
currencycontract comes from a proxy PR ("PR 1") that is not in the repo yet. No Go code sendscurrencytoday (grep -rn currency --include=*.gofinds nothing relevant). So the new branches run only in unit tests. If PR 1 sends a different case, for exampleusdorMixed, the status bar shows1.75 usdor1.75 Mixed, not$1.75or tokens only. Please check the exact strings against PR 1 before both merge, or compare case-insensitively. bob-plugin/context-guru/README.md:131-133andskills/status/SKILL.md:34-35still say Bob is priced in estimated dollars. That belongs to #1118, not this PR. Just make sure the two PRs leave the docs consistent.
What I checked
- Read
CLAUDE.md, the full diff (2 files, 85 lines added, 3 removed) and the commit message. formatSavedtraces:currencyabsent orUSD→$and 2 decimals, the same as before. The old test atmodel.test.ts:87still holds.Bobcoins→1.75 Bobcoins;0.0042→0.0042 Bobcoins;0→0 Bobcoins.mixed, an empty string, spaces,$(alert), non-ASCII, digits, 17 letters, a number,nullor an object → tokens only.UNIT(^[A-Za-z]{1,16}$, nomflag) blocks the VS Code$(icon)syntax and newlines after the trim.pricednot true → tokens only, as before.
client.ts:103-105passes the whole/api/cachestateobject through asCacheState, socurrencyreachesformatSavedwith no client change.currency: unknownmakes the type check force thetypeofguard.- Fail open: a bad or missing
currencynever throws. It only drops the money text. The status bar does not touch requests. - The tooltip (
model.ts:160-180) has no money text. The new render test checks no$in the text and the tooltip. - The behavior-change header is at the top of the PR body, with owner approval, who, old, new and how to turn it off.
- Tests are specific values, one concept each. I did not run them (no live tests approved).
vz-ibm
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (claude, user of @vz-ibm) | Claude Code 2.1.316 | offload-review skill, @vz-ibm's session | fresh | 1 of 2 | 1 of 2 | 87aa5ae60735 |
approve |
Verdict: approve
Findings
None.
Non-blocking
- The wire contract is not in any code yet. No Go file on this head or on
mainsendscurrencyon/api/cachestate(dash/cachestate.go:17-65has no such field). The values"USD"and"mixed"are defined only by this PR. The local branchfeat/price-currency(PR 1) addsPrice.Currencyininternal/modelinfo, but not the wire field yet. Before PR 1 merges, check that it sends exactly:- the key
currencyat the top level of the reply, not insidemoneyor per thread; "USD"for dollars, never"". This PR shows tokens only for""(test atmodel.test.ts:130). So if PR 1 sends""for USD, every priced Claude-on-Bob user loses the$figure;- the literal
"mixed", lowercase."Mixed"passesUNITand shows1.75 Mixed.
A shared fixture or one Go test that pins the JSON key and values would stop drift.
- the key
model.ts:109compares'USD'before the trim." USD "trims toUSD, passesUNIT, and shows1.75 USD, not$1.75. PR 1 rejects such names at load, so it cannot happen today. Moving the trim above the USD check makes it consistent.formatAmountis not quite "the dashboard's rule".dash/ui/app.js:96-103also rounds values of 1000 or more to whole numbers with a thousands separator. The status bar shows1234.57 Bobcoins. At 2 Bobcoins per million tokens this needs about 500M saved tokens, so it is rare. Either copy that branch or drop "as the dashboard does" from the comment.- A doc on PR 1 will go stale. The
feat/price-currencybranch adds a line that says "the status bar still shows a$". After this PR, that line is wrong. Fix it in whichever PR merges second.
What I checked
- The full diff
cd82e95a..87aa5ae6:bob-plugin/statusbar/src/model.ts(+23/-3) andtest/model.test.ts(+62). One commit, with DCO sign-off andAssisted-By. formatSavedpaths: unpriced, no money, currency absent,USD, a valid unit,mixed, invalid strings, and non-string values. Each one gives the text the tests expect.UNIT = /^[A-Za-z]{1,16}$/blocks the VS Code$(icon)syntax and the$character in the status bar text. Therendertest checks that no$or "dollar" is in the text or the tooltip.formatAmount:0→0;0.0042→0.0042;1.75→1.75; negative values keep their sign.client.ts:103-105passes the whole reply asCacheState, so a new top-level field reachesformatSavedwith no client change.- The PR body names the behavior change, who it affects, old and new text, and owner approval (@vz-ibm, 2026-11-12). With today's proxy, the text does not change.
- Data dependence: the status bar is not a registered component or feature row. It reads one more metadata field (a unit name). No row change is needed.
- Fail open: an unknown or bad
currencyfalls back to tokens only. It never throws. - I did not run
npm test. Live tests are not approved for this review.
- The unit is trimmed before the USD check, and USD and mixed are read in any case, so " USD " gives $1.75 and "Mixed" gives tokens only. - An amount of 1000 or more is a whole number with a thousands separator, as the dashboard's usd() shows it (1,235 Bobcoins). - The Bob plugin's data-dependence row and README say that the status bar also reads the saved money and its unit name. Both round-1 reviewers of #1124 raised these points. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Vitaly Zabershinsky <[email protected]>
|
Round 1 replies. Fixed in f072a76:
Checks: |
vz-ibm
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (claude, user of @vz-ibm) | Claude Code 2.1.316 | offload-review skill, @vz-ibm's session | resumed | 2 of 2 | 2 of 2 | f072a762888c |
approve |
Verdict: approve
The fix commit closes my one finding and the non-blocking points from both reviewers. I found no new defect.
Findings
None.
Earlier findings
- Reviewer 2, finding 1 (data-dependence row): fixed.
docs/data-dependence/features/bob-plugin.mdnow names the saved money and its unit name, from the price configuration. The generated row indocs/data-dependence.md:249has the same text as the row file. Kind and levels do not change, so the "Decided by" line stays. - Reviewer 2, non-blocking (README): fixed.
README.md:60-62now says the bar shows the saved Bobcoins withbob-ultrahigh. - Both reviewers, non-blocking (rounding at 1000 or more): fixed.
model.ts:124gives1,235, the same asusd()indash/ui/app.js:102. At 999.996 both give1000.00, so the edges also agree. - Both reviewers, non-blocking (case of
USD/mixed): fixed.model.ts:109-114trims first, then compares without case. - Reviewer 1, non-blocking (trim before the USD check): fixed by the same change.
- Reviewer 1, non-blocking (stale doc line on PR 1): passed on to PR 1. That doc is not in this PR. I accept this.
- Reviewer 2, non-blocking ("estimated dollars" text): left to #1118. I accept this. The text belongs to that PR.
Non-blocking
- The wire contract still lives only in this PR and in the author's reply. The reply says PR 1 must pin
currencywith a Go test on/api/cachestate. Please check that the test exists before PR 1 merges.
What I checked
- Last review: round 1, 87aa5ae, 2026-11-12T09:01:03Z
- New commits read: 1 (
f072a762fix(bob-statusbar): match the dashboard's rounding and any case of USD) - Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files)
- New items since my last review:
- Reviewer 1's round-1 review (09:01:24Z): I read it. Its points are listed above under "Earlier findings".
- The author's reply comment (09:04:51Z), items 1-7: I checked each against the diff. All are in the commit as described, or they belong to other PRs.
- The full diff
87aa5ae6..f072a762: 5 files, +27/-8. I also readformatSavedandformatAmountin full on the new head. - Traces on the new code:
currencyabsent →$." USD ",usd,Usd→$1.75."",null, a number or an object →unitis'', which is notUSD, notmixed, and failsUNIT→ tokens only. That is the same as round 1.Mixed,MIXED," mixed "→ tokens only.Bobcoinswith 1234.567 →1,235 Bobcoins. A negative value keeps its-sign, as the dashboard does.
toLocaleString('en-US')needs ICU. Node and the Electron extension host ship full ICU, so the separator is,.- Fail open: no new path can throw. A bad value only drops the money text.
- Commit has DCO sign-off and
Assisted-By. - I did not run
npm test. Live tests are not approved.
vz-ibm
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (claude, user of @vz-ibm) | Claude Code 2.1.316 | offload-review skill, @vz-ibm's session | resumed | 1 of 2 | 2 of 2 | f072a762888c |
approve |
Verdict: approve
Findings
None.
Status of round-1 points
- Reviewer 2, finding 1 (data-dependence row): fixed.
docs/data-dependence/features/bob-plugin.mdnow names the saved money and the unit name. The new line indocs/data-dependence.mdhas the same text as the row file. The Kind and the levels do not change, so no new sign-off is needed. I agree with reviewer 2 that I was wrong in round 1 when I said no row change was needed. - Wire contract (both reviewers): fixed on this side.
model.ts:109-114trims first, then comparesUSDandmixedwith no regard to case. The PR 1 side is out of this PR. The author says the PR 1 build now has the contract and must pin it with a Go test. I cannot check that here. - Trim before the USD check (mine): fixed by the same lines.
- Rounding of 1000 or more (both reviewers): fixed.
formatAmount(model.ts:121-126) now matchesusd()indash/ui/app.js:96-103. The new test checks that1234.567gives1,235 Bobcoins. - Status bar README line (reviewer 2): fixed. See the first non-blocking point.
- PR 1 doc line that goes stale (mine): the author passed it on to PR 1. I accept that.
- "Estimated dollars" text (reviewer 2): the author says #1118 fixes it. I accept that. #1118 is the PR that changes the prices.
Non-blocking
- The new README sentence comes before the behavior.
bob-plugin/context-guru/README.md:61-62says that withbob-ultrahighthe status bar shows1.75 Bobcoins. Until PR 1 ships thecurrencyfield, the status bar shows$1.75with the same preset. If this PR merges first, the README is wrong for that time. Merge after PR 1, or add "with a proxy from v0.7.4 or later". formatAmountusestoLocaleString('en-US'). The dashboard'snfisnew Intl.NumberFormat()with the user's locale (dash/ui/app.js:56). For a German locale, the dashboard shows1.235and the status bar shows1,235. This needs about 500M saved tokens, so it is rare.
What I checked
- Last review: round 1, 87aa5ae, 2026-11-12T09:01:24Z
- New commits read: 1 (
f072a762fix(bob-statusbar): match the dashboard's rounding and any case of USD) - Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files)
- New items since my last review:
- Commit
f072a762: I read all 5 files of the diff andformatSavedandformatAmountaround the change. - The author's comment at 09:04:51Z, "Round 1 replies", items 1 to 7: I checked each item against the diff. See "Status of round-1 points".
- Reviewer 2's round-1 review (09:01:03Z, posted before mine, which I did not read in round 1): I checked its finding and its 4 non-blocking points. All are fixed or answered.
- Commit
- Traces on the new code:
' USD ',usd,Usd→$1.75.Mixed,MIXED,' mixed '→ tokens only.currencyabsent →$, as before.- A non-string
currencygivesunit''. It fails the USD check and failsUNIT, so tokens only, as in round 1. 1234.567→1,235;-1500→-1,500;999.5→999.50.
- Fail open: no new path throws. A bad unit still gives tokens only.
- The commit has DCO sign-off and
Assisted-By. - I did not run
npm testorgo run ./cmd/gen-datadep. Live tests are not approved. The author reports 58 tests OK.
Raised by reviewer 1 of #1124 in round 2. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Vitaly Zabershinsky <[email protected]>
|
Round 2: both reviewers approve. The README now says the Bobcoin text needs a proxy from v0.7.4 or later (b8d3084). The locale point (a thousands separator for 500M+ saved tokens) is left as is. The PR 1 Go test that pins |
main changed the Bob plugin data-dependence row (#975, #1111). The row takes main's text, plus this PR's sentence on the status bar's money and unit. The page is rebuilt with gen-datadep. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Vitaly Zabershinsky <[email protected]>
Plugin versions for v0.7.4: - Claude Code plugin 0.7.3 -> 0.7.4 (#1096, #1135, #1174, #1177, #1199, #1216). - Codex plugin 0.2.12 -> 0.2.13 (#1115, #1135). - Pi package 0.1.1 -> 0.1.2 (#1113). - Bob plugin 0.1.1 -> 0.1.2 (#1093, #1111, #1118, #1124, #1126, #1127). The owner's Bob hold (#1221) covers release tests only. - OpenCode: PINNED_VERSION v0.7.3 -> v0.7.4 in opencode-plugin/index.js, its README, docs/how-to/install-opencode-plugin.md and 3 tests. Behavior change: the version numbers; the OpenCode plugin's first start downloads proxy v0.7.4. Release bumps are approved by the owner ("I approve version bumps"). Data dependence: none. Reviews: 2 offload review rounds (GLM): both approve at ab79001. After it: 1422093, a merge of main with no hand resolution (remerge-diff 0; approval-still-valid: SAME CHANGE). Signed-off-by: DAVID AMID <[email protected]> Assisted-By: Claude Opus 5.5 <[email protected]>
Summary
The Bob status bar shows Bob's savings in Bobcoins, the unit Bob bills in, not in dollars.
What changed
bob-plugin/statusbar/src/model.ts,formatSaved, reads the newcurrencyfield of/api/cachestate:USD: today's text,· $1.75;Bobcoins:· 1.75 Bobcoins. 2 decimals; 4 below 0.01;0for 0, as the dashboard does;mixed: tokens only;A unit name must be 1 to 16 ASCII letters after a trim, or the status bar shows tokens only. That also blocks the status bar's
$(icon)syntax. The stale comment ("Bob has none, so it never shows$") is fixed.Data dependence
None changed. The status bar reads one more field, a unit name, from the same reply.
How it was tested
npm testinbob-plugin/statusbar: 56 tests, OK.currency.Technical notes
saved_usd, even when they hold Bobcoins. A code comment says so. Renaming them would break every reader.currencyfield.