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

Commit:

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Snider 2026-04-18 08:32:10 +01:00
parent 43568cae01
commit 651783e1f5
3 changed files with 43 additions and 0 deletions

View file

@ -0,0 +1,2 @@
- @bug pkg/agentic/deps.go:59 — `go.work` is written without checking the result, so dependency cloning can fail silently.
- @bug pkg/agentic/prep.go:835 — the PHP-specific `CODEX.md` overwrite ignores write failures, leaving prep to continue with a partial workspace.

View file

@ -796,6 +796,9 @@ func (s *PrepSubsystem) prepWorkspace(ctx context.Context, _ *mcp.CallToolReques
}
return nil, PrepOutput{}, core.E("prepWorkspace", "extract default workspace template", nil)
}
if err := ensureWorkspaceTaskFile(workspaceDir); err != nil {
return nil, PrepOutput{}, err
}
if !resumed {
if r := process.RunIn(ctx, ".", "git", "clone", repoPath, repoDir); !r.OK {
@ -1021,6 +1024,32 @@ func (s *PrepSubsystem) buildPrompt(ctx context.Context, input PrepInput, branch
return promptBuilder.String(), memoryCount, consumerCount
}
// 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 {
todoPath := core.JoinPath(workspaceDir, "TODO.md")
if readResult := fs.Read(todoPath); readResult.OK && core.Trim(readResult.Value.(string)) != "" {
return nil
}
templateResult := lib.WorkspaceFile("default", "TODO.md.tmpl")
if !templateResult.OK {
if err, ok := templateResult.Value.(error); ok {
return core.E("prepWorkspace", "load TODO.md template", err)
}
return core.E("prepWorkspace", "load TODO.md template", nil)
}
if writeResult := fs.Write(todoPath, templateResult.Value.(string)); !writeResult.OK {
if err, ok := writeResult.Value.(error); ok {
return core.E("prepWorkspace", "write TODO.md", err)
}
return core.E("prepWorkspace", "write TODO.md", nil)
}
return nil
}
// writePromptSnapshot stores an immutable prompt snapshot for a workspace.
//
// snapshot := writePromptSnapshot("/srv/.core/workspace/core/go-io/task-42", "TASK: Fix tests")

View file

@ -1228,6 +1228,12 @@ func TestPrep_PrepWorkspace_Good(t *testing.T) {
promptSnapshotPath := core.JoinPath(WorkspaceMetaDir(out.WorkspaceDir), "prompt-versions", core.Concat(out.PromptVersion, ".json"))
require.True(t, fs.Exists(promptSnapshotPath))
todoPath := core.JoinPath(out.WorkspaceDir, "TODO.md")
require.True(t, fs.Exists(todoPath))
todoResult := fs.Read(todoPath)
require.True(t, todoResult.OK)
assert.NotEmpty(t, core.Trim(todoResult.Value.(string)))
}
func TestPrep_TestPrepWorkspace_Good(t *testing.T) {
@ -1274,6 +1280,12 @@ func TestPrep_TestPrepWorkspace_Good(t *testing.T) {
require.NoError(t, err)
assert.True(t, out.Success)
assert.NotEmpty(t, out.WorkspaceDir)
todoPath := core.JoinPath(out.WorkspaceDir, "TODO.md")
require.True(t, fs.Exists(todoPath))
todoResult := fs.Read(todoPath)
require.True(t, todoResult.OK)
assert.NotEmpty(t, core.Trim(todoResult.Value.(string)))
}
func TestPrep_TestPrepWorkspace_Bad(t *testing.T) {