Skip to content

feat(bob-statusbar): show Bob's savings in Bobcoins, not dollars - #1124

Merged
amiddavid merged 4 commits into
mainfrom
feat/bob-statusbar-bobcoins
Nov 17, 2026
Merged

amiddavid merged 4 commits into
mainfrom
feat/bob-statusbar-bobcoins

Conversation

@vz-ibm

@vz-ibm vz-ibm commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

Behavior change for the Bob status bar. Approved by the repo owner, @vz-ibm, on 2026-11-12 (design option A).

  • Who: Bob users with a proxy that sends the new currency field (the Bobcoin display, PR 1, in progress), and a preset that prices Bob (bob-ultrahigh).
  • Old: saved 3.1k tok · $1.75, although the number is Bobcoins under bob-ultrahigh (fix(bob-plugin): price Bob in Bobcoins, output at the input rate #1118).
  • New: saved 3.1k tok · 1.75 Bobcoins. With today's proxy (no currency field) nothing changes.
  • Turn it off: none needed; a proxy without the field gives today's text.

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 new currency field of /api/cachestate:

  • absent (an old proxy) or USD: today's text, · $1.75;
  • a unit name, for example Bobcoins: · 1.75 Bobcoins. 2 decimals; 4 below 0.01; 0 for 0, as the dashboard does;
  • mixed: tokens only;
  • not priced: tokens only, as today.

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 test in bob-plugin/statusbar: 56 tests, OK.
  • 8 new tests. 6 were red first. The other 2 pin today's text: USD or no field, and not priced.
  • Unit tests only. Not tried in a real Bob IDE yet, because no released proxy sends currency.

Technical notes

  • The money fields are still named saved_usd, even when they hold Bobcoins. A code comment says so. Renaming them would break every reader.
  • The design is option A in the team's Bobcoin display design: the price file names its unit, and the proxy carries it. PR 1 (the proxy and the dashboard) adds the currency field.

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 vz-ibm left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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

  1. 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.md says 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 read priced and the saved money (money.*.saved_usd), and the row did not list those either.
    • Proof: git diff cd82e95a..HEAD --stat shows only bob-plugin/statusbar/src/model.ts and its test. model.ts:30-32 adds currency. model.ts:106-116 reads priced, money and currency. The PR body says "Data dependence: None changed", which is right for the Kind (still metadata), but the row text is now incomplete.
    • Fix: In the row, add "the saved money and its unit name (USD, Bobcoins or mixed), from the price configuration, not from customer data". Run go run ./cmd/gen-datadep. The Kind and the levels do not change, so no new "Decided by" sign-off is needed.

Non-blocking

  • bob-plugin/context-guru/README.md:60-61 says the status bar "reads only counts and times". It also shows money, and now a unit name. Consider one line: "With bob-ultrahigh it also shows the saved Bobcoins."
  • model.ts:118 says "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 shows 1234.56 Bobcoins where the dashboard shows 1,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 currency contract comes from a proxy PR ("PR 1") that is not in the repo yet. No Go code sends currency today (grep -rn currency --include=*.go finds nothing relevant). So the new branches run only in unit tests. If PR 1 sends a different case, for example usd or Mixed, the status bar shows 1.75 usd or 1.75 Mixed, not $1.75 or tokens only. Please check the exact strings against PR 1 before both merge, or compare case-insensitively.
  • bob-plugin/context-guru/README.md:131-133 and skills/status/SKILL.md:34-35 still 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.
  • formatSaved traces:
    • currency absent or USD → $ and 2 decimals, the same as before. The old test at model.test.ts:87 still 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, null or an object → tokens only. UNIT (^[A-Za-z]{1,16}$, no m flag) blocks the VS Code $(icon) syntax and newlines after the trim.
    • priced not true → tokens only, as before.
  • client.ts:103-105 passes the whole /api/cachestate object through as CacheState, so currency reaches formatSaved with no client change. currency: unknown makes the type check force the typeof guard.
  • Fail open: a bad or missing currency never 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 vz-ibm left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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 main sends currency on /api/cachestate (dash/cachestate.go:17-65 has no such field). The values "USD" and "mixed" are defined only by this PR. The local branch feat/price-currency (PR 1) adds Price.Currency in internal/modelinfo, but not the wire field yet. Before PR 1 merges, check that it sends exactly:
    • the key currency at the top level of the reply, not inside money or per thread;
    • "USD" for dollars, never "". This PR shows tokens only for "" (test at model.test.ts:130). So if PR 1 sends "" for USD, every priced Claude-on-Bob user loses the $ figure;
    • the literal "mixed", lowercase. "Mixed" passes UNIT and shows 1.75 Mixed.
      A shared fixture or one Go test that pins the JSON key and values would stop drift.
  • model.ts:109 compares 'USD' before the trim. " USD " trims to USD, passes UNIT, and shows 1.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.
  • formatAmount is not quite "the dashboard's rule". dash/ui/app.js:96-103 also rounds values of 1000 or more to whole numbers with a thousands separator. The status bar shows 1234.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-currency branch 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) and test/model.test.ts (+62). One commit, with DCO sign-off and Assisted-By.
  • formatSaved paths: 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. The render test 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-105 passes the whole reply as CacheState, so a new top-level field reaches formatSaved with 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 currency falls 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]>
