Repository navigation
fix(cloud,cli): stale retry error no longer reclassifies a confirmed no-snapshot as unavailable - #479
Conversation
…no-snapshot as unavailable waitForRunSnapshot now clears its tracked re-fetch failure when a later status re-fetch succeeds, and reports it on SettledRunSnapshot.retryError only when the last re-fetch failed — i.e. when the final observation is stale. The CLI throws settled.retryError instead of its own accumulated onRetryError state, so an early transient 503 followed by a successful re-fetch that freshly confirms no snapshot reports artifactStatus: 'not_produced' rather than 'unavailable' with an unrelated network message. All-failed re-fetches still report unavailable. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour. 📝 WalkthroughWalkthrough
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This localized change corrects stale retry-error classification and is merge-ready after normal checks and review; no actionable merge-blocking risk remains. Sequence Diagram(s)sequenceDiagram
participant CLI as run-in-cloud.ts
participant SnapshotWaiter as waitForRunSnapshot
participant StatusAPI as Cloud run status API
CLI->>SnapshotWaiter: Settle snapshot retrieval
SnapshotWaiter->>StatusAPI: Re-fetch run status
StatusAPI-->>SnapshotWaiter: Transient failure
SnapshotWaiter->>StatusAPI: Retry status fetch
StatusAPI-->>SnapshotWaiter: Successful response with no snapshot
SnapshotWaiter-->>CLI: content=null and retryError cleared
CLI-->>CLI: Classify result as not_produced
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #479 +/- ##
=======================================
Coverage 88.42% 88.42%
=======================================
Files 192 192
Lines 10757 10758 +1
Branches 3018 3018
=======================================
+ Hits 9512 9513 +1
Misses 1243 1243
Partials 2 2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Trivial, this merging w/o human review |
Summary
Fixes a misclassification voyti found post-merge on #448 (comment): during snapshot settling, the CLI accumulated
onRetryErrorfailures and threw the last one whenever content ended up null — even when a later status re-fetch succeeded and freshly confirmed that no snapshot was attached. A single early transient 503 therefore turned a confirmedartifactStatus: 'not_produced'into'unavailable'with an unrelated network message.Fix
The success signal only exists inside
waitForRunSnapshot, so the tracking moves there:waitForRunSnapshotclears its tracked re-fetch failure on every successful status re-fetch and reports it asSettledRunSnapshot.retryError— set only when the last re-fetch failed, i.e. when the final "no snapshot" observation rests on stale data.settled.retryErrorinstead of its own accumulated state;onRetryErrorremains a pure debug-logging hook.Behavior matrix (null content):
not_producednot_producedunavailable+ stale network errornot_producedunavailableunavailableTest plan
retryErrorcleared by a later successful re-fetch; reported when the final re-fetch failednot_produced,artifactErrorwithout the network message (fails onmain)unavailabletest still passes🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests