Add a pause that holds an agent after its current step

This commit is contained in:
Ian Gulliver
2026-10-22 21:55:42 -07:00
parent 73519bf4dd
commit 293c21ca8c
25 changed files with 1014 additions and 472 deletions
+9 -1
View File
@@ -15,6 +15,7 @@ import (
"g.fc.run/ai/byre/internal/api"
"g.fc.run/ai/byre/internal/claude"
"g.fc.run/ai/byre/internal/codex"
"g.fc.run/ai/byre/internal/hookcmd"
"g.fc.run/ai/byre/internal/mcp"
)
@@ -74,8 +75,12 @@ func (m *Manager) startClaude(ctx context.Context, sess api.AgentSession, l *liv
hooks := map[string][]claude.HookMatcher{
"UserPromptSubmit": {{Func: remindGuidance(g)}},
}
if l.implementer() {
hooks["PreToolUse"] = []claude.HookMatcher{{Func: m.beforeTool(l)}}
}
if l.reviewID == "" {
hooks["PostToolUse"] = []claude.HookMatcher{{Func: m.afterTool(l)}}
hooks["PostToolUseFailure"] = []claude.HookMatcher{{Func: m.afterTool(l)}}
if l.owner == "" {
hooks["Stop"] = []claude.HookMatcher{{Func: m.bounceProseQuestion(l)}}
}
@@ -166,6 +171,9 @@ func (m *Manager) startCodex(ctx context.Context, sess api.AgentSession, l *live
StdioMCP: stdio,
OnBadLine: func(line []byte, reason string) { m.recordBadLine(l, line, reason) },
}
if l.implementer() {
opts.Hooks = map[string]hookcmd.Func{"PreToolUse": m.beforeTool(l), "PostToolUse": m.codexAfterTool(l)}
}
switch {
case sess.VendorSessionId != "":
opts.Resume = sess.VendorSessionId
@@ -237,7 +245,7 @@ func (m *Manager) startAntigravity(ctx context.Context, sess api.AgentSession, l
Reminder: g,
MCPServers: servers,
StdioMCP: stdio,
Hooks: map[string]antigravity.HookFunc{"PreInvocation": m.agyBeforeModel(l)},
Hooks: map[string]hookcmd.Func{"PreInvocation": m.agyBeforeModel(l), "PreToolUse": m.agyBeforeTool(l)},
OnBadLine: func(line []byte, reason string) { m.recordBadLine(l, line, reason) },
}