Skip to main content

Module completion

Module completion 

Source

Functions§

check_completion_candidate
Checks if the agent’s response is a candidate for completion handling.
check_for_response_loop
Check for repetitive text in assistant responses to catch non-tool-calling loops. Returns true if a loop is detected.
recoverable_status_recap_phrasing
Shared recoverable status-recap vocabulary for tracker continuation.
tracker_adoption_succeeded
Observe adoption before tool output or conversation history is compacted.
tracker_final_text_is_policy_handoff
Permission, policy, safety, and credential handoffs remain terminal even when a pending-verification block can recover with fresh execution budget. Verification wording is handled separately by the turn’s recovery gate.
tracker_final_text_is_safety_handoff
True when assistant text is a genuine safety/permission handoff that must not be auto-continued, even if task_tracker still has incomplete steps.
tracker_final_text_requires_user_input
True when final assistant text asks the user for a decision/confirmation.
tracker_was_adopted
Successful tracker mutations establish adoption within the caller’s current request history. Listing, rejected calls, and unrelated tool results do not.