review-fix(comments): restore lost #NNNN rationale comments across non-test source (mechanical sweep, condensed, code unchanged)

For each issue anchor present in BASE 63279301bc non-test .py and absent on HEAD, the BASE comment/docstring block was re-attached at the HEAD location of the code it explained (matched by the distinctive code line / enclosing def). Sentences already covered by an existing HEAD comment were deduped; the issue number always survives. Insert-only: no code lines changed.
This commit is contained in:
Teknium
2026-09-03 09:44:26 -07:00
parent ad62a15e94
commit e83816a4d1
586 changed files with 13883 additions and 829 deletions
+11
View File
@@ -56,6 +56,17 @@ def handle_outer_loop_error(
_outer_error_count += 1
# Interpreter shutdown makes every executor op raise: break.
# Phase-aware error classification. The huge outer try/except spans both the actual API request and all
# local post-processing of the returned assistant message. Deterministic local bugs (e.g. passing a
# multimodal content list into a regex helper after a vision turn or context compaction) should not be
# retried: they will fail identically on every iteration and only burn the iteration budget. We classify
# an error as local by inspecting the traceback: if the exception propagated through any of the known
# local post-processing helpers and never entered the interruptible API-call helpers, it is almost
# certainly a local processing bug. (#66267) Interpreter shutdown: if the process is tearing down, every
# executor-backed operation (API call, tool dispatch, memory sync) raises ``RuntimeError: cannot
# schedule new futures after interpreter shutdown``. Retrying is pointless — the executor is gone for
# good — and each retry just spams another traceback. Break immediately so the turn exits cleanly.
# (#93217)
if sys.is_finalizing() or _is_interpreter_shutdown_error(e):
error_msg = f"Interpreter is shutting down — cannot continue (API call #{api_call_count}): {e}"
try: