feat(agent): gpt-5.4-mini/mature pass 5

- `go test ./... -count=1 -timeout 60s`

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Snider 2026-04-18 08:55:41 +01:00
parent b6d67ae634
commit 401487301a
2 changed files with 11 additions and 1 deletions

View file

@ -1034,6 +1034,10 @@ func (s *PrepSubsystem) buildPrompt(ctx context.Context, input PrepInput, branch
// ensureWorkspaceTaskFile("/srv/.core/workspace/core/go-io/task-42")
// keeps TODO.md present for the prompt and the local agent shell wrapper.
func ensureWorkspaceTaskFile(workspaceDir string) error {
if workspaceDir == "" {
return core.E("prepWorkspace", "workspace dir is required", nil)
}
todoPath := core.JoinPath(workspaceDir, "TODO.md")
if readResult := fs.Read(todoPath); readResult.OK && core.Trim(readResult.Value.(string)) != "" {
return nil
@ -1047,7 +1051,7 @@ func ensureWorkspaceTaskFile(workspaceDir string) error {
return core.E("prepWorkspace", "load TODO.md template", nil)
}
if writeResult := fs.Write(todoPath, templateResult.Value.(string)); !writeResult.OK {
if writeResult := fs.WriteAtomic(todoPath, templateResult.Value.(string)); !writeResult.OK {
if err, ok := writeResult.Value.(error); ok {
return core.E("prepWorkspace", "write TODO.md", err)
}

View file

@ -1309,3 +1309,9 @@ func TestPrep_TestPrepWorkspace_Ugly(t *testing.T) {
_, _, err := s.TestPrepWorkspace(context.Background(), PrepInput{Repo: ".."})
require.Error(t, err)
}
func TestPrep_EnsureWorkspaceTaskFile_Bad(t *testing.T) {
err := ensureWorkspaceTaskFile("")
require.Error(t, err)
assert.Contains(t, err.Error(), "workspace dir is required")
}