Skip to content

fix(cli): the picture browser no longer asks the system keychain - #14252

Open
dante01yoon wants to merge 1 commit into
meta:mainfrom
dante01yoon:fix/picture-chrome-keychain
Open

dante01yoon wants to merge 1 commit into
meta:mainfrom
dante01yoon:fix/picture-chrome-keychain

Conversation

@dante01yoon

@dante01yoon dante01yoon commented Dec 3, 2026 •

Copy link
Copy Markdown

Fixes #14250

User impact

astryx experimental export --pictures falls back to an installed Google Chrome or Chromium when the project has no Playwright browser. On macOS, each start of that browser opened a "Chrome Safe Storage" keychain dialog. An agent running the command cannot answer the dialog, and a person sees one dialog per browser start. A full local pnpm test on a Mac with Chrome showed hundreds of these dialogs.

Problem and solution fit

  • Why does the dialog appear? foundation/render/picture-chrome.mjs starts the system Chrome with a fresh profile but without --use-mock-keychain (macOS) or --password-store=basic (Linux). So Chrome asks the OS secret store for its encryption key.
  • Why does it harm the task? The CLI runs in a non-interactive context, and a system dialog stops the run for a person, or blocks an agent.
  • Why does it matter? The profile is a throwaway folder under the run's temp dir and stores no secret, so the prompt protects nothing.

Playwright passes the same two flags on every Chromium launch, so the Playwright path (picture-playwright.mjs) never prompted. This change gives the system-Chrome path the same two flags.

Expected behavior and authority

architecture:cli-surface INV1: the CLI never asks a question, and a non-TTY environment is the only supported condition.

Smallest restoration

Two arguments added to the system Chrome's spawn in picture-chrome.mjs. No other flag, option or output changes.

Evidence

  • Reproduction before the change: on macOS 26 with Google Chrome 155 in /Applications, each start of the picture browser opened the keychain dialog.
  • Result after the change: I ran picture-chrome.mjs directly against the same Chrome. The picture was taken, and no SecurityAgent process started. A full pnpm test with a log stream watch on securityd's "displaying keychain prompt" messages logged no prompt from Chrome.
  • Representative unchanged path: the Playwright path (picture-playwright.mjs) is not changed. It already passes both flags.
  • Regression test or other mutation-sensitive proof: the new foundation/render/picture-chrome.test.mjs starts the script with a stand-in browser that records its arguments, so no real browser starts. It fails without the two flags (expected [ '--headless=new', …(21) ] to include '--use-mock-keychain') and passes with them.

Scope

Components: @astryxdesign/cli (foundation/render/picture-chrome.mjs)

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

pnpm vitest run packages/cli/foundation/render/picture-chrome.test.mjs
pnpm check:repo
pnpm check:changesets
pnpm review:pre --base upstream/main   # 0 findings
pnpm build

The new test is skipped on Windows, because a #! stand-in browser cannot run there. Chrome ignores both flags on Windows.

…a#14250)

`astryx experimental export --pictures` falls back to an installed Chrome
or Chromium when the project has no Playwright browser. picture-chrome.mjs
started it without --use-mock-keychain and --password-store=basic, so on
macOS each browser start opened a keychain dialog. Playwright passes both
flags on every Chromium launch; the system-Chrome path now does the same.
@vercel

vercel Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Dec 3, 2026 2:19pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Dec 3, 2026
@astracat-bot

astracat-bot Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Dec 3, 2026, 2:49 PM UTC

@github-actions github-actions Bot added community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge labels Dec 3, 2026
@dante01yoon
dante01yoon marked this pull request as ready for review December 3, 2026 14:20

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not run on this head yet, so a maintainer needs to add the ci:run label for it to run.

The two switches bring the system-Chrome picture path back in line with the CLI's no-prompt rule, and your new stand-in-browser test fails without them and passes with them (reproduced locally). No changes are requested.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Title, the picture browser no longer asks the system keychain: verified for what the CLI passes (the new test, run locally, fails on the base and passes here, and the Chrome picture script is the CLI's only system-browser launch); the macOS no-dialog outcome is reported from your run.
  • The export with pictures falls back to an installed Chrome or Chromium when the project has no Playwright browser: verified (foundation/pictures/pictures.mjs:139-155).
  • Each browser start opened a keychain dialog on macOS, and a full local test run showed hundreds: reported.
  • The Chrome picture script started the browser with a fresh profile and without either switch: verified (the base's spawn arguments and offline.mjs:40-56).
  • The profile is a throwaway folder in the run's temp folder and stores no secret: verified (picture-chrome.mjs:62; pictures.mjs:422, :437, :461).
  • Playwright passes both switches on every Chromium launch, so the Playwright path never prompted: verified for the locked Playwright 1.61.1, whose default Chromium switches include both, with picture-playwright.mjs:46-49 keeping the defaults; "never prompted" is reported.
  • The CLI never asks a question: matches the CLI surface record's first invariant.
  • Only two arguments are added, and no other flag, option or output changes: verified (picture-chrome.mjs:58-59 is the only production change).
  • After the change a picture was taken with no keychain prompt, including across a full test run: reported.
  • The Playwright picture script is unchanged: verified.
  • The new test uses a stand-in browser that records its arguments, fails without the switches with the quoted message and passes with them: verified, reproduced locally with the same message.
  • Scope is the CLI's Chrome picture script only, with no tagalong, no new public API or default, and no internal context: verified.
  • Testing commands: reported; locally the new test, eslint on both changed code files, the changeset check, the CLI structure check and the public text check pass.
  • The test skips on Windows because a #! stand-in cannot run there: verified (picture-chrome.test.mjs:50); Chrome ignoring both switches on Windows is reported.
  • Changeset, the export's installed Chrome or Chromium no longer asks the macOS keychain or the Linux password store: verified for what the CLI passes on the only system-Chrome path; the OS outcome is reported.
  • File .changeset/picture-chrome-no-keychain-prompt.md: clear.
  • File packages/cli/foundation/render/picture-chrome.mjs: clear.
  • File packages/cli/foundation/render/picture-chrome.test.mjs: clear.

Automated review (maintainer link)

@cixzhang

cixzhang commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

🤖 (Posted by Cindy's agent.) Welcome, @dante01yoon, and thank you for this fix and the test that proves it! The automated review approved it with no changes requested. The next step is ours: we'll start CI and finish the remaining maintainer checks. Nothing is needed from you right now. We'll post here if anything comes up.

@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Dec 3, 2026
@cixzhang cixzhang closed this Dec 3, 2026
@cixzhang cixzhang reopened this Dec 3, 2026
@cixzhang

cixzhang commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 30e20ec

@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 30e20ec

Storybook · Sandbox · built from this PR's head

Package size: @astryxdesign/cli 4.96 MB packed (+116 B); no new dependencies.

Not run on this PR: add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.


Generated by PR Enrichment workflow | View full report

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at this exact head.

@github-actions github-actions Bot removed the needs:code-review High-risk change (new package/component/API) — needs human code review before merge label Dec 3, 2026

This branch was successfully deployed

1 active deployment
Preview — 30e20ec9 Deployed Dec 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) CLA Signed This label is managed by the Meta Open Source bot. community Authored by a community contributor (not on the eng/design team)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] CLI pictures through an installed Chrome open a macOS keychain dialog on each browser start

2 participants