Skip to content

refactor(aux): extract aux streaming cluster into agent/aux_streaming.py (R5 C-B) - #80043

Open
andrexibiza wants to merge 1 commit into
NousResearch:mainfrom
andrexibiza:gfg/aux-r5-streaming
Open

refactor(aux): extract aux streaming cluster into agent/aux_streaming.py (R5 C-B)#80043
andrexibiza wants to merge 1 commit into
NousResearch:mainfrom
andrexibiza:gfg/aux-r5-streaming

Conversation

@andrexibiza

@andrexibiza andrexibiza commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

refactor(aux): extract aux streaming cluster into agent/aux_streaming.py (R5 C-B)

Slice

  • God-file: agent/auxiliary_client.py (9,976 lines @ pin) — large-file decomposition tracker [COMPLETE] Large-file decomposition: 20/20 done #78647, target Shard agent/auxiliary_client.py (god-file decomposition) #78635
  • Window: 8221–8558 (338 lines; section banner @8221 through _acreate_with_stream end @8558; code-only 8236–8558)
  • Module: agent/aux_streaming.py — streaming cluster (_ChatStreamAccumulator-adjacent machinery, _acreate_with_stream + siblings)
  • Golden sha256: full b7c02fb3c28dfe8cb2f231eab2aac04ee64f6d5b9e7575523eb1f8bd41b58e49 · code-only 32939194cf97e72a2b883bb89a7a6e4c918348eeca2344e7b9e03c30a31928d1 — both verified byte-identical after sanctioned seams (difflib 0)

Seam identity

Every moved name re-exports through agent.auxiliary_client with real is-identity (11/11 both import orders). _RELAY_AUX_CALL_CONTEXT correctly stays in the godfile (absent from the moved module). _is_streaming_rejected_error defined + re-exported but uncalled — identical to base status quo, preserved intentionally.

Double-blind review (2 reviewers, never 1)

  • Pass A: APPROVED — golden shas both variants, 11/11 member verbatim, mutation controls non-vacuous, no cycle, ruff/diff-check/DCO/LF clean
  • Pass B (adversarial): APPROVED — SPEC COMPLIANCE PASS, zero CRITICAL/IMPORTANT

Tests

  • tests/test_aux_streaming_seam.py + tests/agent/test_aux_progress_streaming.py (the analysis watch item): 25/25 fresh isolated run (independent receipt)
  • test_auxiliary_explicit_cancellation also green through the seam

Zero collateral

git show --stat: godfile diff = import + re-export + window deletion only. ruff clean, git diff --check clean, LF-only, DCO-signed.

Interlock

Part of #78647
Part of #78635
Kill lock posted on #78635. Collision discipline: no #78378 (R3 fallback), #62260/#74320/#56367 (R1 C5), #79862 (R4-C1 vision) territory touched.

…R5 C-B)

Move the progress-hooked chat.completions streaming machinery out of the
agent/auxiliary_client.py godfile (window 8221-8558) into a dedicated
agent/aux_streaming.py module: _AUX_STREAM_CEILING_* constants,
_aux_stream_total_ceiling, _client_streams_internally,
_is_streaming_rejected_error, _provider_requires_stream,
_create_with_progress, _aggregate_chat_stream, _ChatStreamAccumulator,
_aggregate_chat_stream_async and _acreate_with_stream.

The godfile keeps an identity re-export block so every moved name resolves
is-identical through agent.auxiliary_client (callers, the compression
pipeline, and tests keep importing from the godfile unchanged). Godfile-owned
dependencies (logger, wire-adapter client classes, error predicates,
_aux_progress_active/_notify_aux_progress) are imported lazily inside the
moved functions to keep the module import-order independent.

Adds tests/test_aux_streaming_seam.py asserting real identity for all 11
re-exported names plus accumulator/stream-aggregation smoke coverage.

Epic NousResearch#78647, target NousResearch#78635. Zero behavior change.

Signed-off-by: Andrex Ibiza, MBA <84248988+andrexibiza@users.noreply.github.com>
@alt-glitch alt-glitch added type/refactor Code restructuring, no behavior change comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P3 Low — cosmetic, nice to have labels Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P3 Low — cosmetic, nice to have type/refactor Code restructuring, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants