mclaw's authorize now runs a preflight before it returns opened:true. When
no Chromium browser can be found, or Linux has neither DISPLAY nor
WAYLAND_DISPLAY, it returns {type:'failed'} at once instead of claiming a
window opened and failing later in callback (source issue
joey-41/opencode-mclaw-auth#1, the same shape as inkstone #825).
requireBrowser() is now the only place that looks up the browser, and
holds its one error message. It now looks for Edge, Chromium and Brave on
macOS, Edge on Windows, and microsoft-edge and /opt/google/chrome on Linux.
MCLAW_CHROME_PATH is checked first (X_OK, or F_OK on Windows) and a bad
path gets its own error. Headless renewal still goes through requireBrowser
only, with no display check. The cancel test now uses two independent
AbortControllers (#746 follow-up). README and CHANGELOG updated, 0.5.3.
Reviewed head 40784afa76c89285cb039460f55cc0f9fb059e21, on main 89fcfb2e.
Read every line of the diff: it adds no network endpoint, credential read,
install script or obfuscated code.
Run at that head, on mote (macOS), HOME a scratch dir:
- packages/mclaw `bun test`: 41 pass, 0 fail.
- repo `bun test` (HOME=$(mktemp -d), as CI): 7604 pass, 0 fail.
`bun scripts/check.mjs`: exit 0. (The package has no node:test files;
every test is bun:test.)
- Broken by hand, each red and restored:
- no preflight call in authorize: both login preflight tests red;
- no DISPLAY check: the browser-path and login no-display tests red;
- MCLAW_CHROME_PATH not validated: the bad-override test red;
- candidates not access()-checked: the real-executable test red.
- Real env, no seams, in WSL (magpie-desktop): DISPLAY/WAYLAND_DISPLAY
unset → authorize returns failed with the no-display message, no
opened. DISPLAY set + MCLAW_CHROME_PATH=/no/such → failed with the
override message. DISPLAY set, no browser installed → requireBrowser
throws the no-browser message.
- Candidate tables against real machines: mote finds
~/Applications/Google Chrome.app; xiaomi-gpu (Windows 11) finds
C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe.
- PR CI (ubuntu, headless) test job green.
Not blocking, left for a later version: on Windows, Edge (installed on
every machine) now comes before a LOCALAPPDATA Chromium, so a renewal of
a profile Chromium made would open in Edge. Linux's table has no Brave,
though the README names it.
Not tried: a real MClaw sign-in (no account), or a headed sign-in through
Edge or Brave.