你會讓編碼 Agent 把自己的程式碼變更合併到 main 嗎?
Would you let a coding agent merge its own work into main?
Styx 新增設定,可在編碼 Agent 完成一輪工作後,將 main 合併到其分支、執行專案檢查,並只在檢查通過時把變更合併到 main;此設定預設關閉。檢查失敗時,系統會停止操作並在對話中説明原因。文章指出,測試未必可靠,因為部分測試可能由 Agent 自行編寫,並提出是否應先由第二個 Agent 審核等把關方式。
After a turn, a coding agent leaves changes on its branch. If your tests pass, why not let it merge them?
I added exactly that setting to a tool I'm building, Styx: 'Land on its own when the agent goes quiet and the checks pass'. It's off by default. With it on, each time an agent finishes a turn with changes, Styx brings main into the branch, runs the project's checks and merges only if they pass. A failure stops it before main is touched, and the chat says why.
The obvious problem is that the checks are only as good as the tests. And the agent may have written some of those tests itself, so green can mean 'it agrees with itself'.
The argument for it is that a quick merge of a small, checked change is how people already work on a branch they own, and a bad merge is a revert away.
So where's your line?
- Never. I read the diff every time.
- On a side project, with green tests.
- Only for changes a second agent has reviewed.
- Only for certain kinds of change, like docs or tests.
Would you turn it on, and what would it need to have checked first?
來源:DEV Community · dev.to