Essay

The agent noticed the README did not compile

While generating our PHP SDK, an agent caught that the generator's own README sample referenced things that do not exist. Small bug, useful lesson about where agents beat humans.

We generate client SDKs for our public API from an OpenAPI spec using an open-source generator. Part of the job I gave an agent was to sanity check the generated PHP package before we published it. It came back with something I had read past several times: the README’s “Environments” example would not run.

Two hardcoded values

The sample constructed the client with a token: argument and pointed it at Environments::Staging. Our API uses header auth, so the generated constructor takes $apiKey, not $token. And our environments are Production and Sandbox. There is no Staging.

The interesting part was why. The prose and the environment list right above the sample were generated correctly from the spec. Only the code sample had two literals baked into the template. So the section listed the real environments and then demonstrated one that did not exist. The same literal showed up in two dozen of the project’s own test fixtures, which is why nobody had noticed: the fixtures happened to have a staging environment.

Why the agent caught it

A human skimming a README pattern-matches. token: and Staging look like what a README usually says, so the eye slides over them. The agent did not skim. It cross-checked the sample against the generated constructor and enum, because that is what I asked it to do, and it does what it is asked with no boredom.

That is the real division of labor. Agents are relentless at cross-referencing two artifacts that are supposed to agree. Humans are good at deciding which artifacts should agree in the first place.

Filing it upstream

The write-up the agent and I produced for the maintainers followed the same structure as my internal briefs: where the code lives, the two defects, a minimal reproduction, and a suggested fix using values already in scope. It also said plainly what I could not do: regenerating the fixtures needed a toolchain I did not have running, so that part was better done by a maintainer.

All writing