Deliver inbox answers mid-turn through the PostToolUse hook
This commit is contained in:
@@ -129,10 +129,19 @@ func (m *Manager) dropSnapshots(repo, taskID string) error {
|
||||
return git.DeleteSnapshotRefs(repo, taskID)
|
||||
}
|
||||
|
||||
func (m *Manager) snapshotAfterTool(l *live) claude.HookFunc {
|
||||
func (m *Manager) afterTool(l *live) claude.HookFunc {
|
||||
return func(ctx context.Context, input json.RawMessage) (map[string]any, error) {
|
||||
m.snapshotSoon(l, api.SnapshotTriggerToolCall)
|
||||
return map[string]any{}, nil
|
||||
text := m.deliverMidTurn(ctx, l)
|
||||
if text == "" {
|
||||
return map[string]any{}, nil
|
||||
}
|
||||
return map[string]any{
|
||||
"hookSpecificOutput": map[string]any{
|
||||
"hookEventName": "PostToolUse",
|
||||
"additionalContext": text,
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user