Move ErrSuspendForCheckpoint to pkg/agent
The sentinel is part of the agent cancellation contract — the only caller that needs it (the supervisor) imports pkg/agent already, so keeping it next to SuspendedError prevents the upward dependency that would arise if any future agent.Run caller wanted to trigger graceful suspend. Update pkg/probo/agent_run_handler.go to reference agent.ErrSuspendForCheckpoint. Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
This commit is contained in:
@@ -16,10 +16,21 @@ package agent
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
"go.probo.inc/probo/pkg/llm"
|
||||
)
|
||||
|
||||
// ErrSuspendForCheckpoint is the recommended cancel cause for callers
|
||||
// who want the agent loop to gracefully suspend (build a checkpoint
|
||||
// and return *SuspendedError) rather than treat the cancellation as a
|
||||
// silent close. The agent loop only inspects ctx.Err(); any cancel
|
||||
// cause produces a graceful suspend, but using this sentinel makes
|
||||
// the intent explicit and lets supervisors distinguish a user-driven
|
||||
// cancel from infrastructure-level causes (lease loss, heartbeat
|
||||
// failure) when they inspect context.Cause(ctx).
|
||||
var ErrSuspendForCheckpoint = errors.New("agent run: graceful suspend requested")
|
||||
|
||||
type (
|
||||
AgentStatus string
|
||||
|
||||
|
||||
Reference in New Issue
Block a user