Repository navigation
feat(browser): operationalize canonical capture missions - #2926
Conversation
Problem External Chat work could be stranded after browser turnover, monitor every submitted conversation in bursts, lose terminal output assets, or retry an ambiguous submit boundary. What changed Make the receiver own submission and monitor leases, global pacing, typed provider outcomes, terminal handoff reconciliation, and uncertainty quarantine. Generate readable per-job deliverable names and keep the prompt inside the deterministic context package byte-identical to the submitted prompt. Verification devtools test tests/unit/browser_capture/test_launch_jobs.py devtools test tests/unit/browser_capture/test_launch_jobs.py tests/unit/browser_capture/test_work_package.py tests/unit/browser_capture/test_receiver.py devtools verify --quick Ref polylogue-yyvg.5. Ref polylogue-5k5l. Ref polylogue-jlme.5. Co-Authored-By: Claude <[email protected]>
Problem The installed extension could silently run stale code, strand completion monitoring in a browser profile, miss output assets after tabs closed, and show an inert or misleading popup with no trustworthy receiver identity. What changed Use one extension-owned inactive authenticated transport, serialize provider operations, reuse native terminal payloads for canonical capture, and route ordinary/backfill/launched conversations through the same asset path. Add stable receiver pairing, offline snapshots, typed operator states, ambient in-page evidence, and an executable mission-control popup. Verification npm test (296 tests) npm run lint Packaged service-worker fixture exercises background capture without foreground activation. Live extension reloaded against receiver rx-e328a27cc0d16cfbac83. Ref polylogue-jlme.6. Ref polylogue-yyvg.5. Ref polylogue-jlme.5. Ref polylogue-5k5l. Co-Authored-By: Claude <[email protected]>
Persist the capture incident receipts, Sol handoff integration state, provider-neutral mission protocol follow-up, and honest residual scope for receiver pairing, asset coverage, and portfolio automation. Graph lint reports no dependency cycles, duplicate labels, horizon inversions, or missing acceptance criteria. Ref polylogue-yyvg.5. Ref polylogue-yyvg.6. Ref polylogue-jlme.5. Ref polylogue-jlme.6. Ref polylogue-5k5l. Co-Authored-By: Claude <[email protected]>
|
Warning Review limit reached
Next review available in: 53 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (31)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
## Summary Closes `polylogue-jlme.6` after PR #2926 merged the complete popup execution and receiver-health recovery. ## Problem The Bead intentionally remained open until the implementation branch and its live proof were durable on master. ## Solution Record all five acceptance criteria as satisfied by merged commit `54e8911b9`: executable popup load order, authenticated receiver health/pairing, toolbar refresh, regression fixtures, and installed-extension canonical recovery. ## Verification - PR #2926 merged. - Browser-extension suite: 296 passed; lint clean. - Quick verification: all 16 steps passed. - Beads graph lint: no dependency cycles; zero duplicate labels, horizon inversions, or missing ACs. Ref polylogue-jlme.6. Co-authored-by: Claude <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
polylogue/browser-extension/src/background.js
Line 1854 in ef2e25e
When the exact capture contains the expected handoff bytes, posting it to /v1/browser-captures synchronously runs reconcile_launch_handoff_capture(), which marks the job completed (or paused for an invalid ZIP) and clears lease_owner. This subsequent updateLaunchJob() therefore always receives a lease-owner mismatch; its catch block attempts another update with the same stale owner, so the poll rejects and the successful handoff capture log is never written. Record the pending-acquisition phase before sending the canonical capture, or avoid further lease-owned updates once reconciliation has made the job terminal.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
chatgpt-dom-v1 attachment byte acquisition (this branch, commit above) closes the only remaining gap this bead scoped -- the general chatgpt-native-v1 sandbox/file-service asset acquisition already shipped in earlier PRs (#2669/#2672/#2712/#2926). Hand-merged the one touched record from a fresh `bd export` rather than copying the whole file: bd resolves its export target independent of invocation cwd, so it also carries unrelated concurrent-session bead activity that doesn't belong on this branch. Co-Authored-By: Claude <[email protected]>
…e page bridge (#3075) ## Summary Closes the last remaining gap in `polylogue-83u.3`: the `chatgpt-dom-v1` DOM-scrape capture fallback now fetches attachment bytes through the same authenticated page-bridge mechanism the native adapter already uses, instead of recording only the chip name with `byte_count=0`. ## Problem General ChatGPT attachment fetching already ships: `chatgpt_bridge.js` (`fetchAssetBytes`) and `chatgpt.js` (`acquireAssets`/`collectAssetDescriptors`) live-fetch sandbox/file-service bytes for the normal `chatgpt-native-v1` capture path (landed PR #2669, hardened #2672/#2712/#2926). The only remaining gap is the older `chatgpt-dom-v1` fallback — used only when the authenticated backend-api conversation read fails — which had **no acquisition path at all**: `collectAttachments` recorded just the chip's name. ## Architecture constraint `chatgpt-dom-v1` has no backend-api `mapping` to resolve a file/sandbox id from (unlike `chatgpt-native-v1`); the DOM chip's own `href`/`src` is the only evidence available, and it is sometimes already a concrete `https://` URL the page itself rendered (e.g. an inline `<img src>`). ## Solution Added a `"url"` request kind to `chatgpt_bridge.js`'s `fetchAssetBytes` that skips the metadata round trip entirely and reuses the **exact same** fetch+budget+hash mechanism already proven for the `sandbox`/`file` kinds (refactored the shared tail into `fetchBytesFromResolvedUrl`), including the existing cross-origin credential-drop rule (never forward page cookies/bearer to a provider-issued or DOM-rendered cross-origin URL). `chatgpt.js`'s `collectTurns` now awaits a new `acquireDomAttachmentBytes` step — budget-bounded identically to the native path (same per-file/total-byte/time/consecutive-failure caps) — that requests those bytes and sets `inline_base64` on the DOM attachment. That is the exact field `polylogue/sources/parsers/browser_capture.py` already decodes into `ParsedAttachment.inline_bytes` for every adapter, so **no receiver/parser change was needed** — `inline_base64` is not a new payload field, just one `chatgpt-dom-v1` was never wired to populate. Chips with no resolvable URL stay honestly `byte_count=0`. ## Consistency with polylogue-ptx `polylogue-ptx` (PR #2928, merged) replaced the extension's browser-action/campaign machinery with a provider-neutral `BrowserAction` conduit. This change only extends the existing content-script/bridge byte-fetch mechanism at its one documented gap; it does not touch, duplicate, or compete with the `BrowserAction` conduit's submit/receipt machinery. ## Verification - `cd browser-extension && npx vitest run` → **329 passed** (1 pre-existing unrelated failure in `build.test.js`'s packaged-service-worker backfill fixture — reproduces identically without this change) - `npx eslint src/ tests/` → clean - `node scripts/validate-manifest.mjs` → ok - New coverage: 5 focused `fetchAssetBytes` `"url"`-kind tests (direct fetch, cross-origin credential drop, same-origin credential keep, non-https rejection, byte-cap enforcement) plus 2 full-capture DOM-fallback smoke tests (`chatgpt_bridge.test.js`) executing the real production sources through a simulated authenticated page, proving a `chatgpt-dom-v1` capture now yields `inline_base64` whose SHA-256 exactly matches the delivered bytes, and that a chip with no fetchable URL stays honestly `byte_count=0`. Ref polylogue-83u.3 Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Makes browser-backed external work receiver-authoritative and observable: one
cross-profile submission lease, globally paced completion monitoring, canonical
closed-tab capture with output-byte validation, stable receiver pairing, and a
working mission-control/ambient status surface.
Problem
The live Sol campaign exposed several coupled failures. Submitted chats were
stranded by browser/profile turnover, one service worker read every submitted
conversation each minute, terminal captures often predated output assets, the
same conversation was read twice at completion, ambiguous submit failures
could become duplicates, stale receiver configuration rendered the popup inert,
and completed jobs could retain stale global cooldowns. The provider then
showed conversation-access protection /
too many requestswhile the receiverledger falsely remained
submitted.Solution
cadence, typed provider outcomes, submit-uncertainty quarantine, and handoff
validation.
monitor reads globally across all extension instances.
operations; operator tabs are never borrowed or activated.
capture, then acquire and validate the exact output asset without a duplicate
conversation read.
prompt/link/file-manifest self-checks; the context pack
PROMPT.mdis pinnedbyte-identical to the submitted prompt.
snapshots, restore the popup execution path, and expose shared operator states
in popup and isolated ambient surfaces.
Acceptance matrix
polylogue-jlme.6: satisfied by executable popup load-order tests, stablehealth/pairing, installed-extension proof, queue rendering, and live canonical
recovery. Close after merge.
polylogue-yyvg.5: substantial foundation delivered; intentionally remainsopen for the provider-neutral mission protocol and automatic simplified UX.
polylogue-jlme.5: stable pairing/owned transport delivered; packagedtwo-authenticated-profile/canonical-failover proof remains open.
polylogue-5k5l: live sandbox byte acquisition is proven; file-serviceimage/audio and remaining stated criteria remain open.
polylogue-yyvg.6: prompt/filename upstream hardening and durable protocoldesign are recorded; portfolio projection and incorporation automation remain
open.
Verification
devtools test tests/unit/browser_capture/test_launch_jobs.py tests/unit/browser_capture/test_work_package.py tests/unit/browser_capture/test_receiver.py— 77 passed.npm test— 296 passed across 14 files.npm run lint— clean.devtools verify --quick— all 16 steps passed; final pre-push run20260716T043957Z-quick-3925811-1a487d27..agent/scripts/bd-graph-lint— no cycles; zero duplicate labels, horizon inversions, or missing ACs.launch starvation, typed auth errors, transport ownership, duplicate terminal
reads, submit-boundary uncertainty, stale terminal cooldowns, and test gaps.
chatgpt/6a5830bc-0d94-83ed-8d4f-6136a748bc19-76bfadd9563a.json,63 turns, three attachments; output ZIP 81,240 bytes, 19 files, SHA-256
7fa320242b2c6aa6a92e3eada4299e8355a8628eefc41cb4846327f1c6205080,byte-identical to the operator download.
Ref polylogue-yyvg.5.
Ref polylogue-jlme.6.
Ref polylogue-jlme.5.
Ref polylogue-5k5l.
Ref polylogue-yyvg.6.