fix: pipeline reliability — retry logic, checkpointing, concurrency, stale cleanupFix/pipeline reliability#2
Open
mosumosu-JAPAN wants to merge 2 commits into
Conversation
…ency - utils.py: unwrap single-element list from parse_llm_json (root cause of all crashes) - filter.py: 3-attempt retry per source; per-source checkpoint so filter resumes on crash - summarize.py: 5-attempt retry with rate-limit jitter; ThreadPoolExecutor(5) for ~4x speedup - compile.py: retry loops in all LLM call sites; defensive isinstance guards for articles/subtopics/insights/gaps - state.py: compile-stage checkpoints for WikiCompilation and ActiveNote (skip already-done domains on crash) - cli.py: stale wiki cleanup on fresh compile; load/skip compile checkpoints; clear checkpoints after successful write - kompile.yaml: switch summarize model to Haiku to reduce cost Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
What this fixes
Ran compile on 1400+ Claude conversations and hit several issues at scale.
This PR addresses all of them.
Bugs fixed
parse_llm_json returns a list instead of a dict → crash
Added isinstance check + retry logic (up to 3–5 attempts) in filter.py,
summarize.py, and all three call sites in compile.py.
No per-source checkpointing → crash loses all progress
State is now written to disk after every single source. Resuming from a
crashed run automatically skips already-processed sources.
Fully sequential summarize → 3+ hours for 700+ sources
Replaced with ThreadPoolExecutor (5 workers) + rate-limit jitter.
Same workload now completes in ~25 minutes.
Stale wiki files persist across recompiles
Fresh compile now clears the old wiki directory before writing.
Files changed