Repository navigation
fix: DeduplicateLeversTask — per-lever decomposition, growing conversation, compact fallback - #203
Merged
Conversation
…ibility Replace monolithic DeduplicationAnalysis schema (requires LLM to output all lever_ids) with per-lever decomposition using a minimal LeverClassificationDecision schema (classification + justification only). Changes: - Module-level _build_compact_history() for option C context compaction - Conversation grows per-lever (option A): SYSTEM -> USER(lever1) -> ASSISTANT -> ... - Context folded into system message to avoid USER->USER before first ASSISTANT - Two sequential try/except blocks (no nesting): first attempt with full history, second attempt (if needed) with compacted history - llm_executor owns retry/fallback; task file owns compact-history fallback only - IDs assigned by code; LLM never sees lever_id in schema - Module-level constants and helpers (no closures)
neoneye
added a commit
that referenced
this pull request
Mar 8, 2026
- Fix broken USER→ASSISTANT alternation when default keep is used - Extract closure to module-level _call_llm with functools.partial - Use dict lookup for decisions instead of O(n²) loop - Remove redundant DeduplicationAnalysis wrapper class - Remove stale PROBLEM docstring (already fixed in PR #203) - Rename reused `decision` variable to `lever_decision` in output loop Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2 of 3 tasks
neoneye
added a commit
that referenced
this pull request
Mar 8, 2026
…-cleanup fix: clean up deduplicate_levers.py — post PR #203 review fixes
neoneye
added a commit
that referenced
this pull request
Mar 8, 2026
* main: fix: replace functools.partial with closure for LLMExecutor compatibility fix: clean up deduplicate_levers.py — post PR #203 review fixes
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.
Replaces #198 and #202. Single commit
f02f1739on top of current upstream/main — no conflicts. 1 file.What changed
LeverClassificationDecisioncall per lever (small-model compatible — no UUID reproduction required)metadata: List[Dict[str, Any]]— accumulates all per-lever execute() call metadata (no overwrite)nonlocal, no nested try/except, no retry loop (llm_executorowns retries)Why
GLM 4.7 Flash returns HTTP 400 when full
DeduplicationAnalysisschema sent (requires reproducing lever_id UUIDs). Per-lever calls with minimal schema work on all tested models.