Commit graph

226 commits

Author SHA1 Message Date
iamtoruk
9e2f140c91 fix(windows): a second launch no longer hangs the tray app or its callers
The single-instance plugin hands a second launch over with a synchronous
SendMessage, so that launch sits inside it until the running app's callback
returns. When the message landed while the first launch was still in setup,
the callback showed the dock from inside a nested message pump, waited on an
event loop that was not running yet, and never returned; every launch after
it, the desktop app's --quit included, blocked behind the same message and
piled up as processes with no windows.

The callback now only records the request and carries it out from the event
loop. The desktop companion also waits, briefly, for a quit it has just sent
to finish before starting the tray app again, because a launch that arrives
while the old process is still going hands its request to that process and
exits with it.
2026-09-02 10:01:57 -07:00
iamtoruk
35f3c14977 feat(app): Plugins says what it is doing on Windows
The plugin runtime has not shipped for Windows, so `codeburn plugin list` never
answers there and the section sat on "Loading plugins..." for as long as the app
was open. A spinner that will never stop is worse than a sentence.

Windows now gets a panel instead: the section's own glyph, one line saying
plugins are coming, and one saying they arrive in a later Windows release and
work today elsewhere. It loads nothing, and the check happens in a dispatcher
above the loader rather than inside it, so the loader's hooks never mount and
there is no CLI call, no spinner and no timer to unwind. Every other platform
renders exactly what it did.
2026-09-02 07:03:23 -07:00
iamtoruk
4113ae30e0 fix(quota): Antigravity looks for its language server the Windows way
The desktop app's stderr on the VM carried "Antigravity quota unavailable:
Command failed: ps -ax -o pid=,command=" with "ps: unknown option -- x" on every
quota poll. Windows has no ps, and asking for one is a spawn failure rather than
an answer, so the provider reported a transient failure with a warning behind it
instead of simply not being there.

Win32_Process is the same listing by another name, and it is already how
src/providers/antigravity.ts finds these servers, so the quota adapter asks the
same way: PowerShell by absolute System32 path, argv only, no shell string, and
the Where-Object is a prefilter rather than the decision, which classifyProcessLine
still makes. There is no lsof either, so a pid's listening ports come from
netstat -ano; its state column is localized, so it is not matched on, and a row
that turns out not to be listening only costs one refused probe.

The guard this replaces was `win32 && !deps.execFile`, which the desktop app
defeated by injecting execFile, and which its own copy of the adapter never had
at all. Both copies now carry the same code, and the platform is injected so
either branch can be tested from either OS.
2026-09-02 07:00:22 -07:00
iamtoruk
94a5fcd0ab feat(app): Menu bar and Capacity Dock panes in Settings
The tray app has a settings window of its own, and nobody should have to find it
to change how the thing in their notification area behaves. Two panes join the
Settings rail: Menu bar and Capacity Dock.

Only the settings the desktop app does not already have are there. Currency, the
period, the scope and the daily budget are shared through the CLI config and
already live in General, and repeating them would be two controls for one value.
So Menu bar carries the tray figure's metric and period, the accent, whether
today's figure gets its own tray icon, the two refresh cadences, the terminal and
launch at login; Capacity Dock carries show, resting provider, size, appearance,
gauge shape and the per-provider switches.

Each pane appears only while its switch in the sidebar corner is on: there is
nothing to configure about a tray app that is not running, and the rail is one of
its windows. A pane whose switch has just gone off cannot stay on screen either,
so the rail falls back to General.

Two things the rail's own rules are worth restating here. The last connected
provider cannot be switched off, because the rail must never have nothing to
show. And a provider stays in the list after its connection drops, so one that
has stopped working can still be taken off.

Every control renders what came back rather than what it sent: the main process
is what decides the value that lands, and it repairs one it would not be able to
read later.
2026-09-02 06:28:24 -07:00
iamtoruk
4c4699952b feat(app): read and write the tray app's own settings
The tray app keeps its preferences in two files it reads from Rust before any of
its windows exist, so those files are the interface rather than any running
process: windows-settings.json for what only it cares about, windows-dock.json
for the Capacity Dock. The desktop app can now read and write both, which is
what lets its Settings carry the tray app's own panes.

Every write is a merge. Both files hold keys this side has no business touching,
the rail's placement above all, and a whole-file write would take them with it.
And every value is checked against the same closed set the tray app parses it
with: a value it cannot read collapses to a default there, so sending one would
silently lose the setting rather than store it. The check is also what keeps a
renderer from reaching a key it was not offered.

Two rules come with the dock file. Writing the provider set latches
manualSelection, because editing the set by hand is what stops the tray app
seeding it from whatever is connected. And a set that no longer holds the
resting provider moves it, since the rail can only rest on a row it is showing.

Showing the rail is the Sidebar switch under another name, so it goes through
that path rather than straight to the file, and keeps the rule that the rail
cannot outlive the tray app. Launch at login is the one setting that is not in
either file: it is the Run value, which this app already owns.

