Skip to content

refactor(conversation_loop): extract error classifier slice CL-R1-2 into agent/conversation_error_classifiers.py - #84619

Open
andrexibiza wants to merge 2 commits into
NousResearch:mainfrom
andrexibiza:gfg/conversation-loop-r12-error-classifiers
Open

refactor(conversation_loop): extract error classifier slice CL-R1-2 into agent/conversation_error_classifiers.py#84619
andrexibiza wants to merge 2 commits into
NousResearch:mainfrom
andrexibiza:gfg/conversation-loop-r12-error-classifiers

Conversation

@andrexibiza

@andrexibiza andrexibiza commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Byte-verbatim extraction of slice CL-R1-2 from agent/conversation_loop.py (7,757 lines at pin ee4bb75b532e932a1055d9a710802a7435163b6a) into a new module, per the repo-wide god-file sharding policy — the region's second slice per the Wave-3 second-slice consensus.

  • Moved: _is_stale_copilot_credential_error (lines 301–328, 1,386 bytes, single-function leaf) → agent/conversation_error_classifiers.py
  • Golden sha (window at pin): 2eabf9a771e70ee154af3208073909d5804540e07219367dd547ba7ddb15987e — byte-verbatim, re-verified from the committed blob (module function == pin window, byte-identical)
  • Seam: direct compatibility import in agent/conversation_loop.py — the classifier's single same-file production consumer (stale-Copilot branch at 5467) resolves through the original namespace; no stale duplicate, no wrapper. New module: minimal typing context only; startup-latency contract held.
  • Seam tests: tests/agent/test_conversation_error_classifiers.py — classifier behavior + old-path import/patch transparency; no source-reading tests.
  • Zero behavior change. Diff: agent/conversation_loop.py 1 insertion / 28 deletions (deleted set exactly 301–328); new module 32 lines; seam test.

Method

5×2×3 double-blind decomposition (per the All Gods Must Die mandate) + second-slice Wave-3 adjudication. Blind implementer → 2 blind re-reviewers, both APPROVED:

  • Review 1: C:/tmp/tg-Feature Package/conversation-loop/review/CLR12-review-1.md (11,734 B) — all gates PASS
  • Review 2: C:/tmp/tg-Feature Package/conversation-loop/review/CLR12-review-2.md (10,545 B) — APPROVED, all gates (golden exact, bytecode-level seam probe, globals identity)

Suite evidence: pristine-pin vs post-extraction failure sets identical. No new failures.

Coordination table

Item Value
Pin ee4bb75b532e932a1055d9a710802a7435163b6a (origin/main)
Slice CL-R1-2 (conversation_loop region 1, second slice)
Window 301–328 (28 lines, 1,386 bytes)
Module agent/conversation_error_classifiers.py
Golden sha 2eabf9a771e70ee154af3208073909d5804540e07219367dd547ba7ddb15987e
Colliders #83437 (langfuse tracing) — live file-list check at extraction: no hunks in 301–328. Siblings #84275, #84310, #84330, #84473, #84583 — no hunks in window
Dependencies none
Conflicts none
Merge position standalone; no stacking

Dedup statement

No prior extraction of this window exists. No duplicate work.

Credit

  • Author: Axl Ibiza, MBA (DCO-signed commit be96091c36a)
  • Method: All Gods Must Die 5×2×3 (blind lanes, consensus contracts, blind re-review)

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

Signed-off-by: Axl Ibiza, MBA <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>
@alt-glitch alt-glitch added type/refactor Code restructuring, no behavior change P3 Low — cosmetic, nice to have comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint labels Aug 12, 2026
@Enough1122

Copy link
Copy Markdown
Contributor

AI code review — automated review for reference, author can ignore or act on any point.

refactor(conversation_loop): extract error classifier slice CL-R1-2 into agent/conversation_error_classifiers.py

Simple, behavior-preserving extraction with good parametrized coverage. Minor points:

  1. Styleagent/conversation_error_classifiers.py: there is no blank line between the module docstring and from typing import Optional, and no blank line between the import and def _is_stale_copilot_credential_error (PEP8 wants two blank lines after imports). The module also starts with a 1-line module docstring then the import — a formatter pass would fix this.

  2. Private name on a shared module — the function keeps a leading underscore (_is_stale_copilot_credential_error) even though it is now a module-level API re-exported by conversation_loop. Since it is deliberately imported cross-module (from agent.conversation_error_classifiers import _is_stale_copilot_credential_error), consider a public name (is_stale_copilot_credential_error) with the legacy name kept as an alias for patchability — the seam test already guarantees the alias identity.

  3. Matching logic unchanged — the marker list is narrow and the 400-status gate is correct; the test_legacy_namespace_exports_the_same_callable identity check is a good guard against accidental double-definition.

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.

3 participants