Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
301 commits
Select commit Hold shift + click to select a range
fea26e6
fix(postgres): treat a cloud thread with newer plan usage as the same…
cpcloud Oct 13, 2026
3a0e7ac
feat: leave plan-only sessions out of token totals
cpcloud Oct 13, 2026
6a29d26
feat: expose plan usage in API, CLI, and exports
cpcloud Oct 13, 2026
e482adb
docs: mark plan usage parsing and storage tasks done
cpcloud Oct 13, 2026
9c92081
fix(cli): show plan-only sessions as plan usage, with readable figures
cpcloud Oct 13, 2026
4f3ea35
feat(frontend): show codex-cloud plan usage and status
cpcloud Oct 13, 2026
54169aa
docs: document the codex-cloud source
cpcloud Oct 13, 2026
8d6aabf
fix(codexcloud): show stored plan usage date after a restart
cpcloud Oct 13, 2026
d7187b6
fix(frontend): claim plan usage covers missed turns only for a usable…
cpcloud Oct 13, 2026
aba99e8
fix(frontend): keep a model's reported cost next to plan-only chats
cpcloud Oct 13, 2026
92c5c23
fix(frontend): reload codex-cloud status after a server switch
cpcloud Oct 13, 2026
127a957
fix(frontend): let keyboard users read the codex-cloud status detail
cpcloud Oct 13, 2026
6e8eee0
fix(frontend): explain the closed plan usage control
cpcloud Oct 13, 2026
a344b52
fix(frontend): call OpenAI Codex threads chats in codex-cloud text
cpcloud Oct 13, 2026
3de8878
fix(codexcloud): count a retried token flush once
cpcloud Oct 13, 2026
1d9abdf
fix(codexcloud): keep live token records a failed save left behind
cpcloud Oct 13, 2026
3c3badb
fix(codexcloud): end the account wait when live discovery succeeds
cpcloud Oct 13, 2026
de1dea7
fix(codexcloud): stop live capture when a listened-in chat sends an u…
cpcloud Oct 13, 2026
df5b5c9
fix(codexcloud): allow for clock drift when choosing chats to listen …
cpcloud Oct 13, 2026
f441890
fix(codexcloud): check the listen-in rule again right before resuming…
cpcloud Oct 13, 2026
9dbf163
fix(codexcloud): make the live tokens status line say what is happening
cpcloud Oct 13, 2026
5fc4e17
fix(parser): stop logging every past token counter reset on reparse
cpcloud Oct 13, 2026
44c4b9e
docs: record how Codex cloud live tokens become usage and cost
cpcloud Oct 13, 2026
9eee2e9
fix(codexcloud): drop a new connection when its home needs a fresh login
cpcloud Oct 13, 2026
f101a2b
fix(config): point a bad codex-cloud setting at the edit that fixes it
cpcloud Oct 13, 2026
8f81174
refactor(codexcloud): drop a dead field and fix two misleading comments
cpcloud Oct 13, 2026
946e590
fix(codexcloud): keep token updates that arrived before a connection …
cpcloud Oct 13, 2026
76f77be
fix(codexcloud): treat an unreadable thread state file as a local error
cpcloud Oct 13, 2026
ccea80e
fix(codexcloud): keep a stalled chat checked after an interrupted save
cpcloud Oct 13, 2026
0589815
fix(codexcloud): restart the 7-day retry limit for chats retried with…
cpcloud Oct 13, 2026
77cbb2d
fix(codexcloud): keep a chat's stored listing record current after an…
cpcloud Oct 13, 2026
5e30214
fix(codexcloud): stop retrying a retired chat that the listing shows …
cpcloud Oct 13, 2026
7d3f8d6
test(codexcloud): cover the retired set in the account state round trip
cpcloud Oct 13, 2026
bb3c771
fix(codexcloud): let one unanswered chat wait instead of stalling the…
cpcloud Oct 13, 2026
7876d12
perf(codexcloud): count backfill progress without rereading the accou…
cpcloud Oct 13, 2026
5f4a974
fix(codexcloud): say why a Codex home's login could not be read
cpcloud Oct 13, 2026
e6f6776
fix(codexcloud): tell keyring and ephemeral Codex homes how to enable…
cpcloud Oct 13, 2026
2fd92b3
fix(codexcloud): give a login command that works for any Codex home path
cpcloud Oct 13, 2026
4f1bb1c
fix(cli): make the codex-cloud lines in serve status read as sentences
cpcloud Oct 13, 2026
605bb8f
fix(codexcloud): say import stays off when config.toml cannot be read
cpcloud Oct 13, 2026
92356a6
fix(codexcloud): make codex-cloud status and log text say what happen…
cpcloud Oct 13, 2026
5cb39af
style: format the new codex-cloud test tables with gofumpt
cpcloud Oct 13, 2026
3e2912d
fix(codexcloud): share one chat-count helper between sync and live st…
cpcloud Oct 13, 2026
b0669f9
test(duckdb): keep plan usage tests out of Windows ARM64 builds
cpcloud Oct 13, 2026
f38de2d
refactor(db): reuse the empty-string and local-modified helpers
cpcloud Oct 13, 2026
9dbf40b
test(clickhouse): check the plan usage row width against its columns
cpcloud Oct 13, 2026
73c4a74
fix(postgres): word the plan usage schema error like its neighbours
cpcloud Oct 13, 2026
5fff36d
ci: run the plan usage parity test against PostgreSQL and ClickHouse
cpcloud Oct 13, 2026
ce8191e
docs(hosted): grant the runtime role access to plan usage
cpcloud Oct 13, 2026
ab384fc
docs(clickhouse): say to push once before upgrading serve machines
cpcloud Oct 13, 2026
484d4ce
refactor(codexcloud): drop unused plan usage status constants
cpcloud Oct 13, 2026
1d0a78e
fix(codexcloud): reject non-decimal plan usage credits
cpcloud Oct 13, 2026
b9296c0
fix(db): export unknown, not zero, usage for unchecked codex-cloud chats
cpcloud Oct 13, 2026
2e28f97
fix(service): count sub-agents' missed turns in combined usage
cpcloud Oct 13, 2026
1aa78df
fix(cli): show stale plan usage honestly in session usage
cpcloud Oct 13, 2026
03ca216
fix(codexcloud): stop plan usage retries after the settle point
cpcloud Oct 13, 2026
8214e06
fix(codexcloud): settle a left-out chat with its newest stored row
cpcloud Oct 13, 2026
60e4b0b
fix(codexcloud): name the login problem when plan usage has no home
cpcloud Oct 13, 2026
c183b15
fix(codexcloud): date stored plan usage after any restart
cpcloud Oct 13, 2026
4693e81
fix(codexcloud): keep sub-agent usage groups whole across a crash
cpcloud Oct 13, 2026
bc4478b
fix(codexcloud): save a delegated chat's parent with its resume point
cpcloud Oct 13, 2026
fd8b176
test(cli): set promoted usage fields directly in exit code tests
cpcloud Oct 13, 2026
ebf6195
refactor(codexcloud): allocate the plan usage request list up front
cpcloud Oct 13, 2026
856315c
fix(codexcloud): end the connection when sending a request fails
cpcloud Oct 13, 2026
6a0f6fa
perf(clickhouse): count plan-only sessions without scanning every mes…
cpcloud Oct 13, 2026
f97365d
fix(parser): ignore repeated live token batches when counting missed …
cpcloud Oct 13, 2026
b71267f
fix(codexcloud): bound and surface live token counts that fail to save
cpcloud Oct 13, 2026
0e4f087
fix(codexcloud): keep a local error local when the connection just cl…
cpcloud Oct 13, 2026
4e259b7
docs(config): bring the Codex Cloud section in line with shipped code
cpcloud Oct 13, 2026
b291788
docs(usage): say one capture covers a Codex cloud chat's earlier turns
cpcloud Oct 13, 2026
433ecce
docs(changelog): say the Codex cloud import also listens in on runnin…
cpcloud Oct 13, 2026
958bf42
docs(cli): describe the Codex cloud lines in serve status
cpcloud Oct 13, 2026
164565c
docs: explain Codex cloud export fields and plan usage upgrade steps
cpcloud Oct 13, 2026
0a9ba9a
docs(spec): record the codex-cloud behavior and status text that shipped
cpcloud Oct 13, 2026
0004e6b
docs(plan): match the codex-cloud plan to the names that shipped
cpcloud Oct 13, 2026
a78ac53
docs(config): do not claim codex login never fixes a refused account
cpcloud Oct 13, 2026
0d7eb7a
docs(spec): quote the new pending-save and local-error status text
cpcloud Oct 13, 2026
0f74512
fix(codexcloud): make three status messages say what actually happens
cpcloud Oct 13, 2026
8cb87dc
fix(postgres): ask for a grant when pg serve cannot read a table
cpcloud Oct 13, 2026
4c51998
docs(hosted): quote the grant error pg serve now shows
cpcloud Oct 13, 2026
fd6746c
feat(export): report session export schema version 7
cpcloud Oct 13, 2026
7f253e6
fix(frontend): name plan-only chats on tokenless models in token mode
cpcloud Oct 13, 2026
44262b7
fix(frontend): clear codex-cloud status right after a server switch
cpcloud Oct 13, 2026
b0d179a
fix(frontend): keep the codex-cloud status tooltip on screen when zoomed
cpcloud Oct 13, 2026
c4e49dd
fix(frontend): tell screen readers when plan usage is counted elsewhere
cpcloud Oct 13, 2026
378da55
fix(frontend): match the codex-cloud retry note to how retries work
cpcloud Oct 13, 2026
647a46c
fix(codexcloud): show the retry explanation once in the status tooltip
cpcloud Oct 13, 2026
a98b1bb
fix(codexcloud): keep a settled plan usage row marked as left out whe…
cpcloud Oct 13, 2026
a7bf64d
fix(codexcloud): end only network waits when live discovery lists chats
cpcloud Oct 13, 2026
8c044d3
fix(codexcloud): say why live tokens are off and how to resume them
cpcloud Oct 13, 2026
9db90c7
fix: stop claiming plan usage covers turns live capture missed
cpcloud Oct 13, 2026
14bee3b
fix(codexcloud): name both causes of a refused login in auto mode
cpcloud Oct 13, 2026
e256264
fix(codexcloud): let only a newer login end a Codex home's wait
cpcloud Oct 13, 2026
6cc196d
docs: correct Codex cloud token mapping and sub-agent folding notes
cpcloud Oct 13, 2026
b50a6f0
fix(codexcloud): mark the status bar when live capture needs the user
cpcloud Oct 13, 2026
075f248
fix(codexcloud): show the live tokens line when the whole source is off
cpcloud Oct 13, 2026
9425e7f
docs: name the turn ID in the Codex cloud duplicate-record rule
cpcloud Oct 13, 2026
e682ed7
fix(codexcloud): give Windows users a login command they can paste
cpcloud Oct 13, 2026
409099f
fix(codexcloud): keep checking plan usage after one late failed request
cpcloud Oct 13, 2026
07d0942
fix(config): say what fixes a bad [agents.codex-cloud] entry
cpcloud Oct 13, 2026
ef0b13f
fix(codexcloud): read a home's wait and its reason in one step
cpcloud Oct 13, 2026
0a5b2f4
fix(codexcloud): show the year on plan usage dates after New Year
cpcloud Oct 13, 2026
4e23c00
fix(cli): say how to fix a codex-cloud status request the server refused
cpcloud Oct 13, 2026
59e76b0
test(codexcloud): keep only the retry count in the interrupted-link test
cpcloud Oct 13, 2026
629debc
fix(codexcloud): act on queued notifications when a join leaves
cpcloud Oct 13, 2026
c78cd2a
fix(codexcloud): make the retry and protocol messages fit any number …
cpcloud Oct 13, 2026
54a8957
fix(codexcloud): fetch due retries after every other chat
cpcloud Oct 13, 2026
c9537c7
fix(codexcloud): suggest signing in again before switching to file st…
cpcloud Oct 13, 2026
9412a1a
fix(codexcloud): say the kept settings are why import is off
cpcloud Oct 13, 2026
8e340ba
fix(cli): give each codex-cloud status failure in serve status a next…
cpcloud Oct 13, 2026
9c7c1b5
fix(codexcloud): say plan usage is asked again after an oversized reply
cpcloud Oct 13, 2026
988aa67
fix(cli): stop promising a plan usage check when import may be off
cpcloud Oct 13, 2026
057503e
perf(service): read capture coverage only for codex-cloud sub-agents
cpcloud Oct 13, 2026
2dc03ac
fix(codexcloud): bound and correct the bad plan usage credits error
cpcloud Oct 13, 2026
cf784af
test(clickhouse): fail the scan-bound test when no progress is reported
cpcloud Oct 13, 2026
65ec249
docs(config): match the Codex Cloud section to what each failure stops
cpcloud Oct 13, 2026
37b9cb3
fix(codexcloud): keep what the parser needs when compacting unsaved t…
cpcloud Oct 14, 2026
6cb3b98
fix(codexcloud): set a live token line and its warning flag together
cpcloud Oct 14, 2026
720b85b
test(frontend): check that the codex-cloud tooltip text stays inside …
cpcloud Oct 14, 2026
e8c858f
fix(codexcloud): tell users where the log is and not to repeat a conf…
cpcloud Oct 14, 2026
8979445
fix(codexcloud): keep the user's CODEX_HOME after the Windows login c…
cpcloud Oct 14, 2026
3b09a38
fix(codexcloud): say how long live_tokens must stay off to resume cap…
cpcloud Oct 14, 2026
e638fd9
test(codexcloud): cover the plan usage wait's newer-login rule
cpcloud Oct 14, 2026
7c1a076
test(codexcloud): check that a current settled row is not marked as l…
cpcloud Oct 14, 2026
ace6f1c
fix(config): quote the setting name in a bad [agents.codex-cloud] val…
cpcloud Oct 14, 2026
a486387
test(codexcloud): expect the quoted setting name in the kept-settings…
cpcloud Oct 14, 2026
04b9519
fix(codexcloud): bound the bad data_as_of error and mark cut server v…
cpcloud Oct 14, 2026
f421a22
fix(codexcloud): promise another plan usage request only when one is …
cpcloud Oct 14, 2026
6ea5373
test(codexcloud): check that a timed-out chat's wait starts at the ti…
cpcloud Oct 14, 2026
5a39a64
fix(cli): stop saying an uncaptured turn's tokens are all missing
cpcloud Oct 14, 2026
cad7f19
fix(frontend): say when plan usage figures may be stale and why
cpcloud Oct 14, 2026
69194ba
fix(cli): give the remaining serve status failures a next step
cpcloud Oct 14, 2026
5f9c855
test(cli): run the daemon wake test on fake time
cpcloud Oct 14, 2026
06c39c9
style: apply gofumpt to the codex-cloud files the linter flagged
cpcloud Oct 14, 2026
5c1b45b
fix(codexcloud): give a no-sync daemon advice that turns import on
cpcloud Oct 14, 2026
eac02c8
fix(postgres): name the schema grant too when pg serve is denied access
cpcloud Oct 14, 2026
d793346
test(codexcloud): check that a removed status row forgets its live wa…
cpcloud Oct 14, 2026
cea6dfa
docs: correct the Codex Cloud docs where they disagree with the code
cpcloud Oct 14, 2026
daa83a5
docs(spec): quote the codex-cloud status text that ships now
cpcloud Oct 14, 2026
6c3221e
fix(codexcloud): keep fewer token records when contexts tie
cpcloud Oct 14, 2026
c2666da
fix(codexcloud): point status messages at debug.log, where the detail…
cpcloud Oct 14, 2026
05f65e4
fix(postgres): ask for the schema grant, not a rebuild, when serve ca…
cpcloud Oct 14, 2026
b49f885
fix(codexcloud): restore CODEX_HOME when a Windows login is cancelled
cpcloud Oct 14, 2026
b5dca7f
fix(codexcloud): say plan usage is retried when only a refresh failed
cpcloud Oct 14, 2026
5d33ab6
fix(codexcloud): tell an archive-only daemon that restarting will not…
cpcloud Oct 14, 2026
138b23e
fix(frontend): warn on the closed plan usage control when its figures…
cpcloud Oct 14, 2026
3c7fa5a
docs: make the Codex Cloud docs say what the code does in the edge cases
cpcloud Oct 14, 2026
e9a54de
docs(spec): split the stopped-capture recovery sentence
cpcloud Oct 14, 2026
36b6c1e
fix(codexcloud): do not promise a refresh that will never be sent
cpcloud Oct 14, 2026
de071f1
fix(codexcloud): give each no-sync cause its own next step
cpcloud Oct 14, 2026
5070192
fix(frontend): start the stale plan usage note with "Since then"
cpcloud Oct 14, 2026
e0ec638
docs: describe what a chat keeps when plan usage checks stop
cpcloud Oct 14, 2026
1be2e91
test(clickhouse): pin the fingerprint main computes today
cpcloud Oct 14, 2026
c6e2906
docs: keep the Codex Cloud design as a maintainer reference
cpcloud Oct 14, 2026
12fca6c
fix(codexcloud): say how to use a separate data directory
cpcloud Oct 14, 2026
f21a2ae
fix(frontend): use idiomatic French in the stale plan usage note
cpcloud Oct 14, 2026
f9eea5b
docs: clarify three Codex Cloud configuration sentences
cpcloud Oct 14, 2026
1e7896f
test(clickhouse): keep the fingerprint comment true after merge
cpcloud Oct 14, 2026
33f8723
test(codexcloud): make two job tests and a mode test pass on Windows
cpcloud Oct 15, 2026
512bc31
fix(codexcloud): guard the spots nilaway now flags
cpcloud Oct 15, 2026
51b6b16
style(frontend): format message files with the current formatter
cpcloud Oct 15, 2026
9c2e512
fix(frontend): keep French colons from wrapping onto their own line
cpcloud Oct 15, 2026
a79ace0
fix(frontend): put the plan usage trigger gap on the spacing scale
cpcloud Oct 15, 2026
797a04d
test(codexcloud): scan decoded mirror records in the token canary
cpcloud Oct 15, 2026
5394b91
test(codexcloud): queue a readable but wrong-shaped token note
cpcloud Oct 15, 2026
655f250
fix(codexcloud): send a new chat's real creation time to plan usage
cpcloud Oct 15, 2026
8904372
fix(codexcloud): keep the peak call request-priced when compacting
cpcloud Oct 15, 2026
36c82e3
test(codexcloud): oversize the turn listing without the full view
cpcloud Oct 15, 2026
bdc3f3b
test(codexcloud): check per-listing watermarks through a full pass
cpcloud Oct 15, 2026
9391480
fix(codexcloud): show a status row for a home waiting on a login
cpcloud Oct 15, 2026
39675ad
fix(codexcloud): keep a detached daemon up while a chat is joined
cpcloud Oct 15, 2026
e69c921
test: drop three tests that other tests already cover
cpcloud Oct 15, 2026
3f6063a
test(service): stop comparing SQLite plan usage with itself
cpcloud Oct 15, 2026
20b38d3
test(codexcloud): expect compaction to keep the record before a peak
cpcloud Oct 15, 2026
1b12a3c
fix(parser): count codex-cloud chats that have no usage yet
cpcloud Oct 15, 2026
6be67a1
fix(codexcloud): rebuild the plan usage queue after losing account.json
cpcloud Oct 15, 2026
86f44bb
docs: say tokenless codex-cloud chats count as plan usage
cpcloud Oct 15, 2026
414dad3
fix(codexcloud): stop refetches with nothing new from resetting plan …
cpcloud Oct 15, 2026
3365791
refactor(codexcloud): send notLoaded directly instead of a view variable
cpcloud Oct 15, 2026
5144f96
docs: describe the daemon lease, settle timing, and state rebuild
cpcloud Oct 15, 2026
5f30c45
fix(cli): say "not checked yet" for a chat with an empty plan usage row
cpcloud Oct 15, 2026
c98bd36
test(codexcloud): give the compaction parse test a record to drop
cpcloud Oct 15, 2026
8c34c6a
docs: note that compaction underprices a long turn's other calls
cpcloud Oct 15, 2026
53ae685
fix(codexcloud): rebuild refresh roots and requeue roots changed afte…
cpcloud Oct 15, 2026
c78d9f7
fix(codexcloud): skip an unreadable chat when rebuilding the plan usa…
cpcloud Oct 15, 2026
973dcc2
fix(codexcloud): say what happens after a damaged account.json is set…
cpcloud Oct 15, 2026
7f147dd
fix(codexcloud): count items recovered after a crash as new activity
cpcloud Oct 15, 2026
8907625
fix(codexcloud): keep a failed check outstanding when account.json is…
cpcloud Oct 15, 2026
33a7237
test(codexcloud): cover failing history reads and make a rebuild test…
cpcloud Oct 15, 2026
5e1362d
fix(codexcloud): make the plan usage rebuild logs readable
cpcloud Oct 15, 2026
67785eb
docs: explain the idle daemon limit, queue rebuild, and compaction pl…
cpcloud Oct 15, 2026
9ad35f8
fix(codexcloud): count an identical plan usage answer as a fresh fetch
cpcloud Oct 15, 2026
6b531c9
fix(codexcloud): describe the rebuild summary and damaged state accur…
cpcloud Oct 15, 2026
cc88c99
fix(codexcloud): write rebuild summary counts as labels
cpcloud Oct 15, 2026
fc12335
test(codexcloud): compare change times as instants in the retry test
cpcloud Oct 15, 2026
e1d6536
fix(codexcloud): restore pending refetches when account.json is rebuilt
cpcloud Oct 15, 2026
6bf2878
test(codexcloud): catch a reply to the refresh request
cpcloud Oct 15, 2026
16bd2df
fix(codexcloud): rebuild a damaged sub-agent list instead of reading …
cpcloud Oct 15, 2026
3fac32b
feat(artifact): keep Codex cloud plan usage in artifact folder sync
cpcloud Oct 15, 2026
5cff5b1
fix(artifact): cap plan usage groups before decoding a manifest
cpcloud Oct 15, 2026
3a95dae
docs: reword the artifact sync plan usage changelog entry
cpcloud Oct 15, 2026
c051250
fix(codexcloud): keep a damaged ID list until its rebuild is saved
cpcloud Oct 15, 2026
5f7b527
test(codexcloud): drop the state JSON round-trip test
cpcloud Oct 15, 2026
3cd1f99
test(codexcloud): keep the fake host reading after a failed reply
cpcloud Oct 15, 2026
dc99acd
fix(artifact): let a future manifest wait whatever its plan usage shape
cpcloud Oct 15, 2026
5ad1bb0
fix(artifact): refuse to export more plan usage groups than import ac…
cpcloud Oct 15, 2026
b4ecfa2
test(codexcloud): read the saved list in the failed-rebuild test
cpcloud Oct 15, 2026
39c3fc4
docs: say what happens after a damaged list fails to rebuild
cpcloud Oct 15, 2026
3b603ae
test(codexcloud): prove the fake host reads on after a failed reply
cpcloud Oct 15, 2026
159c642
test(codexcloud): hold the open call instead of blocking the fake host
cpcloud Oct 15, 2026
6d20df2
fix(service): pass plan usage counts to the model comparison ranking
cpcloud Oct 15, 2026
c7cc208
fix(codexcloud): keep a lost mirror's history due after other writes
cpcloud Oct 15, 2026
3bf2fc4
fix(codexcloud): write nothing when a lost mirror's refetch fails
cpcloud Oct 15, 2026
c08b9af
fix(sync): keep a codex-cloud chat when its mirror lost history
cpcloud Oct 15, 2026
7982eb3
fix(sync): keep a refetched codex-cloud chat's live token counts
cpcloud Oct 15, 2026
3a3b5b6
test(codexcloud): end the turn while its items are read
cpcloud Oct 15, 2026
a375906
test(codexcloud): drop the monitor's copy of the no-reply check
cpcloud Oct 15, 2026
0bbd1d8
fix(sync): keep a codex-cloud chat whole while its mirror is refilled
cpcloud Oct 15, 2026
428dc8b
fix(codexcloud): start a rebuilt mirror file with the chat's listing
cpcloud Oct 15, 2026
5eb5f93
fix(sync): never replace a codex-cloud chat with an empty mirror
cpcloud Oct 15, 2026
84c71c6
fix(service): keep a plan-only model picked for usage comparison
cpcloud Oct 15, 2026
6323443
test(parser): drop a coverage check the parser never reaches
cpcloud Oct 15, 2026
b643f8d
fix(db): count plan usage sessions inside the bulk-read lane
cpcloud Oct 15, 2026
ff14387
fix(service): leave plan-only models out of the default comparison
cpcloud Oct 15, 2026
a688755
docs(codexcloud): say plainly why sync kept a saved chat
cpcloud Oct 15, 2026
8e7fe25
fix(codexcloud): make listen-in opt-in and skip chats with an active …
cpcloud Oct 16, 2026
e357339
fix(codexcloud): keep token counts and refetch history after a lost m…
cpcloud Oct 16, 2026
83988a7
fix(codexcloud): recheck the join window after the goal check
cpcloud Oct 16, 2026
ef3bece
docs: rewrap the live-capture paragraphs at 80 columns
cpcloud Oct 16, 2026
7e05d55
docs(codexcloud): record that the hosted server answers thread/goal/get
cpcloud Oct 16, 2026
eab673d
fix(codexcloud): share the lost-mirror rules with the hub and keep pl…
cpcloud Oct 16, 2026
420c02f
fix(codexcloud): keep newest token counts and plan figures after part…
cpcloud Oct 16, 2026
58d7692
fix(codexcloud): fetch a stalled chat again after its mirror is lost
cpcloud Oct 17, 2026
a32f9cd
fix(codexcloud): keep newer saved usage when a mirror file is cut short
cpcloud Oct 17, 2026
7a7b1e2
test(codexcloud): drop a duplicate test and an impossible lease step
cpcloud Oct 17, 2026
1d3935b
fix(codexcloud): keep a sub-agent counted under a parent whose mirror…
cpcloud Oct 17, 2026
0a435f1
fix(codexcloud): keep the saved final mark when a cut file has the sa…
cpcloud Oct 17, 2026
dfe7c4d
fix(codexcloud): let a repeated report clear a left_out outcome
cpcloud Oct 17, 2026
aa6b7e1
test(parser): drop a duplicate codex-cloud usage test
cpcloud Oct 17, 2026
c3e6184
fix(codexcloud): let a parsed plan report win over the saved one
cpcloud Oct 17, 2026
9c18fec
fix(codexcloud): requeue a root whose mirror file is gone during a re…
cpcloud Oct 17, 2026
3a63d0b
refactor(codexcloud): share the rule that clears a stall mark
cpcloud Oct 17, 2026
e3e44f6
fix(usage): count a never-captured sub-agent's turns as missed
cpcloud Oct 17, 2026
4608d6b
fix(codexcloud): name CODEX_HOME in the login step for a custom daemo…
cpcloud Oct 17, 2026
c36347a
test(parser): drop a repeated assertion in the outcome reparse test
cpcloud Oct 17, 2026
7aa7910
fix(codexcloud): take a rebuilt file's outcome without comparing clocks
cpcloud Oct 17, 2026
2b47f98
test: expect a tokenless sub-agent's turns in combined usage
cpcloud Oct 17, 2026
9eb8db6
test(codexcloud): compare the custom CODEX_HOME as a cleaned path
cpcloud Oct 17, 2026
667381b
fix(postgres): derive hub signals after carrying saved Codex cloud usage
cpcloud Oct 17, 2026
f8689c0
fix(codexcloud): fetch a chat again when a rebuild finds its mirror gone
cpcloud Oct 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,8 @@ test-postgres: pricing-snapshot ensure-embed-dir postgres-up
-run 'TestRawSync.*CleanUploads|TestRawSyncBackfill|TestHostedRuntimeHealthRequiresStatusToken|TestReplicaRecipeQueryWithoutConfig' -count=1
TEST_PG_URL="postgres://agentsview_test:agentsview_test_password@localhost:5433/agentsview_test?sslmode=disable" \
CGO_ENABLED=1 go test -tags "fts5,pgtest" -v ./internal/postgres/... ./internal/activity/... -count=1 -timeout=20m
TEST_PG_URL="postgres://agentsview_test:agentsview_test_password@localhost:5433/agentsview_test?sslmode=disable" \
CGO_ENABLED=1 go test -tags "fts5,pgtest" -v ./internal/service -run '^TestPlanUsageCountsParity$$' -count=1