After every write the running tray app is nudged with --reload-settings, which
makes it re-read both files and broadcast to its own windows. With the tray app
off there is nothing to tell and the files are enough.
2026-09-02 06:28:05 -07:00
iamtoruk
451cc5115c test(app): give the orphan-reaping tests room too
They start real children and then wait for the OS to report them gone. Under the
whole suite, fifty files at once, that wait outran the five-second default often
enough to fail on a busy machine while nothing was wrong. Same reason and same
headroom as the resident-serve block.
2026-09-02 06:27:46 -07:00
iamtoruk
e54d8d0bfd feat(app): the two switches cannot disagree
The rail is a window of the tray app, and every setting it renders from belongs
to the tray app, so a Sidebar that is on while the menu bar app is off describes
something that cannot exist.

Turning Menu bar off now turns Sidebar off with it, and writes enabled: false
into windows-dock.json before sending --quit, so what the tray app finds the next
time it starts is the state the switches are showing rather than a rail that
comes back on its own. Turning Sidebar on with Menu bar off turns Menu bar on
first, installing and starting the tray app and writing the Run value, and only
then enables the rail; if the tray app cannot be turned on there is nothing for
a rail to live in, and both switches stay off.

In the corner the Sidebar switch is disabled while Menu bar is off, with a title
saying why. That is the primary guard, and the cascade above is what answers a
request that arrives any other way: through the IPC channel, or from a settings
file that already disagrees with itself.
2026-09-02 06:07:24 -07:00
iamtoruk
32a10e4bdb fix(app): check the tray app is there before talking to it
The stored path is a memory, not a fact. It was written by a build that derived
the binary name from the product name, so on this machine it named a file that
has never existed, and the switches sent --quit and --reload-settings into it
while the desktop app's own stderr said ENOENT. A tray app uninstalled after the
path was stored gets to the same place.

So nothing is launched, and no Run value is written, without checking the file
first. A stale stored path is re-resolved through the CLI rather than trusted,
which costs one `codeburn menubar`: it re-reads the uninstall registry and
installs nothing when the version already matches. A path the installer reports
but nothing is at is refused rather than saved, since saving it is what made the
switches silently do nothing.

Launch at login gets the same treatment. The rule is still that an existing Run
value is not this app's to rewrite, with one exception: a value pointing at a
file that is not there is not somebody's preference, it is the old wrong path,
and it would fail silently at every login. That one is repaired.

While here: a byte order mark no longer makes the settings file unreadable.
Falling back to the defaults means seeding again, which reinstalls the tray app
and re-enables the rail, and a BOM is what anything editing that file by hand on
Windows leaves behind.
2026-09-02 06:03:53 -07:00
iamtoruk
887347544c test(app): give the resident-serve tests room on a loaded machine
They start several real node children each, and the suite runs fifty files at
once, so two of them intermittently hit the five-second default while the
machine was busy rather than while anything was wrong. Nothing here asserts how
fast a child answers, only which one does.
2026-09-02 05:35:25 -07:00
iamtoruk
5765f15e58 fix(app): the desktop app can spawn a CLI on Windows at all
Windows has no shebang. CreateProcess starts executables, and both shapes a
codeburn install takes here are scripts: dist/cli.js in dev, and the codeburn.cmd
that a global npm install puts on PATH. Spawning either with shell: false is
EFTYPE, so nothing the desktop app ran ever ran on this platform. The throw came
out of startServe inside whenReady and took the rest of it with it, which is why
`npm run dev` never even opened a window, and why 49 of this file's own tests
failed here.

Each script now gets a runner that can start it. A .js goes through this
process's own binary as Node, the same shape the bundled CLI already used. A .cmd
goes through cmd.exe as one command line, because that is the only way to start
a batch file, and the line is built rather than handed to shell: true, which
does not escape anything: two parsers read it, cmd first and then whatever splits
a command line back into argv, and a .cmd re-expands its own arguments through
%*, so the arguments are escaped for both readings. That is cross-spawn's rule,
restated here rather than depended on, since the main process ships no npm
dependencies. An .exe and a POSIX codeburn are spawned exactly as before.

Two things follow from the cmd.exe route. The PATH lookup asks for codeburn.cmd
before bare codeburn, because npm writes both into the same directory and the
bare one is a shell script Windows cannot start. And killing such a child means
killing the tree: the shim exits as soon as it has started node, so the handle we
hold is the shim's, and taskkill /T is what reaches the generation below.

Five tests do not run on Windows now rather than failing there. They assert
catchable SIGTERM: a grace window, a cleanup handler, a child that ignores the
first signal, a resident closing its own stdin. child.kill on Windows is
TerminateProcess, so those are things the platform does not have rather than
things this code gets wrong, and the POSIX expectations are untouched. Three
assertions that hard-coded ":" as the PATH separator now use the platform's.
2026-09-02 05:28:00 -07:00
iamtoruk
f6c6ce7133 fix(app): a default is for a machine that has made no choice
The first run wrote enabled: true into windows-dock.json and wrote the tray
app's Run value, whatever was already there. On a machine where somebody had
installed the tray app by hand and deliberately turned the rail off, or turned
launch at login off, installing the desktop app quietly undid both. A default
is an answer for a question nobody has answered, not an override of one that has
been.

