Repository navigation
fix(notes): harden LLM notes reliability - #585
Merged
Merged
Conversation
Contributor
|
Standing release PR: #582 · v0.41.1 queued (4 packages) · open 2h 49m · ✅ ready to merge Release Preview — this PR contributes no changes
Currently queued for release
Updated automatically by ReleaseKit |
goosewobbler
force-pushed
the
fix/llm-notes-reliability
branch
3 times, most recently
from
July 19, 2026 23:56
1f385a9 to
8020502
Compare
Independently soft-fail each LLM task so a late summarize/releaseNotes failure no longer discards already-computed enhancement; find the Anthropic text block instead of reading content[0] for thinking-model forward-compat; classify retryable vs non-retryable errors so 4xx auth/validation fails fast while timeout/429/5xx/network retry; chunk enhanceAndCategorize into bounded batches with per-chunk corrective retry; bound cross-package fan-out with the existing concurrency config; exclude temperature from the Anthropic cache identity (it is never forwarded); and warn on partial per-entry enhancement. Adds the missing AnthropicProvider unit spec. Closes #543 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BT6fVBZrmExXZj7vQ29881
goosewobbler
force-pushed
the
fix/llm-notes-reliability
branch
from
July 20, 2026 00:12
8020502 to
6be1d43
Compare
Merged
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
A batch of P2 LLM-notes reliability fixes (July 2026 direction review), all in
packages/notes:core/pipeline.ts): provider setup falls back to the raw context on failure;enhance+categorize,summarize, andreleaseNoteseach soft-fail in isolation, so a late failure keeps earlier (paid-for) results.llm/anthropic.ts): usecontent.find(b => b.type === 'text')instead ofcontent[0], so a leadingthinkingblock (Sonnet 5 / Fable 5) doesn't hard-fail non-schema tasks.temperature(thinking models 400 on it — documented) and now reportshonorsTemperature: false; the on-disk cache dropstemperaturefrom the key for such providers so toggling it no longer busts an identical response.llm/retryable.ts,utils/retry.ts, all providers): fail fast on 4xx auth/validation; retry only timeout/429/5xx/network.LLMErrorcarries aretryableflag andwithRetrygained ashouldRetrypredicate.enhanceAndCategorizeinto ~30-entry batches with per-chunk corrective retry and per-chunk General fallback; merges same-named categories. ≤30 entries stays a single call.utils/concurrency.ts): replace the unboundedPromise.all(contexts.map(...))with aconcurrency-bounded map.tasks/enhance.ts): surface a failure count when entries silently fall back to raw voice.AnthropicProviderunit spec: tool_use extraction, missing-tool-block error, thinking-before-text, timeout mapping, system-message splitting, temperature, and retry classification.No Zod config schema changes, so no generated docs/schema updates.
Test plan
test/unit/llm/anthropic.spec.ts,test/unit/llm/retryable.spec.ts,test/unit/utils/concurrency.spec.ts,test/integration/pipeline-softfail.spec.ts, plus additions toretry.spec.ts,cache.spec.ts,llm.spec.ts(chunking + isolated fallback).biome check .exit 0; forcedturbo run typecheck test --force→ 24/24.Closes #543
🤖 Generated with Claude Code
https://claude.ai/code/session_01BT6fVBZrmExXZj7vQ29881
Greptile Summary
This PR hardens LLM notes reliability across
packages/noteswith a batch of complementary fixes: per-task soft-fail isolation in the pipeline, retry classification that fast-fails on 4xx auth/validation while retrying transient errors, chunkedenhanceAndCategorizefor large releases, bounded cross-package concurrency, and a thinking-model text-block fix for Anthropic. New unit and integration specs cover the key new paths.pipeline.ts): provider setup and each LLM task now fail independently; a latesummarize/releaseNotesfailure keeps earlier enhancement and categorization results rather than discarding them.enhance-and-categorize.ts):enhanceAndCategorizesplits large entry lists into ≤30-entry batches, each with its own corrective-retry budget andGeneral-fallback isolation;mergeCategoriesreassembles same-named categories across chunks.retryable.ts,retry.ts, all providers):withRetrygains ashouldRetrypredicate;LLMErrornow carries aretryableflag; 4xx auth/validation errors fast-fail while 429/5xx/network/timeout errors retry.Confidence Score: 5/5
Safe to merge. All changes are additive reliability improvements with no regressions to existing LLM task behaviour; the soft-fail paths are exercised by a dedicated integration test.
The three most complex changes — per-task soft-fail isolation in processWithLLM, chunked enhanceAndCategorize, and the mapWithConcurrency worker pool — are each internally consistent and covered by targeted unit/integration specs. The retry classification follows a clear, conservative 'default retryable, explicit fast-fail on 4xx' policy applied uniformly across all four providers. Error cause chaining and the temperature-cache fix address known gaps without touching unrelated code paths. No schema changes and no breaking public-interface alterations.
pipeline.ts carries the largest surface area (provider setup soft-fail + four independent task try/catch blocks + concurrency switch); worth a careful read-through, but the logic is straightforward and the integration test covers the key failure scenario.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[runPipeline] --> B[mapWithConcurrency\nbounded by concurrency knob] B --> C[processWithLLM per package] C --> D{Provider setup} D -- throws --> E[warn + return raw context\nsoft-fail] D -- success --> F{tasks.enhance\n&& tasks.categorize?} F -- yes --> G[enhanceAndCategorize\nchunked into <= 30 entries] G --> H[enhanceAndCategorizeChunk\nper chunk] H --> I{runCorrectiveTask\nsucceeds?} I -- yes --> J[merge categories\npreserve order] I -- no LLMError --> K[General fallback\nisolated to chunk] J --> L[tasks.summarize?] K --> L F -- no --> L L -- yes --> M[summarizeEntries\ntry/catch soft-fail] L -- no --> N[tasks.releaseNotes?] M -- fails --> O[warn + keep prior results] M -- success --> N O --> N N -- yes --> P[generateReleaseNotes\ntry/catch soft-fail] N -- no --> Q[return enhanced context] P --> Q P -- fails --> Q subgraph withRetry R[attempt fn] -- throws --> S{shouldRetry isRetryableLLMError?} S -- false 4xx --> T[fast-fail immediately] S -- true 429/5xx/network --> U[sleep + retry] U --> R end%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% flowchart TD A[runPipeline] --> B[mapWithConcurrency\nbounded by concurrency knob] B --> C[processWithLLM per package] C --> D{Provider setup} D -- throws --> E[warn + return raw context\nsoft-fail] D -- success --> F{tasks.enhance\n&& tasks.categorize?} F -- yes --> G[enhanceAndCategorize\nchunked into <= 30 entries] G --> H[enhanceAndCategorizeChunk\nper chunk] H --> I{runCorrectiveTask\nsucceeds?} I -- yes --> J[merge categories\npreserve order] I -- no LLMError --> K[General fallback\nisolated to chunk] J --> L[tasks.summarize?] K --> L F -- no --> L L -- yes --> M[summarizeEntries\ntry/catch soft-fail] L -- no --> N[tasks.releaseNotes?] M -- fails --> O[warn + keep prior results] M -- success --> N O --> N N -- yes --> P[generateReleaseNotes\ntry/catch soft-fail] N -- no --> Q[return enhanced context] P --> Q P -- fails --> Q subgraph withRetry R[attempt fn] -- throws --> S{shouldRetry isRetryableLLMError?} S -- false 4xx --> T[fast-fail immediately] S -- true 429/5xx/network --> U[sleep + retry] U --> R endReviews (3): Last reviewed commit: "fix(notes): harden LLM notes reliability..." | Re-trigger Greptile