refactor(context_compressor): extract tool-result summarizers (LB5a) - #80645
Open
andrexibiza wants to merge 6 commits into
Open
refactor(context_compressor): extract tool-result summarizers (LB5a)#80645andrexibiza wants to merge 6 commits into
andrexibiza wants to merge 6 commits into
Conversation
…ll-prune Wave-2 dual REQUEST_CHANGES agreed LB2 skill-prune cannot extract first: it calls _redact_compaction_text and _content_text_for_contains (cycle). Move those two pure leaves into context_compressor_text_utils.py with is-identical re-export through the godfile. Golden bodies byte-exact. Part of NousResearch#78645 Part of NousResearch#78647 Signed-off-by: Andrex Ibiza <andrexibiza@users.noreply.github.com>
… (LB2) Wave-2 redraw: banner-inclusive window 404-618 (golden ec5defbef6a402ad302b28369c81f5f9182162f1c8353b231d2d863fe59305c0) into context_compressor_skill_prune.py. Deps on the two text-util leaves now import one-way from context_compressor_text_utils — no cycle. 12 members re-exported is-identical through the godfile. 35/35 targeted tests green. Part of NousResearch#78645 Part of NousResearch#78647 Signed-off-by: Andrex Ibiza <andrexibiza@users.noreply.github.com>
Window 420-649 (current numbering; pin 616-868 minus the text-util leaf) into context_compressor_budget.py. HISTORICAL_TASK_HEADING moves with the cluster (sole external dep, re-exported is-identical). 29 members re-exported through the godfile. 39/39 targeted tests green. Part of NousResearch#78645 Part of NousResearch#78647 Signed-off-by: Andrex Ibiza <andrexibiza@users.noreply.github.com>
Window 446-668 (banner-inclusive; pin 870-1111 minus leaves) into context_compressor_media.py. 9 members re-exported is-identical through the godfile; deps on typing/json/turn_context only (one-way). 43/43 targeted tests green. Part of NousResearch#78645 Part of NousResearch#78647 Signed-off-by: Andrex Ibiza <andrexibiza@users.noreply.github.com>
Window 459-634 (def-aligned; pin 1114-1289 per W2 redraw) into context_compressor_summarizers.py. 3 members re-exported is-identical; logger dep via lazy round-trip import (auth s2 seam pattern, zero behavior change); skill-prune deps one-way from skill_prune module. 47/47 targeted tests green. Part of NousResearch#78645 Part of NousResearch#78647 Signed-off-by: Andrex Ibiza <andrexibiza@users.noreply.github.com>
…rs module Pass E (blind) caught a regression: test_summarize_tool_result_type_safety patched agent.context_compressor._summarize_tool_result_unguarded, but the call resolves via the summarizers module global after extraction, so the mock never fired. Per extraction doctrine, test patch targets move with the code: retarget to context_compressor_summarizers. Also trim dead typing imports in the new module. 13/13 type-safety + 60/60 family green. Part of NousResearch#78645 Part of NousResearch#78647 Signed-off-by: Andrex Ibiza <andrexibiza@users.noreply.github.com>
Contributor
Author
Contributor
Author
|
Interlock completion for the context-compressor shard campaign:
The full related set is explicitly recorded in #81074, including the prior compressor shards, same-surface colliders/fixers, and their referenced issue nodes. The residual |
Contributor
refactor(context_compressor): extract tool-result summarizers (LB5a)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
God-file Feature Package (tracker #78647):
agent/context_compressor.pyslice LB5a — extract the tool-result one-line summarizers intoagent/context_compressor_summarizers.pywith anis-identical re-export seam.Slice
agent/context_compressor.py(6,883 lines @ pin6e9cae6ac4b)efd0867b107f3f25cc0d4d2e4b3cb228be4bd8eef29c26026a593d19749939ec— byte-exact, verified by 5/5 blind reviewers (round 2)agent/context_compressor_summarizers.py(3 members)loggervia lazy in-function round-trip import (auth s2 seam pattern) — no import-time cyclecc.<m> is cs.<m>verified at runtimeRound-2 fix (blind Pass E caught it)
test_summarize_tool_result_type_safety.pypatchedagent.context_compressor._summarize_tool_result_unguarded, but the call resolves via the summarizers module global after extraction — the mock never fired. Per extraction doctrine, test patch targets move with the code: retargeted toagent.context_compressor_summarizers._summarize_tool_result_unguarded. Dead typing imports trimmed.Verification
git diff --checkclean · LF-only · DCO signedPart of #78645
Part of #78647