So the seed now looks first. An existing enabled value is left exactly as it is
and mirrored into the Sidebar switch instead, so the corner opens saying what
the rail is actually doing rather than what this app would have preferred; only
an absent key is seeded. A file that exists but has never mentioned the rail
still counts as no answer, which is the case for anyone who has only ever
dragged the rail somewhere.

The Run value follows the same rule and, like the rail, is only ever touched on
the first run. After that it belongs to whoever changes it: the tray app's own
launch-at-login toggle, or the Menu bar switch here, which still writes it on
and deletes it off.
2026-09-02 05:12:46 -07:00
iamtoruk
d59802c1ec feat(app): ship the tray app with the Windows desktop builds
stage-menubar.mjs is stage-cli.mjs for the Tauri tray app: it copies rather than
downloads, taking the local `cargo tauri build` output by default and whatever
CI fetched with --from. The two routes need different things staged, so it has
two shapes. The NSIS build gets the .msi and its .sha256, computing the digest
when a local build has none, so the installer's verification means the same
thing there as it does for a release. The Store build gets the executable, since
a packaged app cannot run msiexec at all.

build/menubar rides into both packages as win.extraResources. Unlike the CLI it
carries no node_modules, so electron-builder's production-dependency filter has
nothing to strip and the afterPack hook is not needed.

installer.nsh removes the tray app on uninstall only when the marker credits
this app with installing it, which is what keeps a manual `codeburn menubar`
install alive through a desktop uninstall. PowerShell reads the marker and pulls
the product code out of the uninstall string, because NSIS has no JSON and the
alternative was hand-parsing one in a macro.

appx-extensions.xml declares the tray app's launch at login as the package's own
windows.startupTask, so it appears in Settings > Apps > Startup like anything
else the Store installed. No Run value is written on that route.
2026-09-02 04:48:03 -07:00
iamtoruk
2bd44113c7 feat(app): two switches where the social glyphs were
The sidebar's bottom corner held About and a row of five brand glyphs. The
glyphs were the least useful thing on that screen: they are visited once, and
About already listed every one of them under Links. So they are only there now,
and the corner carries the two things a Windows user does want at hand: whether
CodeBurn sits in the notification area, and whether the Capacity Dock rail is on
the screen edge.

Both are on by default and neither renders at all until the main process says
this build has a tray app staged, which is why there is no placeholder row and
no greyed-out switch: on macOS, on Linux, and in a dev build with nothing
staged, the corner is exactly what it always was.

The switch is the shared one from Settings and onboarding, at 30x17 rather than
38x22 because a 186px sidebar has no room for the full size beside a label, and
keyed off the theme tokens rather than the white overlays the bare shape uses on
the dark onboarding sheet.
2026-09-02 04:43:07 -07:00
iamtoruk
c625d020e6 feat(app): the Windows desktop app puts the tray app on the machine
Installing the desktop app should give a person the tray icon and the Capacity
Dock without their ever learning that `codeburn menubar` exists. So it carries
the matching windows-v* build and puts it there itself, at first launch and at
every launch after, which is also what covers a desktop-app update: the staged
.msi travels with the app.

The install itself is not reimplemented here. The CLI already owns the registry
read, the checksum, the msiexec call and the never-downgrade rule, so this side
stages the file, names it in CODEBURN_MENUBAR_MSI and reads the one JSON line
that comes back. What it does own is the tray app's process and its Run value,
because the two sidebar switches have to be able to stop and start it: the tray
app is reached through its own argv, --quit to stop and --reload-settings to
make it re-read the dock preference this module writes.

The Store route shares almost none of that. msiexec is not available to a
packaged app and would fight the package manager anyway, so the tray exe ships
inside the package and is launched from there, and no Run value is written
because the manifest's own startup task covers launch at login.

