feat(browser): add opt-in export of saved browser files - #419
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 7, 2026, 12:23 PM ET / 16:23 UTC. ClawSweeper reviewWhat this changesAdds a browser-only flag to export captured files beside the saved answer, with collision protection, integrity checks, persisted warnings, documentation, and CLI proof coverage. Merge readiness✅ Ready for maintainer review This remains useful work absent from current main. The maintainer-supported opt-in design resolves the earlier compatibility concern, and no blocking defect was found. Priority: P2 Review scores
Verification
How this fits togetherOracle’s browser runner captures ChatGPT answers and downloadable files into session storage. The CLI now optionally copies those captured files into the user’s answer-output directory while retaining the originals. flowchart TD
A[Browser response] --> B[Canonical captured files]
C[CLI output options] --> D{Artifact export enabled?}
B --> D
D -->|No| E[Answer-only output]
D -->|Yes| F[Copy without overwriting]
F --> G[Verify size and hash]
G --> H[Export metadata or non-fatal warning]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Retain the opt-in export contract and existing capture pipeline, with release notes following through #464. Do we have a high-confidence way to reproduce the issue? Not applicable as a bug reproduction: this adds an explicit export capability, and the recorded built-CLI/Chrome scenarios exercise its observable filesystem behavior. Is this the best way to solve the issue? Yes. Reusing captured files behind an explicit flag is a narrow approach that preserves existing output behavior and avoids a second downloader. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 176cec67c4ef. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
Preserve answer-only --write-output behavior. Add --write-artifacts for browser runs, persist the option, retain canonical captures, and verify adjacent binary copies without overwriting existing files. Keep copy failures visible as warnings. Prove actual CLI capture and export using real Chrome with synthetic sandbox responses, including defaults, collision preservation, and filesystem failures. Co-authored-by: gwelinder <gwelinder@gmail.com>
|
Maintainer repair verified at The public default is preserved: --write-output writes only the answer. Explicit --write-artifacts requires a browser run and an output path, persists with the session, and exports captured files without overwriting existing destination files. Validation: 2,118 tests passed, 45 skipped; lint/typecheck/build/docs passed. The actual built CLI and real Chrome captured a synthetic sandbox binary through the existing browser fetch and canonical artifact pipeline. Default, opt-in, collision, and real POSIX permission-failure cases passed: one send/download each, preserved original captures, identical exported bytes and SHA-256, retained collision sentinel, and a persisted warning on copy failure. The fixture binary SHA-256 is dd927876d1d66c05f4b28dea75cbf2d687e4a669aec79765b6fb80cd836d8283. Invalid API and missing-output flag combinations were also rejected. Unproven here: a fresh signed-in ChatGPT generated-file download, current authentication/cookie and signed-URL behavior, and live remote-host artifact transfer. Synthetic responses were intercepted locally in an isolated signed-out browser. Windows permission-failure behavior has mocked coverage; the real permission case runs on POSIX. Thanks @gwelinder. Contributor history and human credit are preserved. The deferred changelog line is in the PR body, with no branch changelog delta. No merge or release was performed. |
Co-authored-by: gwelinder <gwelinder@gmail.com>
|
Current-main integration verified at 48ba4f8, based on main 176cec6. Contributor history and human credit are preserved. All four exact-head CI jobs passed: https://github.com/steipete/oracle/actions/runs/34141654890. Local and final branch autoreview through P2 are clean. Validation: pnpm test (2,171 passed, 45 skipped), lint/build/docs, and the actual built-CLI artifact export, 27-case attachment, and effort-evidence matrices passed. The export regression now explicitly checks that thinkingSelection survives successful copying and copy warnings. The real Chrome file proof preserves default answer-only output, binary hashes, collision sentinels, original captures, and non-fatal POSIX copy-failure warnings. Unproven: fresh signed-in generated-file downloads, cookie/signed-URL behavior, and live remote-host artifact transfer. All provider responses were synthetic. The four deferred notes are in #464, which must land after this PR and #400. No merge or release performed. |
Integrate opt-in saved-file export with current main after #431 and #397 landed. Preserve both thinking-selection evidence and artifact-copy warnings in session metadata, including copy-failure paths.
The default remains answer-only --write-output. Explicit --write-artifacts requires browser mode and an output path, preserves canonical captures, verifies copied bytes/hashes, avoids collisions, and records non-fatal copy warnings.
Validation on current main: 2,171 tests passed, 45 skipped; lint/build/docs passed. Actual built-CLI/Chrome artifact export, all 27 attachment cases, and the effort-evidence/serve bridge matrix passed. Local and final branch P2 autoreview are clean. Exact-head CI is linked in the proof comment.
Signed-in generated-file downloads, current cookie/signed-URL behavior, and live remote-host artifact transfer remain unproven. Provider pages and files used here were synthetic. Contributor history was preserved with a merge of main and a fast-forward push.
Deferred changelog (carried by #464): Browser: optionally export captured downloadable files beside --write-output with --write-artifacts, preserving canonical artifacts, validating hashes, and avoiding filename collisions; thanks @gwelinder.