feat: surface HTTP auth / client-certificate challenges instead of hanging until timeout
Problem
When a site requires HTTP authentication (Basic / Digest / NTLM — common on corporate intranets) or a client TLS certificate, Chrome suspends the navigation behind a modal prompt. agent-browser has no handler for these challenges:
Fetch.authRequiredis only wired up when proxy credentials are configured (cli/src/native/actions.rs), and only answers with those proxy credentials;- there is no client-certificate handling at all.
Result: open blocks until the 25s lifecycle timeout and returns a generic "Operation timed out. The page may still be loading..." error, with no indication that an auth challenge is waiting for input. In headed mode a human could complete the dialog, but nothing tells the agent/user that this is what's blocking; in headless mode there is no way through at all.
This bites in the same real-world scenario as #1765 (intranet SSO auto-login): the navigation stalls, the agent sees only a generic timeout, retries, and loops.
Proposal (incremental)
- Detect and report (the valuable half): enable
Fetchauth handling (or listen for the relevant target events) so a pending auth challenge is surfaced promptly in the command result — e.g.openreturns quickly with a structured "authentication required: Basic realm X at URL" state instead of a 25s blind timeout. Client-certificate prompts can likewise be detected and reported ("client certificate requested"). - Answer programmatically (optional follow-up): allow supplying credentials / certificate selection via config or the existing
authprofile machinery, mapping toFetch.continueWithAuth.
Step 1 alone turns a 25s mystery hang into actionable feedback, and in headed mode tells the user exactly which dialog to complete. Happy to discuss the approach and implement.
Source: vercel-labs/agent-browser