Repository navigation
fix(cli): preserve command status when update checks fail - #1603
Merged
Lorenzobattistela merged 2 commits intoOct 16, 2026
Merged
Conversation
Lorenzobattistela
approved these changes
Oct 16, 2026
Lorenzobattistela
approved these changes
Oct 16, 2026
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.
Problem and fix
A fresh, parseable update cache with a non-string
ver, or a newer version with a non-stringnotice, can throw after the command finishes. A program may print its correct result but exit 1; an explicit exit 7 also becomes 1.Catch rejection from the optional daily check at its sole CLI callsite. This preserves the documented rule that the check never fails the command, without adding cache-validation or repair machinery.
Blast radius
Two files: one production line in
bend2/main.ts, and eight regression lines in the existinggates/ping.tsdaily-check cases. The tests reuse its private cache and helpers; existing cleanup resets the cache afterward.Valid notices, refresh behavior, telemetry opt-out and command failures retain their behavior. No public API or cache-format change.
Regression evidence
The two fresh-cache cases cover null version and null notice. Both exact assertions fail against the original compiled CLI, which prints help then exits 1 with a TypeError, and pass against the corrected binary with identical help, exit 0 and empty stderr.
Source and compiled CLI controls also cover valid current/newer/stale-offline caches. Independent source checks verify preserved checker failures, exit 7, notice sanitation/truncation and no HTTP requests for fresh caches.
Checks
git diff --checkpasses.bend.tsandsafe.ts; no new diagnostics. This is not a clean typecheck.comp.tsat 64,092/64,000 ttok, also present on main's #1600 check. This PR leavescomp.tsuntouched.Validation limits
Local checks used macOS arm64 and Bun 1.3.11. Full ping skips because the sibling site repository is unavailable; replaying its added assertions does not validate the full installer/release flow. Linux/WSL, Windows and cluster checks were not run. The inherited compiler-cap failure prevents a green repository gate.
Malformed cache data remains on disk until normal refresh; this change preserves the command result rather than repairing that data.