From dfa232540afdd4caaaaa5a835f205c34802c4e04 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Sun, 8 Mar 2026 22:11:05 +0000 Subject: executor: add git discipline section to agent preamble Agents running in a sandbox must commit all changes before exiting. The teardown rejects any dirty working tree. Add an explicit section to the planning preamble making this requirement clear. Co-Authored-By: Claude Sonnet 4.6 --- internal/executor/preamble.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'internal/executor') diff --git a/internal/executor/preamble.go b/internal/executor/preamble.go index b20f7ea..e50c16f 100644 --- a/internal/executor/preamble.go +++ b/internal/executor/preamble.go @@ -34,6 +34,18 @@ Before doing any implementation work: --- +## Git Discipline (mandatory when project_dir is set) + +Every change you make to the working directory **must be committed before you finish**. +The sandbox is rejected if there are any uncommitted modifications. + +- After completing work: run "git add -A && git commit -m 'concise description'" +- One commit is fine. Multiple focused commits are also fine. +- If you realise the task was already done and you made no changes, that is also fine — just exit cleanly without committing. +- Do not exit with uncommitted edits. + +--- + ` func withPlanningPreamble(instructions string) string { -- cgit v1.2.3