Add todo mode and replace the plan with TODO.md

This commit is contained in:
Ian Gulliver
2026-10-15 07:23:17 -07:00
parent 60a1d221f4
commit 1f44bc6d91
25 changed files with 1259 additions and 637 deletions
+20 -7
View File
@@ -3,9 +3,12 @@ package agents
import (
"context"
"encoding/json"
"fmt"
"regexp"
"g.fc.run/misc/byre/internal/api"
"g.fc.run/misc/byre/internal/claude"
"g.fc.run/misc/byre/internal/todo"
)
const guidance = `You are running inside byre. The human reads your work in byre's web UI, not a terminal.
@@ -55,11 +58,21 @@ func (m *Manager) bounceProseQuestion(l *live) claude.HookFunc {
}
}
func remindGuidance(ctx context.Context, input json.RawMessage) (map[string]any, error) {
return map[string]any{
"hookSpecificOutput": map[string]any{
"hookEventName": "UserPromptSubmit",
"additionalContext": guidance,
},
}, nil
func taskGuidance(task api.Task) string {
if task.TodoItem == nil {
return guidance
}
return guidance + fmt.Sprintf("\n- This task was started from the item %q in %s at the repo root. When the work is done, remove that item from %s in this worktree, so the removal lands in the same merge as the work.",
*task.TodoItem, todo.File, todo.File)
}
func remindGuidance(text string) claude.HookFunc {
return func(ctx context.Context, input json.RawMessage) (map[string]any, error) {
return map[string]any{
"hookSpecificOutput": map[string]any{
"hookEventName": "UserPromptSubmit",
"additionalContext": text,
},
}, nil
}
}