Commit graph

1884 commits

Author SHA1 Message Date
iamtoruk
a1cc32663f fix(mac): the Capacity Dock popover appears inside a full-screen space
Every window belongs to a set of spaces. The rail belongs to all of them;
the detail panel had been reduced to the desktop space alone, so hovering a
pill inside a full-screen app positioned the popover, faded it in and
ordered it front exactly as it does on the desktop, in a space the user was
not looking at. Measured on a running instance: the rail reported
spaces=[3, 63, 24, 137] with 137 active, the panel reported spaces=[3].

The membership is written once in init and never again. The window server
drops it across a display sleep or a display reconfiguration, and the rail
survives only because it is never ordered out. Re-assert it in showDetail,
the one funnel every presentation passes through. It has to be written, not
read and compared: assigning collectionBehavior is what re-registers the
window, and it must happen while the window is ordered out.

Also drop a duplicate `isFloatingPanel = true` that ran after the shielding
level was set. NSPanel.isFloatingPanel writes level = .floating, so the
second assignment silently discarded the level the comment above it asks
for: the dock measured at layer 3 instead of 2147483628, low enough for any
floating window to cover it. Both panels now report the shielding level.
2026-09-03 06:07:45 -07:00
Resham Joshi
3517f7c928
Merge pull request #1245 from getagentseal/fix/parity-idle-seconds
test(menubar): ignore idleSeconds in the payload parity check
2026-09-03 00:43:23 -07:00
iamtoruk
8c8783c442 test(menubar): ignore idleSeconds in the payload parity check
The parity test builds the payload twice over the same warm cache and
expects the two to match. Since liveSessions landed, each session
carries idleSeconds, whole seconds since its last activity, so two
builds that straddle a second boundary differ by one and the test
fails at random. Seen on the macOS runner. stableShape now zeroes it
the way it already blanks the generated stamp.
2026-09-02 23:18:21 -07:00
Resham Joshi
500412aa88
Merge pull request #1235 from avs-io/codex/provider-reconciliation-races
Some checks are pending
CI / semgrep (push) Waiting to run
macOS Menubar CI / test (push) Waiting to run
Tests / test (22) (push) Waiting to run
Tests / test (22.13.0) (push) Waiting to run
Tests / desktop (push) Waiting to run
Join provider refreshes and prevent scoped false zeros
2026-09-02 11:51:30 -07:00
Resham Joshi
3376d764e6
Merge pull request #1234 from avs-io/codex/provider-core-contract-repair
Repair provider usage and Hermes cost contracts
2026-09-02 11:50:56 -07:00
Resham Joshi
0cfcccc10f
Merge pull request #1241 from getagentseal/fix/1239-model-grouping
fix(models): group Trend rows and the models command by the same display name
2026-09-02 11:49:23 -07:00
Resham Joshi
5a3484c25d
Merge pull request #1240 from getagentseal/fix/wordmark-shimmer-vanish
fix(menubar): keep the wordmark filled under the shimmer and slow the sweep
2026-09-02 11:49:17 -07:00
iamtoruk
3b60b724fe fix(models): group Trend rows and the models command by the same display name (#1239) 2026-09-02 10:40:39 -07:00
iamtoruk
f0f0ed8874 fix(menubar): keep the wordmark filled under the shimmer and slow the sweep
The letters were only visible through the animated gradient's mask, so any
frame where the mask or gradient was not laid out yet blanked the name at
random. The text now carries a static flame fill under the sweep, which can
only brighten it, and the sweep runs 4 s each way instead of 1.5 s.
2026-09-02 10:34:11 -07:00
iamtoruk
034ae444d0 test(menubar): pin every ProviderFilter case to a real CLI provider id
ProviderFilter.cliArg is both the --provider argument and the id the
payload-consistency guard matches against providerDetails. A case whose cliArg
is not a registry name silently disables that guard for its tab: the lookup
finds no detail row, so no contradiction is ever detected. Nothing in either
language can see both sides, so the contract is checked from the TypeScript
side, where the registry is importable and the Swift source is readable.

Table-driven over all 30 enum cases. No mapping needed fixing: .kimiCode
already yields `kimicode`, which is the registry name (`kimi-code` is not a
provider the CLI knows), and every other case resolves too. Setting .kimiCode
to `kimi-code` makes this suite fail, which is the check working.
2026-09-02 07:55:54 -07:00
iamtoruk
58c6cce6db fix(menubar): the selection fallback showed another provider's totals under the selected tab
Switching providers stashed the outgoing payload and rendered it under the new
tab until that tab's own fetch landed. That is not continuity, it is a wrong
number: opening the Hermes tab printed the all-provider total, and the test
suite pinned that behaviour by asserting $12 under Hermes and $12.34 under
Cursor.

The fallback is gone. With no cached data for the selection, `payload` is
empty, `hasCachedData` is false, and the popover renders the loading state it
already has for a cold key, so no dollar figure is shown for a provider whose
data has not arrived. AgentTabStrip and MenuBarContent take the same
hasCachedData gate for the same reason.
2026-09-02 07:55:43 -07:00
iamtoruk
cd7de30bc4 fix(menubar): a twice-contradicting scoped payload threw instead of being served
When a scoped payload disagreed with its all-provider slice, the code re-ran
the fetch bypassing the resident child and, if it STILL disagreed, threw. That
verified payload is what the CLI actually reports for the provider, so
throwing traded a real number for an error banner and left the tab with
nothing at all.

The payload is now cached with a contradictsAll flag on CachedPayload
(add-only) and served, and the popover carries one subdued secondary line
saying the total may be incomplete. The refresh paths treat an
already-verified contradiction as usable, so a poll cannot re-run the one-shot
parse forever.
2026-09-02 07:54:55 -07:00
iamtoruk
68f6d1ced3 fix(menubar): the all-provider and scoped fetches were serialized on every tab click
To guarantee the all-provider slice was cached before a scoped result could be
accepted, the code simply awaited the all-provider fetch BEFORE starting the
scoped one. That is two full parses back to back on every tab click, and the
ordering it bought is only needed at acceptance time, not at start time.

Both fetches now start together. fetchPayload awaits the all-provider task
after its own fetch has already returned and before the consistency check
reads it, so the evidence is still present when the scoped result is judged.

The resident-bypassing cold fetch was already conditional on a contradiction
actually being detected; it is unchanged.
2026-09-02 07:54:03 -07:00
iamtoruk
6eab24960c fix(menubar): an evicted in-flight fetch cleared its successor's slot
inFlightKeys held only a timestamp, so the slot had no notion of WHICH fetch
owned it. The watchdog and the display-sleep reset both evict an occupant, and
a later fetch then legitimately claims the same key. When the evicted fetch
finally returned, its defer cleared the new owner's slot and resumed every
task parked on it, so a waiter woke on an empty cache and reported failure
while the real fetch was still running.

The slot now carries a token. A fetch releases it only if it still owns it;
the watchdog and the resets take an explicit force path, because they are
declaring the slot dead rather than reporting a fetch that ended.
2026-09-02 07:53:03 -07:00
iamtoruk
216ead74ae fix(menubar): refresh(key:) reported failure instead of joining an in-flight fetch
The interactive refresh path bailed with false whenever the key was already
being fetched. recoverFromStuckLoading() reads that return value, so a healthy
fetch that was simply still running was announced as a failed recovery, and a
second interactive refresh threw away a result that was moments from landing.

Join the in-flight fetch and report on its outcome, which is what the quiet
path already did.

Adds a DataClient fetch hook under DEBUG: slot ownership and acceptance
ordering are only observable when two REAL fetches overlap, which needs a
fetch whose completion the test controls rather than a spawned CLI.
2026-09-02 07:52:18 -07:00
iamtoruk
b0ee9cc7d4 Merge branch 'wt1234' into wt1235 2026-09-02 07:33:03 -07:00
iamtoruk
a8bddef84e fix(hermes): superseded v1 ledger file was left on disk forever
The loader reads only the v3 path, so a hermes-session-ledger.v1.json from an
earlier install sat in the cache dir unread and undeleted. It is dead weight
that can only mislead: the parse-version bump forces a cold re-parse that
rebuilds every cursor from source, so nothing in it is recoverable. Unlink it
when the v3 file is absent.

The v2 test this replaces was vacuous. It wrote a v2 file and asserted the
ledger was empty, but the loader never looks at a v2 path, so it passed
whatever the code did. The replacement uses a real v1 fixture and asserts both
halves: the ledger loads empty AND the v1 file is gone afterwards.
2026-09-02 07:32:02 -07:00
iamtoruk
9c432bb105 fix(menubar,app): absent hasUsage hid every provider with no period spend
hasUsage is a new payload field, so every RELEASED CLI omits it. Both decoders
treated the absent case as "derive from cost", which is the strict reading of
a field that is not there: a provider with $0 spend in the period vanished
from the picker even though the user has it and is actively using it on an
included subscription.

Absent now means visible on both surfaces. The strict signal still applies
wherever the CLI actually emits the field, so an explicit false still hides an
idle discovery row. Settings.tsx carried the same fallback and is fixed with
it.
2026-09-02 07:32:02 -07:00
iamtoruk
3e48f8d073 fix(aggregator): overlayProviderDaySlices overwrote settled cache days with shrunken parses
The provider-scoped overlay blind-set a fresh slice for every date it could
produce one. A settled day's sources age off disk continuously, so that fresh
slice is a lower bound, not a correction, and the overlay replaced finalized
cache days with whatever the surviving files still explained. It ran over the
whole period and over the whole history, so the scoped view could report a
fraction of the same day the all-provider view served off the same cache.

The overlay now routes through mergeDayEntries with guardPartialSurvival:
fresh may FILL a (date, provider) the cache lacks and still wins inside the
settle window, but it can no longer SHRINK a settled day the cache already
holds. Filling has to keep working, because on a cold cache the scoped parse
is the only source a historical day has.

Measured on this machine over 2026-08-03..2026-09-01, comparing scoped
--provider claude against the claude slice of the unscoped run:

  before  $16649.42 / 81812 calls   (short by $291.70 and 2507 calls)
  after   $16941.12 / 84319 calls   (exact match, both fields)
2026-09-02 07:32:02 -07:00
iamtoruk
a8a3031b58 fix(cache): DAILY_CACHE_VERSION 30 collides with open PR #1132
Two open branches claim daily-cache version 30, so a v30 file on disk carries
unknown accounting. Bump this branch to 31 and move the Hermes
pending-rederive contract version with it, so a v30 file written under #1132's
accounting is treated as a foreign prior version: carried forward per slice,
never adopted as the finalized base.

The #946 copilot fixture seeded itself at DAILY_CACHE_VERSION - 5, a moving
target that crossed the copilot contract boundary (26) at this bump and
silently stopped granting the entitlement those tests exist to check. Pinned
to 25, which is the fixed historical version the fixture actually means.

Disclosure: the bump re-derives every day whose sources still survive, so
finalized history shifts. On the reviewer's machine Claude moved -0.78
percent. That is a corrected figure replacing a stale cached one, not a loss,
but it is a visible change to numbers users have already seen.
2026-09-02 07:32:02 -07:00
iamtoruk
6fa5dfbeb7 Merge remote-tracking branch 'origin/main' into wt1234 2026-09-02 07:06:47 -07:00
Resham Joshi
a5609728a2
Merge pull request #1236 from avs-io/codex/release-build-hermeticity
Make release builds hermetic
2026-09-02 07:05:15 -07:00
Aditya Vikram Singh
c9c5bc00f8 join provider evidence refreshes 2026-09-02 19:16:08 +05:30
Aditya Vikram Singh
5ef7387a33 close provider reconciliation races 2026-09-02 19:16:08 +05:30
Aditya Vikram Singh
e9a55bb2f8 prevent provider-scoped false zeros 2026-09-02 19:16:08 +05:30
Aditya Vikram Singh
0455250526 derive versioned Claude family labels 2026-09-02 19:15:57 +05:30
Resham Joshi
27fdffa790
Merge pull request #1238 from getagentseal/ci/upgrade-path-live-sessions
ci(upgrade-path): drop liveSessions from the worker-parity comparison
2026-09-02 06:29:37 -07:00
iamtoruk
f223a64bb7 test(mac): compare the pill fade start with a tolerance
100/112 is not exactly representable; the CI runner rounds the last bit
differently from the dev machine and the equality failed on main.
2026-09-02 06:24:28 -07:00
iamtoruk
91a11cb89e ci(upgrade-path): drop liveSessions from the worker-parity comparison
The block is a wall-clock snapshot (idleSeconds, lastActivityAt), not a parse product, so serial and parallel runs legitimately differ there; same treatment the parse-workers unit test already applies.
2026-09-02 06:13:50 -07:00
Resham Joshi
2f00f9fb13
Merge pull request #1237 from getagentseal/feat/dock-popover-glance
feat(dock): glance popover with sessions, today and quota windows
2026-09-02 06:12:47 -07:00
iamtoruk
53c5c7b370 feat(dock): glance popover with hero window, sessions and today strip
The Capacity Dock hover panel becomes a glance: a provider header, the
sessions running right now as pills with their context rings, a Today
strip, and a row of quota-window percentages, separated by hairlines.
Window percentages stay plain text until 70 percent so a healthy row
reads as text rather than a wall of colour. The panel stays 350pt wide;
every block height is a whole point and is summed into the panel frame,
since the hosting view does not size itself.

Running sessions are new CLI surface. `liveSessions` is add-only on the
menubar payload: sessions whose transcript was appended inside a 120s
window, carrying the branch, the model that answered last, and the
context that turn reported. Absence means "unknown", so the section
hides rather than claiming nothing is running. The block names projects
and branches, so sharing and MCP output strip it.

Today's totals needed no CLI change; the app simply was not decoding the
cache token counts the payload already carried.
2026-09-02 06:09:06 -07:00
Aditya Vikram Singh
279a6983e3 make upgrade cache discovery version agnostic 2026-09-02 16:44:51 +05:30
Aditya Vikram Singh
4bebc37f2c repair Hermes ledger migration fidelity 2026-09-02 16:18:05 +05:30
Aditya Vikram Singh
38e6e19f29 harden provider period and cache contracts 2026-09-02 16:18:05 +05:30
Aditya Vikram Singh
15ad054ea0 fix release build hermeticity 2026-09-02 16:17:28 +05:30
Aditya Vikram Singh
7106db2c0e fix menubar provider usage contracts 2026-09-02 16:17:28 +05:30
Resham Joshi
41f44edc7f
Merge pull request #1224 from getagentseal/ci/snap-upload-manual-review
Some checks failed
CI / semgrep (push) Has been cancelled
macOS Menubar CI / test (push) Has been cancelled
Tests / test (22) (push) Has been cancelled
Tests / test (22.13.0) (push) Has been cancelled
Tests / desktop (push) Has been cancelled
Windows Menubar CI / check (ubuntu-latest) (push) Has been cancelled
Windows Menubar CI / check (windows-latest) (push) Has been cancelled
ci(snap): treat the store's manual-review queue as a successful upload
2026-09-01 10:25:10 -07:00
iamtoruk
cad365610b ci(snap): treat the store's manual-review queue as a successful upload 2026-09-01 10:18:22 -07:00
Resham Joshi
cacc4e797d
Merge pull request #1223 from getagentseal/snap/narrow-session-grants
snap: narrow session-log grants to what the parsers read and drop the Copilot credential root
2026-09-01 10:02:37 -07:00
iamtoruk
a5289c2731 snap: narrow session-log grants to what the parsers read and drop the Copilot credential root 2026-09-01 09:56:03 -07:00
Resham Joshi
10f5564cc5
Merge pull request #1222 from avs-io/codex/grok-provider
feat(menubar): add native Grok Build quota provider
2026-09-01 06:54:42 -07:00
Aditya Vikram Singh
3664152d37 feat(mac): add native Grok Build provider 2026-09-01 18:46:02 +05:30
Resham Joshi
7d5bcd4d9a
Merge pull request #1216 from MiguelMachado-dev/fix/budget-test-future-timestamp
test(budget): seed current-month spend in the past, not at noon UTC
2026-09-01 05:11:26 -07:00
iamtoruk
56c34f7512 test(budget): compute the month start in UTC to match the CLI child
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.
2026-09-01 05:11:00 -07:00
Resham Joshi
043ffd4822
Merge pull request #1214 from MiguelMachado-dev/feat/zero-cost-provider-visibility
feat(menubar): keep token-only and flat-rate providers visible in agent tabs
2026-09-01 05:08:32 -07:00
Resham Joshi
eae2b95fdf
Merge pull request #1213 from MiguelMachado-dev/fix/hermes-recorded-cost-fallback
fix(hermes): don't trust a $0 estimated cost — calculate from tokens
2026-09-01 05:07:30 -07:00
iamtoruk
12b20a2900 fix(app): let the Providers pane read hasUsage so token-only providers stay listed
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.
2026-09-01 05:07:05 -07:00
iamtoruk
2620cbb2bc fix(hermes): bump the parse version so cached zero-estimate sessions re-cost
The cost rule changed, so sessions whose state.db fingerprint has not
moved must be re-parsed or they keep serving the stale placeholder zero.
2026-09-01 05:06:20 -07:00
Resham Joshi
fecbcd6e1c
Merge pull request #1212 from MiguelMachado-dev/fix/menubar-presence-deadlock
fix(mac): avoid provider presence deadlock
2026-09-01 04:58:38 -07:00
iamtoruk
c436787239 fix(mac): document the main-queue serialization and harden the deadlock test cleanup
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.
2026-09-01 04:58:16 -07:00