refactor(agent): scope pending fallback to verification

Name the continuation fallback for its actual verification-only provenance so unrelated continuation paths cannot accidentally inherit its cron-delivery semantics.
This commit is contained in:
kshitijk4poor
2026-07-10 11:27:23 +05:30
committed by kshitij
parent cd7c203ab9
commit 1453431881
3 changed files with 15 additions and 15 deletions
+3 -3
View File
@@ -42,7 +42,7 @@ def finalize_turn(
original_user_message,
_should_review_memory,
_turn_exit_reason,
_pending_continuation_response=None,
_pending_verification_response=None,
):
"""Run the post-loop finalization and return the turn ``result`` dict.
@@ -57,7 +57,7 @@ def finalize_turn(
)
continuation_budget_exhausted = (
final_response is None
and bool(_pending_continuation_response)
and bool(_pending_verification_response)
and budget_exhausted
)
@@ -68,7 +68,7 @@ def finalize_turn(
# one. Preserve that exact answer instead of replacing it with another
# fallible model call. The explicit pending value is the provenance
# guard: unrelated error/recovery exits can never enter this branch.
final_response = _pending_continuation_response
final_response = _pending_verification_response
_turn_exit_reason = f"max_iterations_reached({api_call_count}/{agent.max_iterations})"
iteration_limit_fallback = True
elif final_response is None and budget_exhausted: