You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix Anthropic pause_turn handling to allow agent continuation
Introduces a new official 'incomplete' finish reason to the FinishReason enum
to represent cases where a model pauses mid-execution and will continue (e.g.,
Anthropic's pause_turn during long-running builtin tools).
Changes:
- Add 'incomplete' to FinishReason TypeAlias with documentation
- Map Anthropic's 'pause_turn' to 'incomplete' instead of None
- Update agent graph to recognize 'incomplete' and continue with empty request
Benefits:
- Provider-agnostic: other models can use 'incomplete' for similar behavior
- Proper separation of concerns: agent graph doesn't check provider-specific details
The agent graph now checks for finish_reason == 'incomplete' instead of checking
provider_details for 'pause_turn', maintaining clean architectural boundaries.
Fix: Don't increment retries for 'incomplete' finish reason
The 'incomplete' finish reason indicates expected mid-execution pausing
(e.g., Anthropic's pause_turn during long-running builtin tools), not an
error condition. This is normal behavior where the model is saying 'I'm
working on something, let me continue' rather than 'something went wrong'.
0 commit comments