Repository navigation
Persist spending charges and enforce parent chat caps for helper summaries - #703
Conversation
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes across spending persistence, desktop/phone allowance coordination, and helper compaction accounting.
- Ordered persistence: Ledger mutations await serialized saves, with failed snapshots retained for a later write or flush.
- Shared allowances: Desktop Allow more validates the displayed allowance inside the same ledger mutation used by Remote, preventing crossed taps from granting twice.
- Helper summary caps: Paid compaction summaries count toward the parent chat and settle before the next summary or reply dispatch.
- Coverage and docs: Reviewed the regression tests, spending documentation, and unchanged iOS/Android conflict-handling consumers.
Validation: 285 focused tests and npm run type-check passed. The helper/compaction suites required npm run build:vcc before passing. Android native testing timed out after 120000 ms; iOS XCTest could not run on this Linux runner.
gpt-6.1-sol | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes in 889dacb7a since the prior review at 5af234126, scoped to the Bot-browser test-oracle correction.
- Extracted the leak scanner: Shared the existing snapshot-string scanner between the native fixture and its focused test without changing production masking or spending behavior.
- Excluded fixture-origin collisions: Removed the exact loopback origin only from root accessibility URL properties, retaining checks on URL suffixes and all other scanned content.
- Added boundary coverage: Verified that paths, queries, fragments, unrelated URLs, selectors, accessible names, field values, and visible text still report secrets.
Validation: the new oracle test, 12 credential-boundary tests, E2E TypeScript, and targeted ESLint passed. The native Electron case aborted before assertions with The SUID sandbox helper binary was found, but is not configured correctly. Required Linux setup was unavailable because sudo reported that the "no new privileges" flag is set. Exact-head hosted CI remains pending.
gpt-6.1-sol | 𝕏
Main's dispatch ledger replaces this branch's save queue, and main's unique table code replaces its leak check helper. What remains is the desktop Allow more notice check and metering of helper summaries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes since the previous Pullfrog integration check at c1040f034, focusing on the merge of current main and its interaction with helper-summary accounting.
- Adopted durable publication: Replaced the branch-local save queue with main’s dispatch-ledger publication and reconciliation semantics while retaining restart coverage.
- Preserved helper accounting: Confirmed ordinary summaries settle through the parent chat meter and transformed Bot/routine helpers remain charged exactly once through task-owned Bot/root scopes.
- Removed obsolete fixture code: Dropped the Bot-browser leak helper after main made the fixture secret collision-resistant, without changing production masking.
- Reconciled documentation and tests: Updated the spending memory and guide to match the current durable ledger and summary-cap behavior.
Validation: npm run test:spending passed 36 tests, the two focused paid-helper-summary cases passed, and npm run type-check passed.
@v0 or keep the SHA fresh with Dependabot | View workflow run | Using GPT Sol | 𝕏

