What Breaks When an AI Agent Drives Real Websites Overnight
Builder notes for teams shipping agent-driven automation: architecture, ops, security, and delivery implications.
On the night of November 16, someone left Claude Code running with turbo-browser-mcp attached to their own Chrome instance. Every thirty minutes it read Hacker News, dev.to, and Reddit, opened job boards, filled in forms, set up a Reddit profile, and booked a call through a Notion Calendar page. Whenever a tool call misbehaved, they wrote down the exact arguments and the exact output, fixed the server, and re-ran the same step against the same page. Six rounds of that produced v0.7.0.
The interesting part is not "browser automation is hard." It's that almost none of the failures were in the automation logic. They were at the seams: process ownership, session identity, timing, and irreversibility. That is a useful map for anyone building agentic tooling, because those seams are exactly the ones your unit tests cannot see.

图示:来源页预览图(仅作编辑上下文;版权归属原发布方) · 来源引用:dev.to
The bug that explains the rest: two MCP servers, one Chrome
The headline failure in the writeup is that a second Claude session in another project, also running the same browser server, caused a tabs_batch call in the first session to hang — indefinitely, not for a timeout.
This is not exotic. It is the classic singleton-resource problem wearing a new hat. Chrome over CDP is a single stateful process with a shared tab set, shared cookies, and shared target IDs. Two MCP server processes each opened their own connection and each assumed they were the sole owner. One created or reordered targets; the other's session and target references went stale; the batch call then waited on an event that would never arrive. Because the transport connection was still alive, no transport-level timeout fired either.
Builder notes:
- Every tool server fronting a singleton needs an explicit lease. An owner token in a lockfile or a local socket, acquired at startup, released on exit, with stale-lease recovery. "Last writer wins" on a browser is data loss, not a race condition.
- Hangs are worse than errors. An unattended agent that throws will retry or stop. An agent that hangs will sit there for eight hours while you sleep. Put a per-call deadline at the tool layer, strictly shorter than the orchestrator's own, and make the tool return a structured
TIMEOUTrather than nothing. - Make ownership observable. Expose a
who_owns_browsertool. Debugging a hang at 3am without one is guesswork.
Tool contracts that are syntactically right and semantically wrong
Composite tools like tabs_batch are a footgun in agentic settings because they offer no transaction boundary. One bad element in a batch leaves you with partial application and no way to tell which half landed. The arguments validate; the world does not.
The same class of failure shows up in form-filling, which the overnight run exercised heavily. Typeahead inputs where typing a city name selects a plausible-but-wrong entry. Date pickers whose "next month" is relative to the page's idea of today, not the model's. "Submit" buttons that are actually newsletter opt-ins. A Notion Calendar booking flow, where the confirmation is a real event on a real calendar.
Builder notes:
- Return per-step results from composite tools, including the DOM state after each step, not just a final success flag.
- Split large batches into small composable tools. A
dry_runordiffmode that reports "this would click element X at coordinates Y" is worth more than a clever batch API. - Re-read after every mutation. The most common semantic error is acting on a stale element handle produced before the last navigation.
The human's identity is the agent's credential
This is the part that should worry your security reviewer most. The server was attached to the operator's own Chrome — meaning every action ran as them: existing sessions, saved passwords, SSO cookies, potentially a stored payment method. Setting up a Reddit profile and booking a call on a third party's calendar are not technical failures; they are compliance and consent questions that a unit test will never raise.
Two additional exposures are worth naming explicitly:
- Prompt injection surface. Hacker News comments, Reddit posts, and job listings are attacker-controlled text. They land in the model's context as content, and a sufficiently unlucky page can attempt to steer the next tool call. Any agent that reads the open web and has write-capable tools is a confused-deputy risk.
- Attribution and rate limits. Traffic comes from your residential IP and your account. Overnight cadence against third-party sites is indistinguishable from scraping, and some of those sites will notice.
Builder notes:
- Dedicated browser profile per agent run. Never the daily driver. Ideally a separate OS user or container, with no saved credentials and no password manager bridge.
- Domain allowlist enforced in the tool server, not in the prompt. The prompt is a suggestion; the allowlist is a control.
- Two-tier action model: reversible actions (navigate, read, scroll, type into a scratch field) versus irreversible ones (submit, pay, book, post, delete). Tier two requires explicit human approval or a hard per-run budget. The overnight run crossed that line.
- Assume every scraped string is hostile. Delimit page content in the context and instruct the model to treat it as data, but do not rely on that alone — enforce the boundary in code.
- A kill switch that closes the browser, not just the agent loop. An orphaned Chrome with a live session is the worst possible end state.

图示:HEXOPS 原创配图(受选题启发,非复制原文图片) · 来源引用:dev.to
Overnight is a different test environment
Thirty-minute cadence across eight hours is sixteen chances for state to drift in ways a nine-second test never sees. Sessions expire. Tokens rotate. Interstitial modals appear. A/B tests flip. Pages you tested at 6pm render differently at 3am. And the agent has no felt sense of "I have been doing this for six hours" — it will happily retry a failing step until it exhausts your quota.
Builder notes:
- Budget per run and per step: max tool calls, max wall clock, max retries, then stop and report.
- Checkpointing, so a resumed run does not repeat an irreversible step it already completed.
- Backoff that is aware of the site, not just of the error type.
The real superpower was the debugging method
The most transferable idea in the writeup is not any individual fix. It is the loop: capture the exact tool arguments and the exact output, fix the server, re-run the same step on the same page.
That is a record/replay harness for agent actions, and most teams do not have one. They have chat transcripts.
If you are building this, emit structured events from the tool server for every call: tool name, arguments hash, target URL, a reference to a DOM snapshot, latency, outcome, and any console errors. Store them somewhere queryable. Then "replay step 12 against this snapshot" becomes a command rather than an afternoon of manual reconstruction. Six rounds of fixes in one night is only possible if the loop is that tight.
Delivery implications
The broader lesson for teams shipping agent features is that your integration test suite needs a layer that runs the actual agent against actual sites, on a schedule, with the output captured.
- Canary list. Two or three real, benign pages exercised nightly. If the canary breaks, you know before your users do.
- Contract tests for the browser, not for your prompts. Assert on observable post-conditions (URL, presence of confirmation element) rather than on the model's narration.
- Scenario suite in staging. Replay recorded sessions against a controlled copy of the flow.
- Release gate: no version ships without one full unattended run at realistic cadence. v0.7.0 exists because six such runs happened in a single night.
The short checklist
- Lease the singleton. Fail loudly on contention, never hang.
- Deadline every tool call; make timeouts structured and visible.
- Two-tier actions; human approval for anything irreversible.
- Dedicated identity, no saved secrets, domain allowlist in code.
- Treat all page text as untrusted input to the model.
- Budgets and checkpoints for long runs.
- Record tool arguments and outputs; build replay.
- Nightly canaries against real sites, at real cadence.
The overnight run was not a stunt. It was a load test against the parts of the system that documentation never covers: ownership, identity, time, and consequence. Those are the bugs you find by sleeping through them.
Sources
- What broke when an AI agent drove real websites overnight through my MCP browser server — the original writeup, including the two-server hang and the record-fix-replay loop.
- turbo-browser-mcp v0.7.0 release — the release produced by the six rounds of overnight fixes.



