Add a pause that holds an agent after its current step
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user