Findings 3.3–3.5 (P2)
Local checks
The spending (22), usage-limit (31), helper/compaction/Bot pane (231), and focused Remote router (1) tests passed. iOS spending passed 3 tests and Android spending passed 4. TypeScript, targeted ESLint, and the process-kill fixture passed. Provider fixtures ran locally.
CI history: run 41530074224
On head
5af234126, Electron E2E shard 3/3 exceeded its existing 20-minute job budget after starting 105 of 117 tests. The last started case wastests/e2e/workspace-panel.spec.ts:101; no test assertion failure or flake was reported before cancellation. The required aggregate consequently failed. One recovery of this job and its dependent gates was requested without changing any timeout, retry or flaky-test policy. This records a job-budget failure, not a failed-test assertion rerun. Original jobCI recovery result — 2026-11-02
The one accepted recovery of Electron E2E (3/3) completed the shard but failed
--fail-on-flaky-tests:tests/e2e/bot-browser.spec.ts:22, assertion at line 109 (result.tableSeen.leaked), expected[], received["737"]. The built-in retry passed; the cause remains under investigation and is not claimed fixed by the spending patch. Recovery run/job, exact head5af234126d0d3ebed42dd1ecdce44cdfbb396773.The original attempt hit its job execution budget after 105/117 tests had started; that separate timeout history is retained above. No additional manual rerun will be requested. Retry, timeout and fail-on-flaky policies are unchanged.
Masking-flake investigation checkpoint
A read-only real Electron probe reproduced a pre-existing fixture false positive: the snapshot's document URL
http://127.0.0.1:49737/card-tablecontains the synthetic secret fragment737in its random port. Changing the masked field to954retained only that port match; using port49738removed it. Ordinary visible737text and an unmasked954control were correctly detected. Secret-value locator probes for both correct and incorrect guesses timed out while ordinary Pay/Password controls worked. All 36 focused Bot-browser tests passed; 104 compared inputs were identical on main9b2875d65and this PR.The failed CI retained the assertion but no raw snapshot, so its exact matching field cannot be confirmed. A narrow fixture-oracle correction is queued; no source changes or hosted rerun were made during investigation. Product masking is not claimed proven by a passing retry alone.
Test-only correction at 889dacb
The Bot browser E2E now removes the exact loopback origin from the root accessibility document URL before comparing snapshot strings to fixture secrets. The check still scans the URL path, query and fragment, element selectors, accessible names, field values, visible text and other URLs. This correction changes three test files. The production masking boundary and spending implementation are unchanged by this commit.
Five real Electron probes in a local Cua Space checked ports 49737 and 49738, changing the card field from 737 to 954, adding visible 737 text, and putting 737 in the document query. The colliding port no longer triggered a match. Visible text and query still triggered one, and the unmasked control still reported 954. Both cases in the Bot browser Playwright spec passed with retries disabled in its Linux container mode (16.5 s). The first ordinary-user Cua run hit a Chromium seccomp failure during the earlier login masking step, before the table check. The 36 focused Bot browser tests, 12 credential-boundary tests, E2E TypeScript and targeted ESLint passed.
The earlier CI artifact retained no raw snapshot. The exact field behind that hosted match is unknown. The new commit was pushed normally to trigger a fresh exact-head run.
New Linux E2E failures at 889dacb
Linux build x64 job reached Electron E2E: 277 passed, 9 skipped, 2 failed.
tests/e2e/interrupted-question-resume.spec.ts:151failed at line 197 because the saved-approval[data-interrupted-reply]card was absent after 15 seconds.tests/e2e/workspace-settings.spec.ts:32failed at line 80 because the second provider request stayed empty after 10 seconds. These are distinct from the earlier masking false positive. Product-versus-fixture attribution is under investigation; no manual rerun has been attempted for this job. No timeout, retry or fail-on-flaky policy was changed.Linux reproduction and dependency on #718
The two failures above also reproduced independently of this spending change. On
mainatc975f6e77, forcing desktop draft UUIDd2492706-6417-42f1-974d-0c12a2fad0b4reproduced both original assertions and the earlier Snooze approval failure. Each showed the chat-load notice. The hosted runs did not retain their UUIDs. The read-only N=20,000 UUID probe found 50 false rejections by the child identifier validator.PR #718 fixes the local ownership boundary and preserves the strict child privacy controls. This PR is based on that branch. Regular merges preserved prior head
889dacb7aand brought in main's Remote revision 53 and the reviewed fixc5d372c3f. The stacked 15-file diff has the same stable Git patch ID as the previously reviewed spending and masking changes.On integration head
c1040f034, the three original Electron cases passed with ordinary UUIDs (27.5 s), then with the forced UUID (26.1 s); both Bot-browser masking E2Es passed (16.6 s). All used local fixtures, one worker and zero retries. The 291 chat identity/lifecycle, 231 helper/compaction/Bot pane, 22 spending and 31 usage-limit tests passed, along with desktop and E2E TypeScript and targeted ESLint. The earlier intermediate local run with a fixture relaunch GC error is recorded in #718. No hosted job was retried for this investigation.Merge with main, 2026-11-06
Main gained the durable dispatch ledger (
1ed6dfb6d), which supersedes finding 3.3 here: every mutation is published before it completes, andallowMoreIfis already on the service. I took main'sspending-service.tsand dropped this branch's save queue and its "failed write retains the charge" test, because main rejects a failed save and refuses the next dispatch instead. Main also made the Bot browser leak fixture unique (zq737), sotests/e2e/bot-browser-leak-check.tsis gone.This PR now carries only the desktop Allow more notice check (3.4) and helper summary metering (3.5), plus the restart test.
Locally,
forked initial context respects zero recent model budget before the first provider requestfails the same way on a cleanorigin/main, so it is not from this PR.