The strip was a fixed seven, so a machine running Gemini, Kimi or any of the
other two dozen tools the CLI reports had no way to filter by them. It now
mirrors AgentTabStrip.swift: All first, then every provider the payload says
has activity, dearest first, with the provider's brand mark from the mac's
ProviderFilter.color and the compact cost chip. Provider ids come straight
from the payload, which is what --provider takes, so any tool the CLI grows
appears without a change here.
The known-tool list stays as the fallback for a machine the CLI has not seen
activity on, dimmed and explaining itself on hover, because that copy is the
first-run answer to "what is CodeBurn watching".
Overflow chevrons select the neighbouring tab, as on the mac, rather than
scrolling blindly; both measurements are taken from elements the chevrons do
not resize, so showing them cannot feed back into the overflow decision.
Ported from the menubar's ZaiSubscriptionService, so the Windows Capacity
Dock and the settings pane can read Z.ai capacity from the CLI the same way
the Mac reads it natively.
Credential order mirrors the menubar: a key the user supplied first (a
Keychain entry there, ZAI_API_KEY here), then the Z.ai login the Pi CLI
already keeps in ~/.pi/agent/auth.json. The key is used for one request and
never written anywhere.
Z.ai answers HTTP 200 with an authentication code in the body, so the decoder
reports that as a rejection rather than as an unreadable response, and it
keeps reading the older string-typed limit fields.
Ported from the menubar's CursorSubscriptionService so every surface that
reads the CLI, the Windows Capacity Dock included, sees the same Cursor
capacity the Mac shows.
The adapter opens Cursor's own VS Code state database read-only for the
`cursorAuth/accessToken` row, rebuilds the web session cookie from the user
id inside that JWT, and asks cursor.com for the usage summary. It never
refreshes the session and never writes: an expired token is terminal until
the user signs in to Cursor again, and a database Cursor is busy writing is
transient rather than a signed-out user.
Windows layouts are covered too: the database follows the VS Code convention
of each platform, so Windows reads it from AppData\Roaming.
The quota adapter only ever looked at ~/.config/github-copilot. Windows has
no such directory: the editor plugins write hosts.json and apps.json under
%LOCALAPPDATA%\github-copilot, so every signed-in Windows user was reported
as not connected and the Capacity Dock had nothing to show for Copilot.
The credential paths become an ordered list of directories resolved per
platform, and per call rather than at import, so the environment the paths
come from can still be changed by the caller. The XDG directory stays as a
second candidate on Windows for a token that arrived through a POSIX-style
shell home.
Dropping the rail in the top-right corner left a horizontal rail whose ring sat
at its far left: the rows container kept the stylesheet's left and right of 0,
so an end-anchored horizontal rail only ever set its right and the row slid to
the start. Both orientations now set all four offsets explicitly, and the
stylesheet no longer pins the container.
While dragging, the flare followed the attachment progress of whichever edge
was nearest, so a vertical rail approaching the top wore a right-edge flare in
open space. The flare now only follows an edge of the rail's own orientation;
a perpendicular edge shows the loose pill until the drop, and the settle glide
runs from centre to centre so a change of orientation does not jump.
Adds a corner test and logs the layout inputs in debug builds.
Hovering used to move and resize the dock window, and WebView2 presents one
stale frame at every window change, which read as the rail drifting and
glitching. One transparent window is now sized once per placement for the
fully expanded rail plus the bubble's reach and never moves on hover. A 60 Hz
cursor poll, the counterpart of the mac's global event monitor, makes the
window click-through everywhere but the painted shapes, synthesizes hover for
the page, and drives dragging.
Drag follows CapacityDockController: the page owns the 3 px threshold and
passes the press point, Rust keeps the rail under the pointer, morphs the
flare away as it leaves an edge, and on release snaps to any edge within
44 px or leaves the rail floating, then hands the page the old rail rect so
it glides into place with the mac's attach and detach curves. Placement
(docked edge, orientation, normalized offsets) persists in windows-dock.json.
Top and bottom give a horizontal rail with the bubble below or above; a
floating rail keeps its orientation and puts the bubble where there is room.
The context menu gains Dock to Edge with all four edges.
The layout stays a pure function with unit tests, and every window metric
stays a whole pixel. windows-sys gains one feature flag for the cursor and
button reads; no versions change.
The Windows dock now mirrors CapacityDockView.swift at the mac's 0.6 default
scale: the graphite gradient surface with the concave edge flare, a provider
glyph inside a recessed ring, severity colours (green, yellow from 50, orange
from 75, red from 90) on ring, percent and bars, warm off-white text, and the
tailed detail bubble with the mac typography. This also settles the open
severity-colour question in favour of the mac behaviour.
Interaction follows CapacityDockController and CapacityDockInteractionState:
the resting rail shows the preferred provider; hovering expands it after 80 ms
and collapses 180 ms after leaving; hovering a row shows its bubble after
180 ms and dismisses it 240 ms after the row unless the pointer is on the
bubble; clicking a row pins the rail and makes that provider the preferred
one, persisted in windows-dock.json; Escape dismisses; right-click opens a
native menu with Refresh and Hide Capacity Dock.
One transparent window hosts both rail and bubble. dock.rs owns the geometry
as a pure layout function with unit tests, applies size and position in a
single SetWindowPos so the rail never flashes between two updates, and
returns window-relative frames the page paints into after measuring the
bubble's natural height. Every window metric stays a whole pixel.
Out of scope for v1, as before: dragging, edge choice and scale.
The invisible Capacity Dock was not a rendering bug. The debug exe had been
started through the QEMU guest agent's guest-exec, which runs as a service in
session 0, so the dock window was created on a window station that no desktop
shows. The stderr trace ("window created and shown") was accurate; the window
was simply never visible. Launched from the interactive session, the same
binary docks the rail at the right edge, shows the quiet "--" row without
providers, expands on hover, closes on toggle off and comes back on toggle on.
Debug builds on Windows now check the process window station for WSF_VISIBLE
at startup and print a warning when it is missing, so the next service session
launch explains itself. Verified: fires under a SYSTEM scheduled task, silent
from a terminal. Only a feature flag is added to the existing windows-sys
dependency; no versions change.
A slim always-on-top rail on the right screen edge showing one capacity ring
per signed-in provider, the Windows twin of the macOS Capacity Dock.
The window is created on demand and closed when the dock is switched off, so
a disabled dock leaves no webview resident. Hovering widens the same window
to reveal a detail panel with each quota window, its used percent, plan and
reset countdown; the panel unmounts on collapse rather than lingering hidden.
Data comes from `codeburn quota --format json` through the existing cli.rs
spawn plumbing. A CLI without that subcommand exits with `unknown command`,
which the rail reports as a quiet update-needed state instead of an error.
Metrics are the mac dock's whole-point values at its default 0.6 scale.
Quit CodeBurn in the tray menu called app.exit(0), but ExitRequested
was unconditionally prevented in the run loop, so the process never
actually exited. Only prevent exit when code is None (the popover
window closing on its own), letting an explicit app.exit(..) through.
Launching the menubar app twice left two processes running, each
registering its own flame + spend-badge tray icon pair, so the
notification area showed four icons for one app. Add
tauri-plugin-single-instance, registered first in the builder chain,
so a second launch just refocuses the running instance's popover.
The fixture clamped to a local-time month start while the child is pinned
to TZ=UTC, so the clamp only worked at offset zero and the flake survived
the first minutes of each month everywhere else.
The Electron Settings pane still filtered on cost, the exact gap this
change exists to close; it now reads the hasUsage field the payload
carries, falling back to cost for older CLIs.
The lock no longer covers the defaults write, so the main-queue hop is
what keeps the read-modify-write atomic; say so where the next reader
would be tempted to make it async. The regression test now cleans up its
observer and defaults domain on every exit and waits up to 5 seconds, so
a loaded runner cannot fake a deadlock.
currentMonthTimestamp seeded at today 12:00 UTC, which is in the future
for the 12 hours before it. Rows timestamped in the future don't surface
in the overview, so every CI run between 00:00 and 12:00 UTC failed
'keeps overview budget lines only on unfiltered overviews' with
'No usage found'.
Seed five minutes back, pinned to month start on the 1st so the row
can't slip into the previous month.
Agent tabs filtered strictly on cost > 0, so a provider whose sessions
carry tokens but no recorded dollar cost (Hermes on a flat subscription,
free-tier models, unpriced models) vanished from the strip entirely.
The menubar payload now carries an activity signal per provider, and the
strip keys visibility off it: providers with real usage stay listed, while
providers merely discovered on disk stay hidden. Older payloads without
the signal keep the previous detected-provider behavior.
Applies consistently across the mac menubar, the Electron renderer, and
the Windows payload types.
Hermes writes estimated_cost_usd = 0.0 (not NULL) when cost_status is
'unknown' (no pricing data) or 'included' (flat subscription, e.g. Codex
plan). resolveHermesCost treated any non-null estimate as a recorded
amount, so every subscription-backed Hermes session reported $0.00 with
real token counts underneath.
Only trust positive estimates now; $0 falls through to the token-based
calculateCost. An explicit $0 actual_cost_usd (a real invoice amount)
still wins, and genuinely free models still land on $0 since litellm
prices them at 0.
A background credential read held the provider-presence lock while UserDefaults synchronously notified SwiftUI. SwiftUI could re-read presence while holding its own update lock, leaving each thread waiting on the other. Serialize presence writes on the main queue and release the presence lock before publishing defaults changes.
At any scale except 100% the dock's dimensions were fractional (85% of 88
is 74.8), so SwiftUI's fitted content never agreed with the pixel-aligned
panel frame and the hosting view re-laid itself out at display cadence
forever: 5 to 7 percent idle CPU and hundreds of wakeups a second once
quota data existed, on every release since the dock shipped. Measured on
the same machine: 60% and 85% scale held 5 to 6 percent for an hour;
100% scale idled at 0.1 to 0.2 percent. Rounding every scaled metric to a
whole point makes all scales behave like 100%.
The status-item popover's hosting view is created once and lives for the
app's lifetime, and the flame wordmark inside it ran a repeat-forever
shimmer, so SwiftUI re-rendered the closed popover at display cadence
continuously: 5 to 7 percent idle CPU and roughly 650 wakeups a second
(Activity Monitor showed a 12-hour energy figure near two thirds of
Chrome's). The wordmark sweep and the loading flame pulse now start and
stop with popover visibility via a store flag set by the popover
delegate.