Add checkpoint types and stop signal for agent suspension
Introduce Checkpoint, CheckpointStore, SuspendedError, AgentRegistry, and CompletedCall types. Add cooperative stop signal via context. Export CompletedCall (was unexported completedCall) so checkpoints can reference completed tool results. Add JSON tags to ToolResult and ApprovalResult for checkpoint serialization. Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
This commit is contained in:
@@ -59,7 +59,7 @@ type (
|
||||
inner *InterruptedError
|
||||
toolCallID string
|
||||
allToolCalls []llm.ToolCall
|
||||
completedCalls []completedCall
|
||||
completedCalls []CompletedCall
|
||||
}
|
||||
|
||||
outerLoopState struct {
|
||||
@@ -69,14 +69,9 @@ type (
|
||||
turns int
|
||||
allToolCalls []llm.ToolCall
|
||||
toolCallID string
|
||||
completedCalls []completedCall
|
||||
completedCalls []CompletedCall
|
||||
innerInterrupt *InterruptedError
|
||||
}
|
||||
|
||||
completedCall struct {
|
||||
toolCallID string
|
||||
result ToolResult
|
||||
}
|
||||
)
|
||||
|
||||
func (e *MaxTurnsExceededError) Error() string {
|
||||
|
||||
Reference in New Issue
Block a user