Why my agent's pull requests get squash-merged
I can usually tell when an agent has been working by the commit messages. First comes the feature. Then the fix. Then the fix for the test of the feature. Somewhere near the bottom is a confident announcement that everything is resolved, followed by another fix.
That is a reasonable way to work on a branch. It is a lousy way to explain the finished work to me a month later.
I have one Proxmox box and two agents. I am also a TCEQ OSSF Installer I near Santo, which means the computer hobby does not get my uninterrupted attention. When I come back to a repository, I want to know what changed. I do not need a transcript of the contributor discovering parentheses.
The branch is the scratch pad
For agent pull requests, I prefer a squash merge: take the finished difference between the branch and its base and land it as one commit on main. The agent can make intermediate commits while it works. Those commits do not all need permanent seats in the mainline history.
The useful unit is the reviewed change. In my texas-septic-toolkit, that might be a calculator input check, a corrected explanation, or a test for a boundary case. “Reject negative acreage in the drainfield calculator” tells me something. “Address feedback round three” tells me somebody was tired.
I mentioned this briefly in the CI that supervises my agent. The reason is not that small commit counts look tidy. It is that I am the person who will eventually have to read them.
One commit still needs a useful label
Squashing a vague pull request produces a vague commit. Git does not improve the explanation while combining the files.
I want the title to name the behavior that changed. The pull request should explain why, what was checked, and what remains uncertain. For anything involving a rule or sizing calculation, the source belongs with that explanation. “All tests pass” is not a substitute for knowing where the expected answer came from.
The issue-template post makes the same distinction earlier in the process. Questions beside the work are easier to inspect than promises buried in a conversation.
Before merging, I read the final diff. The branch may contain six good fixes and one unrelated improvement the agent generously included. A pleasant commit title will not make that seventh change belong.
A handle for undoing things
A focused squash commit gives me a convenient target for a revert. If an input-validation change turns out to reject a legitimate value, I can identify that change without reconstructing which of twelve corrective commits finally made it work.
Convenient does not mean automatic. Later work may depend on it. A revert may conflict, or restore an older bug along with the behavior I want back. I still have to inspect the reverse diff and run the relevant checks.
This is also why one pull request should not contain a calculator fix, a navigation redesign, and a dependency upgrade. One commit containing three unrelated decisions is not a clean rollback boundary. It is three problems sharing a coat.
What I am choosing to lose
Squashing removes the intermediate steps from mainline history. That makes bisecting within a large change impossible there. If those steps matter, the answer may be a smaller pull request or a deliberately preserved sequence of commits.
Nor does a squash merge prove the result was tested. The checks and review still need to cover the final proposed change. A readable history records decisions; it does not certify them.
I want main to read like a short maintenance log: what changed, why it changed, and where to find the evidence. The agent can keep its working mess on the branch until review is done.
I already have a truck with receipts in the console. I do not need another one made of Git.