refactor(conversation_loop): extract streaming spinner cleanup slice CL-R2-1 into agent/streaming_control.py - #84310
Conversation
Signed-off-by: Axl Ibiza <andrexibiza@gmail.com>
Signed-off-by: Axl Ibiza <andrexibiza@gmail.com>
Contributor email mapping required by check-attribution CI for the god-file kill campaign PRs (Axl Ibiza, MBA <andrexibiza@gmail.com>). Signed-off-by: Axl Ibiza, MBA <andrexibiza@gmail.com> Signed-off-by: Axl Ibiza <andrexibiza@gmail.com>
refactor(conversation_loop): extract streaming spinner cleanup slice CL-R2-1 into agent/streaming_control.py
|
|
This streaming-cleanup extraction is tied to current head |
Summary
Blind extraction of slice CL-R2-1 from
agent/conversation_loop.py(7,757 lines at pinee4bb75b532e932a1055d9a710802a7435163b6a) into a new module, per the repo-wide god-file sharding policy.run_conversation._stop_spinner(lines 2636–2642, 322 bytes, spinner/callback cleanup) →agent/streaming_control.pyas an explicit-input helper_stop_spinner(thinking_spinner, thinking_callback)returning the updated spinner23c462927eaa954adf9dedffb25bf4831843054899450a5baf10c2bff328ab18nonlocal thinking_spinnerand readagent.thinking_callback; the destination helper makes the closure inputs explicit. The call site now uses a small_on_first_deltaadapter that rebinds the enclosingthinking_spinnerthrough the module helper;on_first_delta=_on_first_deltapreserves streaming timing and callback identity. Behavior exists in exactly ONE place (the module helper); theagentobject is not passed (onlyagent.thinking_callback). Operation order, truthiness, callback ordering, and exception propagation preserved exactly.tests/agent/test_streaming_control.py— runtime behavioral probes (spinner-present/callback-present, spinner-absent/callback-present, both absent, callback ordering, exception propagation, call-site seam via runtime probe)agent/conversation_loop.py13 changed (nested def removed + import + adapter); new module 10 lines; seam test 112 lines.Method
5×2×3 double-blind decomposition (per the All Gods Must Die mandate): 5 blind region analysts → 5 blind adversarial witnesses → 5 consensus adjudicators → blind implementer → 2 blind re-reviewers. Round 1: reviewer 1 REQUEST CHANGES (sole blocker: a committed test used
inspect.getsource/ast.parseonrun_conversation— the repo's banned source-reading-test antipattern); reviewer 2 APPROVED. Fix lane replaced it with a runtime behavioral probe (commit46a41cdcd4e, test file only). Round 2: both re-reviewers APPROVED:C:/tmp/tg-Feature Package/conversation-loop/review/CLR21-review-1-r2.md(13,317 B) — all gates PASSC:/tmp/tg-Feature Package/conversation-loop/review/CLR21-review-2-r2.md(10,234 B) — APPROVED, all gatesSuite evidence: pristine-pin vs post-extraction failure sets identical (seam 6/6, canonical subset green). No new failures.
Coordination table
ee4bb75b532e932a1055d9a710802a7435163b6a(origin/main)agent/streaming_control.py23c462927eaa954adf9dedffb25bf4831843054899450a5baf10c2bff328ab18Dedup statement
No prior extraction of this window exists. No duplicate work.
Credit
87d564757c6+46a41cdcd4e)This slice is governed by the conversation_loop (posted on #78641). Former whole: 7,757 lines. Fixer roster: #83437.
Part of #78641
Part of #78647