# PostgreSQL integration tests for CI (postgres already running as service)
POSTGRES_CORE_HEAVY_TEST := TestRawProjectionProofLookupsStayBounded
Expand All @@ -429,6 +431,7 @@ test-postgres-core-ci:

test-postgres-core-fast-ci: pricing-snapshot ensure-embed-dir
CGO_ENABLED=1 go test -tags "fts5,pgtest" -v ./internal/postgres/... ./internal/activity/... -skip '^$(POSTGRES_CORE_HEAVY_TEST)$$' -count=1 -timeout=20m
CGO_ENABLED=1 go test -tags "fts5,pgtest" -v ./internal/service -run '^TestPlanUsageCountsParity$$' -count=1

test-postgres-core-heavy-ci: pricing-snapshot ensure-embed-dir
CGO_ENABLED=1 go test -tags "fts5,pgtest" ./internal/postgres/... -list '^$(POSTGRES_CORE_HEAVY_TEST)$$' | grep -Fx '$(POSTGRES_CORE_HEAVY_TEST)'
Expand All @@ -448,10 +451,13 @@ test-clickhouse: pricing-snapshot ensure-embed-dir clickhouse-up
@sleep 2
TEST_CLICKHOUSE_URL="clickhouse://localhost:19000/default" \
CGO_ENABLED=1 go test -tags "fts5,chtest" -v ./internal/clickhouse/... ./internal/activity/... -count=1 -timeout=20m
TEST_CLICKHOUSE_URL="clickhouse://localhost:19000/default" \
CGO_ENABLED=1 go test -tags "fts5,chtest" -v ./internal/service -run '^TestPlanUsageCountsParity$$' -count=1

# ClickHouse integration tests for CI (clickhouse already running as service)
test-clickhouse-ci: pricing-snapshot ensure-embed-dir
CGO_ENABLED=1 go test -tags "fts5,chtest" -v ./internal/clickhouse/... ./internal/activity/... -count=1 -timeout=20m
CGO_ENABLED=1 go test -tags "fts5,chtest" -v ./internal/service -run '^TestPlanUsageCountsParity$$' -count=1

# S3 discovery integration tests. testcontainers starts and tears down a
# rustfs (S3-compatible) container automatically, so only a working Docker
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ local Amp thread JSON files.
| OpenClaude | `~/.openclaude/projects/` |
| Claude Cowork | `~/Library/Application Support/Claude/local-agent-mode-sessions/` (macOS) |
| Codex | `~/.codex/sessions/` |
| Codex Cloud | Fetched from OpenAI (ChatGPT dot, Codex web and cloud tasks); off until `[agents.codex-cloud] enabled = true` |
| Copilot CLI | `~/.copilot/` |
| Devin CLI | `~/.local/share/devin/` (Linux), `~/Library/Application Support/devin/` (macOS); point `DEVIN_DIR` / `agents.devin.dirs` at the root that contains `cli/` |
| Evener | `~/.local/state/evener/projects/` (or `$XDG_STATE_HOME/evener/projects/`; semantic transcript v2) |
Expand Down
39 changes: 29 additions & 10 deletions cmd/agentsview/archive_query_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type archiveQueryPolicy struct {

type archiveQueryBackend interface {
ActivityReport(context.Context, ActivityReportConfig) (activity.Report, error)
DailyUsage(context.Context, dailyUsageQuery) (db.DailyUsageResult, error)
DailyUsage(context.Context, dailyUsageQuery) (dailyUsageReport, error)
SessionUsage(context.Context, sessionUsageQuery) (*sessionUsageOutput, int, error)
MachineLabels(context.Context) (service.MachineLabelCatalog, error)
}
Expand All @@ -54,6 +54,15 @@ type sessionUsageQuery struct {
NoSync bool
}

// dailyUsageReport is a daily usage result plus the sessions its token and
// cost totals leave out as billed to plan usage and the sessions whose
// token counts miss turns live capture did not see.
type dailyUsageReport struct {
db.DailyUsageResult
PlanOnlySessions int
PartlyCapturedSessions int
}

type dailyUsageQuery struct {
Progress func(string)
Filter db.UsageFilter
Expand Down Expand Up @@ -217,7 +226,7 @@ func (b daemonArchiveQueryBackend) ActivityReport(
func (b daemonArchiveQueryBackend) DailyUsage(
ctx context.Context,
query dailyUsageQuery,
) (db.DailyUsageResult, error) {
) (dailyUsageReport, error) {
return fetchHTTPDailyUsage(ctx, b.tr, b.authToken, query)
}

Expand Down Expand Up @@ -257,7 +266,7 @@ func (b localArchiveQueryBackend) ActivityReport(
func (b localArchiveQueryBackend) DailyUsage(
ctx context.Context,
query dailyUsageQuery,
) (db.DailyUsageResult, error) {
) (dailyUsageReport, error) {
ensureFreshData(ctx, b.cfg, b.database, b.skipFreshData)
ensureUsagePricing(
b.database, b.offline, b.cfg.CustomModelPricing,
Expand All @@ -266,9 +275,21 @@ func (b localArchiveQueryBackend) DailyUsage(
var err error
filter.Machine, err = db.ResolveMachineFilter(ctx, b.database, filter.Machine)
if err != nil {
return db.DailyUsageResult{}, err
return dailyUsageReport{}, err
}
result, err := b.database.GetDailyUsage(ctx, filter)
if err != nil {
return dailyUsageReport{}, err
}
planUsage, err := b.database.GetPlanUsageSessionCounts(ctx, filter)
if err != nil {
return dailyUsageReport{}, err
}
return b.database.GetDailyUsage(ctx, filter)
return dailyUsageReport{
DailyUsageResult: result,
PlanOnlySessions: planUsage.PlanOnly,
PartlyCapturedSessions: planUsage.PartlyCaptured,
}, nil
}

func (b localArchiveQueryBackend) MachineLabels(
Expand Down Expand Up @@ -386,11 +407,9 @@ func (b localArchiveQueryBackend) SessionUsage(
u.Agent = string(def.Type)
}
}
return &sessionUsageOutput{
SessionUsage: *u,
ServerRunning: false,
RefreshIncomplete: refreshIncomplete,
}, usageExitCode(u), nil
out := newStoreSessionUsageOutput(u)
out.RefreshIncomplete = refreshIncomplete
return out, usageExitCode(out), nil
}

func closeArchiveQueryBackend(cleanup func()) {
Expand Down
136 changes: 136 additions & 0 deletions cmd/agentsview/codex_cloud_jobs.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
package main

import (
"context"
"errors"
"log"
"os"
"path/filepath"
"sync/atomic"
"time"

"go.kenn.io/agentsview/internal/codexcloud"
"go.kenn.io/agentsview/internal/config"
"go.kenn.io/agentsview/internal/poller"
"go.kenn.io/agentsview/internal/server"
)

const (
codexCloudSyncJobName = "codex-cloud-sync"
codexCloudSyncInterval = 5 * time.Minute
codexCloudSyncJitter = 30 * time.Second
codexCloudLiveJobName = "codex-cloud-live"
codexCloudLiveInterval = 30 * time.Second
codexCloudLiveJitter = 5 * time.Second
)

// newCodexCloudSyncer builds the thread syncer. load re-reads config.toml
// before each run, so a hand edit to [agents.codex-cloud], disabled_agents,
// or [agents.codex] homes takes effect without a restart. cfg.NoSync is
// fixed at start: it is set by --no-sync and by an archive-only archive.
func newCodexCloudSyncer(
cfg config.Config, load func() (config.Config, error), status *codexcloud.StatusBoard,
) *codexcloud.Syncer {
userHome, err := os.UserHomeDir()
if err != nil {
// DiscoverHomes then falls back to CODEX_HOME and configured homes.
log.Printf("codex-cloud: home directory: %v", err)
}
return &codexcloud.Syncer{
Store: codexcloud.NewStore(filepath.Join(cfg.DataDir, "sources", "codex-cloud")),
Waits: codexcloud.NewWaits(time.Now),
Status: status,
Now: time.Now,
Dial: codexcloud.Dial,
Gates: codexcloud.NewGateSource(
filepath.Join(cfg.DataDir, "config.toml"), cfg, load, os.Getenv, userHome,
),
NoSync: cfg.NoSync,
ReadLogin: codexcloud.ReadLogin,
Version: version,
Log: log.Default(),
}
}

// codexCloudSyncJob registers each pass as tracked work, so an idle
// daemon waits for a running import instead of cutting it off.
func codexCloudSyncJob(sync *codexcloud.Syncer, idle *server.IdleTracker) poller.Job {
return poller.Job{
Name: codexCloudSyncJobName,
Interval: codexCloudSyncInterval,
Jitter: codexCloudSyncJitter,
RunAtStart: true,
Run: func(ctx context.Context) error {
done, ok := idle.BeginWork()
if !ok {
return nil
}
defer done()
return sync.Run(ctx)
},
}
}

// newCodexCloudMonitor builds the live token monitor. It shares the
// syncer's state store, whose per-account lock keeps the two jobs' writes
// apart, and its waits, which both jobs honor. trigger queues a sync run
// after a joined turn completes. Each joined thread holds an idle work
// lease until it leaves, so an idle daemon does not exit mid-capture.
func newCodexCloudMonitor(
sync *codexcloud.Syncer, trigger *codexCloudTrigger, idle *server.IdleTracker,
) *codexcloud.Monitor {
return &codexcloud.Monitor{
Store: sync.Store,
Waits: sync.Waits,
Status: sync.Status,
Now: sync.Now,
Dial: sync.Dial,
Gates: sync.Gates,
NoSync: sync.NoSync,
ReadLogin: sync.ReadLogin,
Trigger: trigger.Trigger,
BeginWork: idle.BeginWork,
Version: sync.Version,
Log: sync.Log,
}
}

// codexCloudLiveJob finds running threads for the monitor. Joined threads
// stay open after a run returns; the monitor owns them and their work
// leases.
func codexCloudLiveJob(m *codexcloud.Monitor, idle *server.IdleTracker) poller.Job {
return poller.Job{
Name: codexCloudLiveJobName,
Interval: codexCloudLiveInterval,
Jitter: codexCloudLiveJitter,
RunAtStart: true,
Run: func(ctx context.Context) error {
done, ok := idle.BeginWork()
if !ok {
return nil
}
defer done()
return m.Discover(ctx)
},
}
}

// codexCloudTrigger queues a sync run on a scheduler set after the jobs
// start, since the monitor is built before the scheduler exists.
type codexCloudTrigger struct {
scheduler atomic.Pointer[poller.Scheduler]
}

// Trigger queues one sync run. A run already queued covers this request,
// so several turns completing together add at most one run.
func (t *codexCloudTrigger) Trigger() error {
s := t.scheduler.Load()
if s == nil {
return nil
}
err := s.TriggerNow(codexCloudSyncJobName)
if errors.Is(err, poller.ErrTriggerPending) {
return nil
}
return err
}
Loading