@vz-ibm

vz-ibm commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator Author

Round 1 replies. Fixed in f072a76:

  1. The data-dependence row does not list what the status bar reads (reviewer 2): fixed. The Bob plugin row now says that, with a preset that prices Bob, the status bar also reads the session's saved money and its unit name (USD, Bobcoins or mixed), from the price configuration, not from customer data. The page is rebuilt (go run ./cmd/gen-datadep); go test ./components/all/ OK. The kind and the levels do not change.
  2. The wire contract (both reviewers): fixed on both sides.
    • The PR 1 build now has the exact contract: currency at the top level of each money reply; "USD" for dollars, never ""; "mixed" in lower case. It must pin this with a Go test on /api/cachestate.
    • This PR now reads USD and mixed in any case, after a trim, so a change of case cannot break the text. New test: " USD ", usd and Usd give $1.75; Mixed, MIXED and " mixed " give tokens only. Red first (1.75 USD).
  3. The trim before the USD check (reviewer 1): fixed by item 2.
  4. The rounding rule (both reviewers): fixed. An amount of 1000 or more is a whole number with a thousands separator, as usd() in dash/ui/app.js does. New test: 1234.567 gives 1,235 Bobcoins. Red first (1234.57 Bobcoins).
  5. The README (reviewer 2): fixed. The status bar paragraph says that with bob-ultrahigh it also shows the saved Bobcoins.
  6. A PR 1 doc line that would go stale (reviewer 1): passed on to the PR 1 build.
  7. The README and skill text on "estimated dollars" (reviewer 2): that is fix(bob-plugin): price Bob in Bobcoins, output at the input rate #1118, which fixes it.

Checks: npm test in bob-plugin/statusbar: 58 tests, OK.

@vz-ibm vz-ibm left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.md now names the saved money and its unit name, from the price configuration. The generated row in docs/data-dependence.md:249 has 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-62 now says the bar shows the saved Bobcoins with bob-ultrahigh.
  • Both reviewers, non-blocking (rounding at 1000 or more): fixed. model.ts:124 gives 1,235, the same as usd() in dash/ui/app.js:102. At 999.996 both give 1000.00, so the edges also agree.
  • Both reviewers, non-blocking (case of USD/mixed): fixed. model.ts:109-114 trims 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 currency with 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 (f072a762 fix(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 read formatSaved and formatAmount in full on the new head.
  • Traces on the new code:
    • currency absent → $. " USD ", usd, Usd → $1.75.
    • "", null, a number or an object → unit is '', which is not USD, not mixed, and fails UNIT → tokens only. That is the same as round 1.
    • Mixed, MIXED, " mixed " → tokens only.
    • Bobcoins with 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 vz-ibm left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.md now names the saved money and the unit name. The new line in docs/data-dependence.md has 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-114 trims first, then compares USD and mixed with 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 matches usd() in dash/ui/app.js:96-103. The new test checks that 1234.567 gives 1,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-62 says that with bob-ultrahigh the status bar shows 1.75 Bobcoins. Until PR 1 ships the currency field, the status bar shows $1.75 with 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".
  • formatAmount uses toLocaleString('en-US'). The dashboard's nf is new Intl.NumberFormat() with the user's locale (dash/ui/app.js:56). For a German locale, the dashboard shows 1.235 and the status bar shows 1,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 (f072a762 fix(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 and formatSaved and formatAmount around 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.
  • Traces on the new code:
    • ' USD ', usd, Usd → $1.75.
    • Mixed, MIXED, ' mixed ' → tokens only.
    • currency absent → $, as before.
    • A non-string currency gives unit ''. It fails the USD check and fails UNIT, 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 test or go 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]>
@vz-ibm

vz-ibm commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator Author

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 currency will be checked before PR 1 merges. The review budget (2 rounds) is used.

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]>
@amiddavid
amiddavid merged commit 642988c into main Nov 17, 2026
9 checks passed
@github-project-automation github-project-automation Bot moved this from New/ToDo to Done in Rossoctl Issue Prioritization Nov 17, 2026
amiddavid added a commit that referenced this pull request Nov 19, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants