
The Browser That Said It Was a Robot
A counter check assumed a visible browser would count as a visitor. A reviewer read the robot flag in a headless session and said it would not.
View companion repoThe QA plan expected a +1 from a browser that had told the page it was a robot
The release plan my lead agent was running for awesome.video expected a consent-banner counter to go up by one when a visible Chrome window loaded the home page. It would not have. The browser my QA lanes drive reports itself as automated, the banner code reads that report and returns before it sends anything, and nothing in that check looks at whether the window is visible.
A reviewer agent caught this on 2026-12-01, at 09:33 UTC, before the check ran. It added one correction to an approval:
One correction: a headed system Chrome alone won't produce the +1. Our agent-browser sessions report
navigator.webdriver = true, and the banner code stops before sending anything when that's set, headed or not.
The correction was right about the flag. It was an inference about the window, and the window turned out to be the second thing wrong with the plan. This post follows both through the record, including the readback that finally matched.
What the counter counts and why a robot would spoil it
The site is awesome.video, an index of video-engineering resources. A pull request added a first-party counter for the consent banner: how often the banner is shown, and which answer follows (allow, decline or dismissed), per hour, page type and screen class. No cookie, no identifier. The server keeps the counts in memory. The lead agent's note on timing was specific: "counts sit in server memory and reach the database every 5 minutes (server/ops/trafficFlush.ts:10)". It is also why the same note says "so a before-and-after read around each QA step wouldn't show anything."
The number the counter exists to produce is a rate. The reviewer's first pass over the pull request, which asked for changes, put the risk in one sentence:
Our own QA lanes drive production in fresh WebDriver sessions, and each page load adds an unanswered
shown, which biases thegranted / shownrate this feature exists for.
An automated review bot had raised the same point on the pull request: "When navigator.webdriver === true, sendConsentOutcome sends the beacon or fallback fetch without consulting isAnalyticsSuppressed, so WebDriver sessions are included in the consent counts and skew the admin readback." The fix returns early in sendConsentOutcome:
function sendConsentOutcome(outcome: ConsentOutcome) {
// Automated, QA and admin sessions stay out of the counts, as in every other analytics path.
if (isAnalyticsSuppressed()) return;
That is the part of the story that makes the later mistake awkward. At 09:10 UTC the reviewer had asked for our own QA traffic to be kept out of the counts. Twenty minutes later, at 09:30, the lead's note to the same reviewer described a QA plan that needed the counter to count a browser from our QA stack.
The suppression was added on purpose, a month earlier
The robot check was not new in this pull request. On 2026-11-03 a brief to a worker agent started from a weekly report: "The weekly report shows two Safari sessions (iPhone + iPad) on Nov 3 with ~460 page views on /search, /advanced, /sign-in, /journeys." The brief's reading was that these matched our own audit lanes, and its instruction was direct: "Make automated browsers send no analytics: in analytics-suppression.ts treat navigator.webdriver === true as suppressed".
The same brief told the worker to check that the flag was real before relying on it, and the worker did. From agent-browser on production, before the fix:
"{\"wd\":true,\"ua\":\"...HeadlessChrome/149.0.0.0 Safari/537.36\",\"plugins\":5}"
The chrome-devtools session returned the same shape with HeadlessChrome/156.0.0.0. After the change shipped, the production verification said: "I listed 43 requests. 0 matched i.replit.com/api/send, google-analytics, g/collect, mixpanel, posthog or amplitude."
The helper itself is two lines:
export const isAutomatedBrowser = (): boolean =>
typeof navigator !== 'undefined' && navigator.webdriver === true;
It reads one property. It does not look at the user agent, the window, or anything else. That is what made the reviewer's "headed or not" a reasonable reading of the code. It is also why that phrase was a reading and not a measurement.
The project had been warned even earlier. A project memory note, already in the repo by 2026-10-25, covers analytics checks that looked broken for no app reason. It says: "PostHog drops headless traffic silently." On 2026-10-26 a chrome-devtools session on production showed the point from the other side. With a normal desktop user agent, no "Headless" anywhere in it, the page still reported this:
{"webdriver":true,"ua":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/156.0.0.0 Safari/537.36","uaData":[]}
With an init script that set the property to false and stored granted consent, the same page produced three PostHog requests in the following 12 seconds. A normal user agent was not evidence that the flag was false.
The plan the lead wrote, and the measurement that corrected it
The lead's queue message to the reviewer asked for a delta review of two files, +17/-5, and included a request for agreement:
Lead note: clientClass treats any "headless" UA and x-audit-run/awesome-audit as non-human. Headless QA therefore never increments the counter, which is correct, and release-3 QA will use headed system Chrome for the +1 checks. Say whether you agree.
The server-side half of that note was right. The server drops any user agent containing "headless" and any request with the audit header, and the reviewer confirmed it by reading the classifier. For the client half the reviewer did something the note had not: it opened a fresh agent-browser session on system Chrome and asked the browser what it was. The output was filed as evidence:
"{\"ua\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/158.0.0.0 Safari/537.36\",\"webdriver\":true}"
Then it wrote the correction quoted at the top. The +1 check, it said, needed all of: a headed system Chrome, the flag overridden for that check only, no audit header, and a non-admin session. The override is allowed by the repo's own QA rules, which say "Override navigator.webdriver only when judging analytics."
Look at what that measurement was. The session it ran in was headless, with a HeadlessChrome user agent. It showed that the flag is true there. It did not show that a headed agent-browser would also report true, because nobody had launched one. The reviewer's sentence was honest in what it concluded from the code and silent about what it had not observed. The lead logged the correction in its progress file seconds after it arrived, with the four conditions, and the plan changed.
The headed window that was not headed
Release 3 went live at 12:25:35Z on 2026-12-01 after the owner clicked Publish. At 12:27 UTC a sonnet worker was given the QA lane. Its brief carried the four conditions, including this one: "headed system Chrome: agent-browser with --headed against system Chrome, so the user agent has no "HeadlessChrome";"
The worker's first preflight launched --headed with an init script that sets the flag to false, and printed this:
"{\"ua\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/158.0.0.0 Safari/537.36\",\"wd\":false,\"iw\":390,\"headless\":true}"
The init script had done its one job: wd is false. The user agent still said HeadlessChrome, and the server would drop the beacon on that alone. The worker's note at 12:30:34Z is plain: "The --headed session still reports HeadlessChrome. I'll check how the flag is meant to be used before drawing any conclusion."
It tried the environment-variable form and the explicit --headed true form, then the flag placed first, as the docs showed. Each launch reported a headless user agent. It listed the browser's process arguments and found --headless=new, with --window-size=1280,720. A count of Chrome processes carrying that argument, taken after the third attempt, printed 6. The record does not say why the flag did not take effect in this setup. It shows only that three variants of it did not produce a headed browser.
The brief had a rule for this case: if headed Chrome cannot be launched, do not substitute another browser, and mark the check unverified. The worker kept the browser and changed the launcher. It started system Chrome itself, with a debugging port and a fresh profile directory, and attached agent-browser to it over CDP. The first check on that browser:
"{\"ua\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/158.0.0.0 Safari/537.36\",\"wd\":false,\"iw\":390,\"ih\":844,\"headless\":false}"
No Headless in the user agent, and wd false. None of the five steps registered an init script. Steps 1 to 4 each launched a fresh Chrome the same way and printed headless false and wd false before loading the page, and step 5 reloaded the profile from step 4. The record shows no override in any of those commands. It also does not explain why a Chrome started by hand and driven over a debugging port reported false where the reviewer's agent-browser launch had reported true. I have no measurement for that, and I am not going to supply one.
What the counter said
The five steps ran back to back, each in a fresh profile, with timestamps to the second: load and do nothing at 12:31:43Z, Allow at 12:32:06Z, Decline at 12:32:26Z, Escape at 12:32:45Z, and a reload of the Escape profile starting at 12:32:52Z. The lead's first read, at 12:34:46Z, returned {"days":1,"rows":[]}. That empty result is where the suppression story bites a second time. An empty counter looks the same whether the flush has not happened yet or the client never sent anything. The five-minute flush explains this one. Nothing in the read itself could have told the lead which.
At 12:36:02Z the flush had landed:
12:36:02Z {"days":1,"rows":[{"day":"2026-12-01","outcome":"declined","viewportClass":"phone","template":"home","count":1},{"day":"2026-12-01","outcome":"dismissed","viewportClass":"phone","template":"home","count":1},{"day":"2026-12-01","outcome":"granted","viewportClass":"phone","template":"home","count":1},{"day":"2026-12-01","outcome":"shown","viewportClass":"phone","template":"home","count":5}]}
The lead had predicted a different total. Its report before the lane finished said: "I read the totals after the next write and expect shown 4, granted 1, declined 1, dismissed 1, all on the home page at phone width." The readback said shown 5. The fifth step was a reload after Escape, and the worker's report on it reads: "The brief expected no banner and +0." That is not what happened. Escape hides the banner for that page and saves no choice, a behavior the code already had from an earlier audit run, so the reload is a new page load with a new shown. The lead's verdict on its own brief: "My brief was wrong to expect +0 there." The worker had marked step 5 as a FAIL against the brief. The counter agreed with the code and disagreed with the brief.
The headless run that preceded the five steps, one load and one Decline, added nothing. So did a Googlebot-style POST the lead sent by hand. Both are in the readback only as absences: no rows beyond the five steps' totals. That matches the three-part design: a bot user agent gets a 204, a headless user agent gets dropped, and a bad payload still gets a 400.
What stayed unverified
A headed agent-browser session was never observed. Whether it would have reported webdriver true, as the reviewer inferred from reading the code, is untested, because the --headed flag never produced one. The lead's own report lists the limit in one line: "agent-browser couldn't launch a visible Chrome window, so executor-r3 started system Chrome itself and attached to it."
The reason the hand-launched Chrome reported false is not in the record. The totals are per hour, page type and screen class, so the readback proves five shown and one of each answer, not which step produced which. The attribution rests on the timestamps and on no real visitor landing on the same hour and screen class, which the lead said it would report rather than hide. None appeared in the totals. The network captures for that release stayed unverified, as the lead noted.
The rule
Before a test that needs the page to treat the browser as a visitor, ask the browser what it says about itself, and ask the browser the test will use, not the one a nearby session used. The question is one line of script. In this record someone asked the browser on 2026-10-26, on 2026-11-03 and twice on 2026-12-01. The answer was true in every browser that agent-browser or chrome-devtools launched itself, unless an init script had changed it. The lead's note about the QA plan did not mention the flag.
A flag you pass to get a window is a request, not a state. Print the user agent and the automation property after launching, before counting anything. If the plan's expected number is a count of events the client may suppress, a zero readback tells you nothing until the client is proven to send. And when the plan names a count, check the plan's own steps against the code that produces the count: here one assumption about the window and one about Escape were both wrong in the same brief, and the second only showed up as an extra number.
Continue the series
- 90SeriesThe Message I Never SawA row count told me an inbox held a third message, and I repeated it as fact until the agent that actually read the inbox found only two.
- 92SeriesThe Clock I Would Not FakeA done check that can only pass by lying about the machine is not a task, so the honest move is to stop and hand the decision back.
- 89SeriesThe Script That Graded ItselfA helper script's docstring says what it does; only the lines that set the verdict say who decided.
- 88SeriesThe Breadcrumb That Belonged to the ShellA rect measures an element's box, not whether anyone can see or tap it, so prove an element is visible before you file a finding about its size.