2 Commits
Author SHA1 Message Date
yoruuuchanandClaude Fable 5 9acf2025e4 feat: auto-start a debug browser for agent-browser on Windows
On Windows agent-browser cannot launch Chrome by itself: the Chrome
launcher process hands off to a child and exits, which agent-browser
mistakes for a crash ("Chrome exited early without writing
DevToolsActivePort"). On such machines the export never gets a browser.

Before creating the session, resolve a CDP endpoint (Windows only):

1. honor AGENT_BROWSER_CDP if it answers /json/version;
2. else reuse a live endpoint on port 9337;
3. else launch Chrome/Edge with --remote-debugging-port and a fixed
   profile, and pass the port to agent-browser via AGENT_BROWSER_CDP.

The instance is intentionally left running: relaunching with the same
profile joins the existing browser, so repeated exports reuse one
instance instead of piling up processes. Non-Windows platforms are
untouched.

Discussed in #4.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-06 21:43:02 +09:00
yoruuuchanandClaude Fable 5 2730832c3f fix: tolerate files vanishing mid-scan in find_download
The sort key in find_download() called item.stat() unprotected. The
search roots include the live Downloads folder, where Chrome renames
"*.crdownload" files to their final name between directory listing and
stat(), crashing the whole export with FileNotFoundError.

Stat once while collecting (skipping entries that raise OSError), then
sort the snapshot. This also halves the stat() calls per polling round.

Fixes the remaining race reported in #4.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-06 21:36:38 +09:00