Skip to content

v1.91.4.0 fix: Windows Opera cookie import wave (#2980, refs #2957) - #2987

Merged
garrytan merged 9 commits into
mainfrom
wave/cookie-import-opera
Sep 28, 2026
Merged

garrytan merged 9 commits into
mainfrom
wave/cookie-import-opera

Conversation

@garrytan

@garrytan garrytan commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Windows Opera and Opera GX cookie import, brought to release quality as one fix wave for the cookie-import feature. It includes Matt Van Horn's #2980 commit (authorship preserved) plus the fixes an /autoplan review (CEO → DX → Eng, each with a native Claude reviewer and a GPT-6 Astra outside reviewer) turned up. Refs #2957.

What changed

Opera support (from #2980). cookie-import-browser opera / opera-gx on Windows read %APPDATA%\Opera Software\Opera Stable or Opera GX Stable (Default / Profile N, Network/Cookies then Cookies), with a separate DPAPI key per browser. Other browsers stay on the Local root. operagx is accepted as an alias.

Windows v10 decryption fix (all Chromium browsers). Chromium cookie DBs at meta version 24+ put SHA-256(host_key) in front of the encrypted value. The Windows AES-GCM path returned it as part of the cookie, so an import could report success while the site stayed signed out. The prefix is now dropped only when it matches the host digest (bare values from older DBs are unchanged). This also affects Chrome, Chromium, Edge and Brave v10 cookies.

App-Bound (v20) rows in browsers without native extraction. Opera no longer falls through to the native extractor and a generic not_supported throw. The receipt keeps its counts and reasons and says what to do: $B handoff, sign in, $B resume. Partial imports warn that the session may not be restored. Browsers with native extraction (windowsNative: Chrome, Chromium, Brave, Edge) keep #2964's behavior; a parity test ties that flag to nativeBrowserPaths.

Actionable errors.

  • Missing browser: lists every path checked; off-platform it says which OS supports the browser, where it would look, and the typeable names available here (Opera GX (opera-gx)).
  • Missing profile vs missing browser are distinguished (Opera profile 'Profile 8' not found. Available: Default.).
  • A command without --profile now explains why it stopped: several matching profiles (with directory names), none with cookies for the domain, unreadable profiles, or several profiles under --all.
  • CLI receipts append Failure reasons: key=count (sorted).
  • A relative APPDATA falls back to ~/AppData/Roaming.

Docs. Opera added to the browser lists in BROWSER.md, README, docs/skills.md, ARCHITECTURE.md and the command reference (regenerated). BROWSER.md gains a Windows Opera walkthrough and tables for receipt failure reasons and import error codes. A free test keeps those lists in step with the registry. TODOS.md gets the deferred follow-ups (macOS/Linux Opera, channels, side profiles, legacy root layouts, a user path option, mixed-batch key failures, the CBC prefix check).

Test fixtures and PR selection. The historical cookie-workflow manual-approval fixture now reverses the new BROWSER.md text so it still reconstructs the exact approved prompt. gstack/llms.txt (generated from commands.ts) is declared as a command reference table input in touchfiles-data.ts; before, it counted as an unknown dependency and restored the full 42-shard gate for a one-line generated change.

Verification

Local checks on 1b460978 (the final head 209b5c5d changes only the Windows test's child environment), Bun 1.4.0 (CI pin):

  • Cookie-import suites (reliability, browser, operation, native, node, picker, deadline): 400 pass / 0 fail / 25 skip (skips are Windows-only or out-of-tier cases). The hash-prefix and docs-drift tests were checked to fail with the fix/doc line removed.
  • New Windows-only test decrypts a host-bound Opera v10 cookie with real DPAPI through the Node server runtime (bun-polyfill.cjs, real PowerShell ProtectedData), plus a wrong-key negative control. It runs and passes in windows-free-tests (it is skipped with no credit on Linux/macOS). Its first CI run timed out; a throwaway diagnostics run showed PowerShell takes ~18-21s to start when the child environment is stripped versus ~0.3s with the runner's environment, and DPAPI round-tripped correctly in every variant, so the test now keeps the runner's environment and only redirects APPDATA.
  • Paid PR gate (bun run eval:bg:pr): 3/3 selected shards passed (re-run on the final head) — judges setup-browser-cookies/SKILL.md workflow, command reference table, browse/SKILL.md reference, snapshot flags reference, regression vs baseline; E2E browse-basic, browse-snapshot, diagram-triplet. 14 behaviors remain scheduled/release coverage, not PR passes.
  • Full free suite (bun run test, 4 strict shards): 27,310 pass / 0 fail. An earlier run on this head had one timing failure in terminal-agent-lifecycle.test.ts (untouched here) while paid evals ran concurrently; it passed 5/5 alone and the unloaded rerun passed. Local runs used plain git because this machine's commit shim forces a fixed author, which breaks gstack-retro-metrics fixtures (they pass in CI).
  • bun run build passed; gitleaks: no leaks in the wave commits; credential pre-push guard enabled.
  • CI on 209b5c5d: all 45 non-skipped checks pass. windows-free-tests needed one rerun: plan-review-board-feedback.test.ts (a design-daemon deadline test untouched here) hit a bun spawn timeout on the runner, then passed.

Not verified: no real Windows Opera or Opera GX session has been imported yet. #2957 stays open until the reporter (or a maintainer) confirms one.

Windows verification recipe (for #2957)

Rebuilding restarts the gstack daemon and drops open $B tabs and imported cookies, so finish browser work first. In Git Bash, in your gstack checkout:

git fetch origin wave/cookie-import-opera && git checkout --detach FETCH_HEAD   # works with the README's shallow clone
./setup
B=~/.claude/skills/gstack/browse/dist/browse.exe                    # or your checkout's browse/dist/browse.exe
$B status
$B cookie-import-browser                                            # Opera / Opera GX should be listed as detected
SITE=app.example.com; DOMAIN=example.com
$B goto "https://$SITE"
$B cookie-import-browser opera --domain "$DOMAIN" --profile Default   # or opera-gx
$B reload                                                            # does the page show the intended account?

Please report the Opera version and paste the sanitized result line, for example Imported 12 cookies from opera (profile: Default); 0 failed to decrypt. Cookie copy complete. Storage reset: not_requested. Authentication: not_requested., and whether the intended account appeared. Never paste cookie values. Afterwards, git checkout main && ./setup returns to the normal release.

Supersedes

#2980 (included here with credit), #1114 (#2964 reports aggregate typed failure reasons; per-row debug logging is not planned) and #392 (superseded by #2964's DPAPI support and no-TCP-fallback policy). They will be closed after this merges.

Open in Capy

mvanhorn and others added 8 commits September 28, 2026 17:19
…actionable

- strip the SHA-256(host_key) prefix Chromium adds to v10 values (DB meta v24+) on Windows
- keep receipts and name `$B handoff` recovery for App-Bound rows in browsers without native extraction
- explain missing browsers, missing profiles and ambiguous profile selection with next steps
- add windowsNative/resolveBrowserInfo, the operagx alias and sorted failure reasons in CLI output
- cover the Node server runtime with a real-DPAPI Windows test
@trunk-io

trunk-io Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

E2E Evals: ✅ PASS

8 automated passed / 8 final results | 0 failed, 0 manual accepted (unscored; no score-cache credit) | 8 executed, 0 reused | $.34 total cost | reconcile exit: 0

Profile: pr / pr; selected behaviors: 3, judges: 6. Deferred to scheduled/release coverage: 14 behaviors and 0 changed prompt files. Deferred checks did not run and receive no PR-pass credit.

Shard Automated result Manual/unscored Executed Reused Status Cost
llm-judge/skill-llm-eval 6/6 0 6 0 ✅ $0.12
e2e-browse/skill-e2e-bws 2/2 0 2 0 ✅ $0.22
Fail-closed reconciliation
[test:paid] report: 6/6 slices, 3 planned shards, tier=gate
[test:paid] coverage: profile=pr mode=pr; selected E2E=3, judges=6
[test:paid] deferred: 14 broad behaviors, 0 changed prompts without quick live coverage; these are not PR passes
  slice 1  passed             46s  test/skill-llm-eval.test.ts
  slice 2  passed             57s  test/skill-e2e-bws.test.ts
  slice 3  passed             39s  test/skill-e2e-diagram.test.ts
[test:paid] collector final outcomes: 8 executed, 0 reused; 8 passed, 0 failed, 0 manual accepted (unscored; no score-cache credit) (8 attempt records from 2 collectors)
[test:paid] report: every planned shard accounted and passed

Sliced lane: declared PR profile or broad fallback via scripts/test-paid-shards.ts (planner → 6 executors → fail-closed report). Reused scores retain their original provenance and expiry.

PowerShell launched with a stripped environment took ~18-21s on the Windows
runner (measured on a throwaway diagnostics run), past dpapiDecrypt's 10s
deadline; with the full environment it returns in ~0.3s. Only APPDATA is
redirected to the fixture's Opera root.
@garrytan
garrytan merged commit d2a0bbc into main Sep 28, 2026
50 of 51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants