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
+8
View File
@@ -3,6 +3,7 @@ package agents
import (
"context"
"errors"
"fmt"
"log/slog"
"strings"
@@ -33,7 +34,13 @@ func (m *Manager) Compact(ctx context.Context, sessionID, model string) (api.Age
if err != nil {
return api.AgentSession{}, err
}
unlock := m.lockDelivery(sessionID)
if m.isPaused(sessionID) {
unlock()
return api.AgentSession{}, fmt.Errorf("%w: session %s is paused; resume it first", ErrConflict, sessionID)
}
err = m.startRunning(ctx, sess, "byre")
unlock()
if err != nil {
return api.AgentSession{}, err
}
@@ -72,6 +79,7 @@ func isContinuation(actor, text string) bool {
func (m *Manager) continueFromHandoff(sessionID, handoff string) {
ctx := context.Background()
m.waitResumed(sessionID)
err := m.handoff(ctx, sessionID, handoff)
if err == nil {
return