Two rules worth naming. The defaults are seeded once, so a person who later
turns the rail off in the tray app's own settings does not find it back on at
the next launch of this one. And every setter answers with the whole status
rather than an acknowledgement, so a switch shows what took: an install
cancelled at the UAC prompt leaves it where it was.
2026-09-02 04:42:54 -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
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
Miguel Machado
fee0f63fd0 feat(menubar): keep token-only and flat-rate providers visible in agent tabs
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.
2026-08-31 22:43:13 -03:00
iamtoruk
ac6cfc045f fix(quota): skip zero-entitlement and unlimited Copilot windows instead of showing 100% used
A Free or Individual plan reports premium_interactions with entitlement 0
and 0% remaining, which both the menubar and the desktop decoder turned
into a full 100% used ring. Verified against a live quota payload.
2026-08-31 03:26:19 -07:00
iamtoruk
acc6f743cc fix(snap): split Claude credential file into a manually-connected plug; narrow cline grant to data/tasks
Snap Store review (forum topic 52615) asked for both: the credential
file is sensitive and only powers the optional quota tile, so it moves
to its own claude-quota-credentials plug with no auto-connect; the
cline parser reads only ~/.cline/data/tasks/<id> transcripts, so the
grant names that directory instead of the whole data root.
2026-08-30 02:58:53 -07:00
iamtoruk
76d77d4ef7 chore: release 0.9.23
Bump all surfaces to 0.9.23 together (CLI, desktop app, Windows menubar +
Tauri/Cargo, Flatpak, README download links) and regenerate the lockfile
version fields. Move the Unreleased changelog into a dated 0.9.23 section
covering the Capacity Dock, OMP/Grok pricing fix, CB-3/CB-4 sync, and the
desktop/TUI/menubar reliability fixes. Credit CodexBar (prior art) in the
README acknowledgements and third-party notices.
2026-08-29 01:22:46 -07:00
Aditya Vikram Singh
84fea9d550
feat(menubar): add native Capacity Dock (#1167)
* feat(menubar): add native capacity dock

* fix(menubar): harden dock interaction boundaries

* feat(menubar): polish native Capacity Dock for launch

- Flush top-edge docking via NSHostingView safe-area opt-out; shielding
  window level so the rail necks into the physical top like the system notch
- Liquid Glass legibility scrim so labels stay readable on light wallpapers
- Weekly-else-monthly headline window; unified severity colour bands
  (green <50 / yellow / orange / red) across rings and detail bars
- Squircle gauge + graphite theme defaults; auto-show connected
  subscriptions (up to 5) until the user edits the set, then respect it
- Capacity Dock Settings menu item; re-centre the settings window; info
  glyph for the About row
- Trim dead provider-credential override fields down to apiKey only
- Reconcile and extend tests for all of the above

---------

Co-authored-by: iamtoruk <hello@agentseal.org>
2026-08-29 00:37:30 -07:00
Aditya Vikram Singh
fa540325fb
fix(desktop): reap CLI process trees on quit (#1166)
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
2026-08-28 15:12:33 -07:00
Aditya Vikram Singh
b5f07d1cc7
perf(desktop): keep every destination useful across restarts (#1163)
* perf(desktop): keep every destination useful across restarts

* fix(desktop): label cached reports while they refresh

* fix(desktop): preserve reviewed cache invariants

* fix(desktop): bound durable snapshot work
2026-08-28 14:51:18 -07:00
Aditya Vikram Singh
6406296cb1
perf(desktop): show exact totals while details refresh (#1157)
* perf(desktop): warm time horizons before providers

* perf(desktop): avoid idle provider parse storm

* perf(desktop): show last exact headline during refresh

* perf(desktop): paint cached headline without animation

* fix(desktop): keep timeout recovery single-flight

* fix(desktop): keep cached headline stable on handoff

* fix(desktop): keep overview timelines legible

* fix(desktop): keep period switches truthful

* fix(desktop): open heatmap at newest dates

* fix(desktop): label cached data during refresh

* fix(desktop): invalidate progressive cache safely

* fix(desktop): keep progressive views exact across boundaries

* fix(desktop): preserve filter responsiveness

* fix(desktop): bound instant-switch memo
2026-08-28 13:20:33 -07:00
Aditya Vikram Singh
0d39b8cd0a
fix(desktop): harden packaged resident CLI routing (#1155)
* fix(desktop): recover from resident pipe closure

* fix(desktop): keep packaged resident serve alive

* test(desktop): make closed-pipe proof deterministic

* fix(desktop): preserve packaged CLI command routing

* test(desktop): isolate packaged CLI smoke
2026-08-28 13:19:29 -07:00
iamtoruk
7d03886554 fix(desktop): install flow surfaces CLI errors and locks actions while pending
InstallFlow modal now properly handles error states and prevents action resubmission:

1. When install starts, disable Cancel button (footer shows Cancel-only, not clickable alongside spinner)
2. When CLI call fails or times out, transition to error state showing CLI stderr verbatim in scrollable pre block
3. Error state offers Back (returns to step 1, clears error) and Cancel (closes modal) actions
4. Promise rejection properly updates error state on bridge envelope errors
5. Success path transitions to step 3 without showing error state

Added component tests for:
- Error state displays CLI message verbatim
- Back button clickable during error
- Install button disabled while pending (Cancel-only visible)
2026-08-28 06:59:50 -07:00
iamtoruk
747e6a619e feat(desktop): complete plugin-era UI with details, install flow, settings, and team registry
Implement five missing D1-D3 components for full plugin era desktop support:

1. PluginDetails modal (sections/PluginDetails.tsx): Display full plugin manifest with all syncAttributes disclosures verbatim, spanKinds, commands, and on-disk sections loaded via pluginInfo. Defensive rendering for unknown fields.

2. InstallFlow stepper modal (sections/InstallFlow.tsx): Three-step flow for plugin installation - Step 1 source selection (org name input or folder via chooseDirectory), Step 2 installation with spinner and CLI error display verbatim, Step 3 success confirmation with "View details" button. Special handling for no-sync-config errors.

3. Plugin row actions (update sections/Plugins.tsx): Add Details, Verify, and Remove action buttons to plugin list. Remove action shows confirm modal naming plugin. Wired to CLI bridge calls.

4. Settings > Sharing pane (sections/SettingsSharing.tsx): Complete automatic sync configuration UI within Settings panes. Empty state with "Set up automatic sync" flow: cadence selection (daily/hourly) + work-matching toggle -> disclosure text via syncAutoEnable(accept:false) -> scrollable display -> Accept flow. Active state displays fingerprint (truncated), acceptedAt, cadence, work-matching, receipts list. Drift detection with "Review and re-accept" button. Always-visible "Stop automatic sync" danger button.

5. Team tab registry (components/TeamRegistry.tsx): Detect "teams.*" keys in payload plugins record; render Team section in nav when present. v1 renderers for teams.week (spend card) and teams.status (status link to teams.codeburn.app). Unknown keys fallback rendered. schemaVersion > 1 displays update prompt.

All components reuse existing app patterns (card/list/button/modal styles, CSS tokens, no new dependencies). Tests added for component row states, disclosure flow, and Team tab detection. All gates pass: root 3839 tests, app 614 tests, typecheck clean, build succeeds.
2026-08-28 06:59:50 -07:00
iamtoruk
6d69803817 feat(desktop): plugin manager, install flow, sharing consent center, and dormant Team tab (plugin era D1-D3)
Part 1: Add --json output flags to three CLI commands for machine-readable output
- codeburn plugin list --json: array of plugin objects with status and capabilities
- codeburn plugin info <name> --json: manifest with dir and onDiskSections
- codeburn sync auto status --json: status object with configured, accepted, killed, receipts

Part 2: Implement Electron bridge with read and mutation handlers
- Read handlers: pluginList, pluginInfo, syncAutoStatus (return parsed JSON)
- Mutation handlers: pluginAdd, pluginRemove, pluginVerify, syncAutoEnable, syncAutoDisable
- All handlers follow existing Envelope pattern with proper error handling
- Special case: syncAutoEnable captures disclosure text when accept=false

Part 3: Renderer UI components (minimal implementation D1-D3 shell)
- Add Plugins section to nav rail at bottom (quiet entry, plugin icon)
- Implement PluginsSection component with list rendering for loaded/rejected plugins
- Update Section type and routing to include plugins navigation
- Add test coverage for Plugins panel row states
- Implemented as dormant Team tab registry placeholder for future plugin sections

Tests: All CLI tests (3839 passed), app tests (613 passed), E2E gates all passing
- CLI: tsc clean, vitest passes with 26 pre-existing jsdom errors
- App: typecheck clean, npm test green, npm run build succeeds
2026-08-28 06:58:55 -07:00
iamtoruk
8d27241e0c chore: align app and windows versions with CLI 0.9.22 (installer manifest guard) 2026-08-25 06:42:34 -07:00
iamtoruk
fee06a7e54 feat(app): Kimi Code live quota on the Plans page (#1136)
Ports the menubar's Kimi flow to the Electron quota module: read-only
~/.kimi-code/credentials (KIMI_CODE_HOME honored), api.kimi.com usages
snapshot, terminal expired-login state that never refreshes the CLI's
short-lived token, 5-hour/weekly window mapping with over-limit clamp,
membership plan label, and the standard per-provider Settings toggle.
2026-08-24 12:28:32 -07:00
iamtoruk
908a2e1a1d feat(app): period payloads persist for the session and revalidate behind an instant paint
The renderer memo was an LRU capped at 8-24 entries, so cycling periods
evicted payloads and returning to one forced a skeleton plus a 1.5-6s
recompute. The memo is now one latest payload per key for the app
session: a revisited period paints its cached numbers in the same
commit, skips the CLI entirely when the payload is under 30s old, and
otherwise revalidates behind the painted data and swaps in place.
Failed revalidates keep last-good data with the existing error surface;
first visits keep the loading state. (#1135 part 1)
2026-08-24 11:56:37 -07:00
iamtoruk
195bb9128e chore: release 0.9.21
Version 0.9.21 across CLI, desktop app, and Windows menubar; refreshed
LiteLLM pricing snapshot and fallback (catches the 2026-08-24 OpenAI
GPT-5.6 cut and DeepSeek v4 repricing mid-rollout, #1134 tracks
re-tightening); CHANGELOG stamped for 0.9.21; README release links to
0.9.21. Snapshot-pinned model tests updated to current catalog truth.
2026-08-24 11:16:55 -07:00
iamtoruk
04cd6d0bf3 Merge remote-tracking branch 'origin/main' into fix/ft002-harness-launcher
# Conflicts:
#	src/doctor.ts
2026-08-24 07:15:08 -07:00
iamtoruk
d03b92f4ff feat: gate the partial answer on the client rendering the indicator
Each surface holds its OWN serve child: the Swift menubar (mac/), GNOME and
Windows clients spawn `codeburn serve --stdio` too, and their payload
decoders ignore an unknown key — so they would have shown a partial total
with no way to say so. The paint is now opt-in via
CODEBURN_SERVE_PROGRESSIVE, which the Electron app sets on its own serve
child because its renderer shows the indexing banner. Unset means the child
answers only with complete data, so no surface can present partial totals
unlabelled.
2026-08-23 05:18:29 -07:00
iamtoruk
be1b212a3f feat: surface-wide progressive hydration via an explicit payload marker
The TTY got the fast cold start in #1109; every JSON surface still waited
for the full parse because a payload has no way to say "partial". Add one.

- `hydration: { complete, indexedFiles, totalFiles }` on the menubar payload,
  add-only and emitted ONLY by the resident serve child (which polls, and
  therefore converges). Absence keeps meaning "complete", so every one-shot
  output is byte-identical and no script can be handed partial data.
- serve: a cold child answers `status --format menubar-json` from the files
  the requested period can show (same mtime floor as the TUI) and schedules
  the unfloored fill behind it. Partial answers are never memoized; requests
  waiting behind the fill are heartbeated by id so the client's no-output
  watchdog stays armed.
- `stale` keeps its own meaning: a first paint is fresh but partial, so it
  reports through `hydration` and never sets `stale`.
- desktop app and web dash render an honest "indexing history · N/M files"
  notice while `complete` is false.
2026-08-23 04:49:58 -07:00
Resham Joshi
c9dab7deb6
Merge pull request #1114 from getagentseal/feat/1112-quota-providers
feat: live quota for Gemini, Copilot, Antigravity + per-provider toggles
2026-08-23 04:29:16 -07:00
iamtoruk
287791e2a9 feat: live quota for Gemini, Copilot, and Antigravity in the desktop app
Extends the existing borrowed-credential quota module (claude/codex) with
three providers, per-provider settings toggles, and a provider display map:

- gemini: Code Assist loadCodeAssist/retrieveUserQuota via the Gemini CLI's
  on-disk OAuth creds; optional env-gated token refresh; retired-tier
  responses degrade to terminalFailure with migration guidance
- copilot: copilot_internal/user with editor-plugin headers; token read-only
  from hosts.json/apps.json with one re-read on 401; marked as an internal
  API that may drift, failures degrade honestly
- antigravity: loopback-only Connect-RPC probe of the local language server
  (ps/lsof discovery via execFile, csrf token for the app variant, agy CLI
  accepted tokenless); TLS relaxation scoped to 127.0.0.1; no OAuth fallback
- settings: per-provider quota switches (default on) persisted renderer-side,
  honored in the main-process service so disabled fetchers never run; IPC
  disabled-list filtered against the provider allowlist
- sanitizeError extended for Google (ya29.) and GitHub (gh*_) token shapes

Kimi audited, not duplicated: the macOS menubar already fetches Kimi quota
live (KimiSubscriptionService.swift); the electron app not surfacing it is a
pre-existing gap, unchanged here.
2026-08-23 03:13:47 -07:00
iamtoruk
8f39cc5487 feat: open the interactive dashboard on today, falling back to 7 days when today is empty
The unset default opened on 7 days everywhere. It now opens on today and
only falls back to 7 days when today holds no sessions yet — the decision
is made from the today-scoped slice of the parse the first paint already
runs, so the probe costs a filter, not a second pass.

Explicit selections are untouched: -p/--period, --day, --from/--to, the
TUI period keys, the app's persisted default period, and every one-shot
(--format json, report/sessions/status, the piped non-TTY render) keep
the 7-day default they had.

Fixes #1111
2026-08-23 02:39:41 -07:00
Resham Joshi
554d32eba6
Merge pull request #1098 from avs-io/fix/pr-tab-empty-period
Some checks failed
CI / semgrep (push) Waiting to run
Tests / test (22) (push) Waiting to run
Tests / test (22.13.0) (push) Waiting to run
macOS Menubar CI / test (push) Has been cancelled
fix(desktop): say why the PR tab is empty
2026-08-22 13:08:51 -07:00
iamtoruk
21382bb8e6 copy: drop the em dash from the wider-period hint (repo copy rule) 2026-08-22 12:46:42 -07:00
iamtoruk
affd40e230 payload: add-only stale marker for read-only stale menubar serves (#771)
isSessionHydrationComplete() (parser.ts, PR #937) already reports when a
read-only serve skipped or staled real on-disk changes; thread it through
buildMenubarPayload as an optional stale field, present and true only on a
stale serve, always absent otherwise, so older/newer CLI-app pairs stay
compatible. Mirrors the field into the desktop renderer types and the macOS
menubar's Codable payload model (data layer only, no view change).

Drafted with minimax/MiniMax-M3 via local gateway.
2026-08-22 11:38:46 -07:00
Aditya Vikram Singh
0a43427924 fix(desktop): name a custom range on the empty PR tab
The empty note still used the dormant 30D label after a calendar
selection. Use the same rangeLabel as the TopBar caption.
2026-08-22 23:58:50 +05:30
Aditya Vikram Singh
b095091aad fix(desktop): thread PR-tab period through App
Empty copy was defaulting to Today because App never passed the selected
period. Labels now share PERIOD_LABELS; the wider hint queries Lifetime.
2026-08-22 23:46:46 +05:30
Aditya Vikram Singh
7b802f4dd0 fix(desktop): say why the PR tab is empty
Today/week/month often have no session-linked PRs, so the tab
looked broken. Name the selected period and, when All has rows,
point at that count. Do not invent gh links. Do not change
attribution or the default period.
2026-08-22 23:24:59 +05:30
iamtoruk
4eabda17d7 fix: bound the serve drain, reap orphans on Windows, and de-flake the grace test
G1a - the stdin-EOF drain is now bounded (Promise.race against 45s, overridable
via CODEBURN_SERVE_DRAIN_MS for the test). Generous enough that no legitimate
request answered at EOF comes near it, and an async-wedged one releases the
child instead of turning it into the orphan the drain was added to prevent. The
comment names the ceiling: a SYNCHRONOUSLY wedged parse never yields to this
timer or to any other JS path, and only a signal can end that process.

G1b - Windows is the majority of the desktop fleet and had no orphan escape at
all: no ps, and no stdin-close recourse once the app has crashed. The reap now
works there. tasklist cannot report argv (image name and window title only) and
wmic is gone from current Windows, so the command line comes from
Get-CimInstance Win32_Process. Match discipline is unchanged - exact argv - with
quoting normalized on both sides, because we record a plain space-joined argv
while Windows reports the real quoted command line; a path with spaces still
round-trips. serveCommandMatches is extracted and tested directly.

G2 - the grace test raced node's cold boot (a 300ms window). The child now emits
one byte the moment it is ready, so the watchdog window is measured from
READINESS, not from spawn: boot cost cannot eat it at any machine speed. Timeout
raised on top of that. 6/6 green under 8 busy loops.

G3 - a served request heartbeats for its whole duration now, not just its parse:
the wrap moved to the one seam (runCaptured) that also covers aggregation and
payload serialization, whose ~8s tail lands back-to-back with the parse's own
quiet stretches. The one-shot path keeps the parse-only wrap, where an 8s tail
is comfortably inside the window on its own, and the CHANGELOG now says exactly
that instead of claiming every phase.

G4 - stillCold() anchors to coldStartBegan ?? bootedAt.

Text: the cold-timeout bound no longer claims to restore the "locate the CLI"
recovery (that is a not-found state, never cold-flagged), and the CHANGELOG
states the >15min case honestly - the ceiling still ends it, but partial cache
saves mean successive polls converge rather than each rescanning from nothing.
2026-08-22 10:36:58 -07:00
iamtoruk
3317189dd6 fix: address adversarial review of the timeout watchdog (F1-F7)
F1 - `codeburn serve` lost an in-flight request's response when stdin closed
mid-flight: runStdioServe returned before its queue drained, and the explicit
process.exit(0) then hit runCaptured's monkeypatched exit, throwing ExitSignal
and exiting 1 with the frame never written. The finally now awaits the queue.

F2 - the SIGTERM rationale was false. armSignalCleanup unlinks the refresh lock
and re-raises; it publishes no partial cache, and a lock left by SIGKILL already
self-heals through the stale-pid takeover. SIGTERM-first is kept for the real
(smaller) benefit - a clean lock release instead of a takeover - and every
comment plus the CHANGELOG now says only that.

F3 - the cold gate had no exit. overviewWarmed only flips on success, so an
install that can never hydrate sat behind an indexing splash forever with no
error and no route to the CLI recovery. The cold claim now expires with the cold
window itself.

F4 - the real CLI does not heartbeat the way the demo did: a cold parse's
inter-provider cache save measured 31.6s of total silence, which a 45s window
survives only until the machine is 1.5x slower. Under CODEBURN_PROGRESS a
running parse now emits a keepalive every 10s regardless of phase, so silence
genuinely means stopped. Consumers that do not know the event ignore it.

F5 - the orphan-reap identity check matched any `cli.js` running `serve`. The
pidfile now records the exact argv and `ps -ww` must match it exactly.

F6 - bump() re-armed the watchdog after settle, leaving a timer finish() never
clears when a killed child's buffered output landed.

F7 - kill paths dropped the child from activeChildren before SIGTERM and the
SIGKILL backstop was unref'd, so a quit inside the 5s grace orphaned a child
that ignores SIGTERM. It now stays registered until it actually dies.

N8 - the silence test wrote its only byte at t~0, so it passed without the
re-arm. The byte now lands mid-window and the kill is asserted from it.
N9 - documented why mutations keep a plain total cap.
2026-08-22 09:58:59 -07:00
iamtoruk
d8bd428054 fix(app): give the mutation-restart and destroy paths the same SIGTERM grace
A settings mutation replaces the resident serve child, which may be mid-write:
the same lock hazard a timed-out read has, so it gets the same treatment.
restartAfterMutation and destroy now go through killGracefully instead of
SIGKILL. reapAll's one-shot loop stays a hard kill and now says why - quit has a
1.5s flush budget, shorter than the grace, so waiting one out would wedge the
quit, and a one-shot read holds no lock worth releasing.
2026-08-22 09:26:29 -07:00
iamtoruk
d4b7b48dc8 fix(app): no-output watchdog replaces fixed timeouts; graceful kills; cold floor everywhere; orphan serve reaping
The desktop app capped every read at 45s of TOTAL runtime, so a slow machine's
warm `optimize` (52.5s on 0.9.20, 39.6s on main) was SIGKILLed mid-parse and the
panel painted a red "timed out" that a 60s poll then reproduced forever.

- cli.ts: the read timeout is now a no-output watchdog. The window restarts on
  every byte the child writes (serve: every frame carrying that request's id),
  so only a genuinely silent child times out. A 15-minute absolute ceiling still
  reaps a livelocked child. Every read spawn sets CODEBURN_PROGRESS=1 so a long
  parse heartbeats through it; progress lines are stripped from any surfaced
  stderr so they can never become the error message.
- cli.ts: a timed-out child gets SIGTERM first and SIGKILL only after a 5s
  grace, on both the spawn and the serve branch. That lets the CLI's signal
  cleanup publish its partial parse and release the cross-process refresh lock
  instead of leaving both stale.
- main.ts: the 10-minute cold floor now covers EVERY read while the first
  hydration is still running, not just the overview. Sections start polling the
  moment `ready` flips (which an overview error also does), and a 45s section
  spawn queued behind the cold parse was killed on arrival.
- main.ts/renderer: a timeout raised while the hydration is still running is
  flagged `cold`, and the renderer keeps its indexing splash (and keeps the
  sections gated) instead of latching ready and painting CliErrorPanel. Only
  timeouts are flagged; a permission or nonzero failure still surfaces.
- cli.ts/main.ts: the resident serve child's pid is recorded under userData and
  a serve orphaned by a previous crash is reaped at launch, after `ps` confirms
  the pid still belongs to a codeburn serve.
- src/main.ts: `codeburn serve` exits explicitly once its stdin closes, so a
  handle outliving the transport cannot keep the child alive as an orphan.
2026-08-22 09:22:38 -07:00
iamtoruk
c73d8ff6c8 snap: scope the entries main gained after the tightening
The ported declaration was written against main as of c9e6e2ec. Main has since
added dsh and carries five entries that commit never saw, all of them still bare
tool roots, so the port dropped them rather than reintroduce what the store
rejected. Each is restored at the path its provider opens:

  .dsh/sessions                          dsh.ts reads <DSH_HOME>/sessions only
  .kiro/sessions                         CLI store at sessions/cli, v2 IDE store
                                         at sessions/<hash> — siblings
  .quickwork/{profiles.json,sessions,metrics}
                                         profiles.json names the profile bases;
                                         the legacy layout is sessions/sessions.db
                                         plus metrics/
  .config/Claude/local-agent-mode-sessions
                                         Claude Desktop's local-agent-mode store
  .config/Open Design/{runs,data/runs,namespaces}
                                         the three discovery roots open-design.ts
                                         probes under its data dir

.lingtai and .lingtai-tui stay dropped. A LingTai ledger lives at
.lingtai/<agent>/logs/token_ledger.jsonl, and personal-files has no wildcard for
the agent segment; .lingtai-tui only exists to enumerate project homes that could
not be read anyway. Goose is narrowed to .local/share/goose/sessions, which holds
the only file it opens.

Four entries stay whole roots because the provider reads a file sitting directly
in the root: .config/github-copilot (JetBrains stores nest under a variable
<ide>/<kind>/<storeId>) and .local/share/{opencode,crush,kilo}. The new
app/scripts/snap-grants.test.ts asserts every other entry is at least one level
below its tool root, so a bare root cannot come back unnoticed.
2026-08-21 03:42:09 -07:00
iamtoruk
3168699927 snap: scope personal-files to log subdirectories
Snap Store review found the declaration requested each tool's entire root
directory. Those roots hold configuration and, in several cases, credentials,
and personal-files read is recursive, so the request granted read of every AI
tool's credential store.

Every path is now the subdirectory the provider actually opens: .claude/projects,
.codex/sessions, .cline/data, .vibe/logs/session, .hermes/profiles, .mux/sessions
and so on; two are single files (.forge/.forge.db, .zcode/cli/db/db.sqlite). The
editor entries name only the extension folders that hold transcripts rather than
the editor's whole configuration. No bare tool root remains.

One credential file is requested openly instead of implicitly: .claude/.credentials.json,
read-only, used to call Anthropic's usage endpoint for the live plan gauge.

Codex's equivalent needs read-write on the Codex CLI's auth.json to rotate the
token, so neither that file nor a Codex root is declared and the Codex live
gauge is disabled under $SNAP. Codex usage and cost analytics are unaffected;
they come from the session rollouts.

Also declares five providers that were missing entirely and would have shown no
data under the snap: opencode, crush, goose, kilo, kimi-code. Drops .lingtai,
whose per-agent directory sits above the log folder and cannot be expressed
without wildcards.

Ports 4fe760aafe0492a674476c1ca64bf0dbdc673dde onto current main; the entries
main gained since that commit are reconciled separately.
2026-08-21 03:38:25 -07:00