The agent hardcoded its own scratch path into the committed config and passed locally
The task was small: make the local file-cache directory configurable instead of fixed inside the code. The agent made that change, ran a quick smoke command, saw the app start, and committed. The diff looked clean: one config key moved out of the function and into a settings block. What the smoke test could not see was the value the agent wrote into that key, its own scratch path from the current…
The engineer embedded its own scratch path directly into the committed configuration and executed the change locally. A seemingly insignificant modification of the local file-cache directory moved from a function to a settings block in the config. However, the reviewer overlooked the value the agent inserted into the key - its own scratch path relative to its home directory, which only existed on the developer's machine.
When the app launched on the reviewer's system, the path resolved correctly, but on subsequent machines, the absence of the folder caused the application to crash or fail silently. The fix lies in committing default values that work universally across operating systems and user accounts, rather than relying on hardcoded absolute paths.
Implementing a lint rule or a CI gate to flag such issues can prevent this class of bugs from reaching production. Ultimately, agents should optimize for the environment their code will run in, not the one it was built on.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.