Skip to main content

Module state

Module state 

Source

Structs§

ApiFailureTracker
API failure tracking for exponential backoff
HistoryValidationReport
Validation report for conversation history state
MissingOutput
Record of a missing output in conversation history
ToolCallId
Unique identifier for a tool call.

Enums§

OutputStatus
Status of a tool execution
PairableHistoryItem
Items that participate in call/output pairing for validation

Functions§

clear_old_tool_results
Request-only local stand-in for Anthropic clear_tool_uses_20250919.
ensure_call_outputs_present
Ensure all tool calls have corresponding outputs in the message list.
normalize_history
Normalize history to enforce call/output pairing invariants.
normalize_history_for_request
Compatibility wrapper for callers that own a slice rather than shared request history. The shared implementation avoids cloning clean message histories; this wrapper retains the historical owned return type for small slice-based callers and tests.
normalize_history_for_request_shared
Rebuild a shared provider-facing message view with each assistant tool-call batch followed immediately by its matching results.
recover_history_from_crash
Recover from crashed or interrupted session by fixing history invariants.
remove_orphan_outputs
Remove outputs without corresponding calls (orphaned outputs) from the message list.
request_history_needs_normalization
Return whether the provider-facing message view needs tool-history repair.
safe_history_split_point
Find a split point that keeps tool-call outputs paired with their calls.
should_apply_local_tool_result_clearing
Whether request assembly should apply local clear_old_tool_results.
summarize_list
validate_history_invariants
Validate that conversation history maintains call/output invariants.