Updater safety + config/CLI robustness (B13, B18, B20, B22) - #372
Merged
Conversation
B13: auto-updater no longer restarts on a failed update. checkForUpdate
now returns a boolean (true only when the renameSync over process.execPath
succeeds); tick() gates restartFn() on it and closes out the Slack
"auto-updating" message on failure. Auto-update is also deferred when
getQueueSize() > 0, mirroring cleanupStale.
Updater integrity: reject truncated downloads (buffer.length !==
Content-Length) and treat a missing checksum asset as a hard failure for
auto-update (new requireChecksum opt, set by the auto-updater) so we never
rename in an unverified binary. Manual `update` behavior is unchanged.
B18: empty/comment-only config no longer throws a cryptic TypeError —
parseYaml(raw) ?? {} in loadConfig, loadWorkDir, and loadCleanConfig
(mirroring validate.ts). Dropped the redundant validateCritterType loop
(parseCritterType already validates).
B20: pr-status normalizes statusCheckRollup per-entry via conclusion ??
state, so legacy StatusContext nodes map to success/failure instead of
perpetual pending. Added a 10s timeout to the gh pr view call (via
runCommand timeoutMs, which also drains stderr) and process toFetch in
sequential batches instead of dropping work beyond the cap (F6).
B22: logs --follow interpolates a real ESC byte instead of literal
"\x1b[36m". De-duped extractTimestamp/newestDir and the regex-escape
helper by exporting them from log-resolver.ts.
env.ts: loadEnvFallback strips a surrounding quote pair and supports a
leading `export ` so quoted tokens no longer leak quotes into values.
utils.ts: runCommand gains an optional timeoutMs (default unchanged).
Tests: src/__tests__/audit-updater-misc.test.ts covers B18, B20, env quote
stripping, and checkForUpdate returning false on truncated/checksum-failed/
missing-checksum downloads.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…ests normalizeCheckVerdict treated a COMPLETED CheckRun with conclusion SKIPPED/NEUTRAL/STALE/CANCELLED as 'pending' (hourglass forever), where the original code read it as success. Classify all recognized non-failing terminal conclusions as success, keep only in-flight/unknown states pending, and keep FAILURE/ERROR/TIMED_OUT/ACTION_REQUIRED (and STARTUP_FAILURE) as failure. StatusContext (state-based) handling from B20 is preserved. Tests: add coverage for SKIPPED/NEUTRAL/STALE/CANCELLED → success, and make the truncated-download test use a valid checksum so it isolates the truncation guard instead of leaning on a bad checksum. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
resolvePhaseMcpConfig expands ~ via node:os homedir(); the test compared it to process.env.HOME. Bun caches homedir() on first call and ignores later process.env.HOME mutations, so when a sibling test changes HOME they diverge on Linux CI and this test fails (works on macOS by execution-order luck). Assert against the same homedir() the implementation uses. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This was referenced Jul 18, 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.
Summary
Self-update integrity and a cluster of smaller config/CLI/display bugs.
checkForUpdatereturns success; gaterestarton it; defer when work is queuedlength != totalBytes; treat a missing checksum as a hard failureloadConfigwith a crypticTypeErrorparseYaml(raw) ?? {}in all three readers; drop redundant re-validationStatusContext(legacy commit statuses) read as perpetually pending; skipped/neutral checks tooconclusion ?? state; non-failing terminal conclusions → success; add agh pr viewtimeout; batch instead of dropping past the caplogs --followprinted literal\x1b[36minstead of colorloadEnvFallbackdidn't strip quotes/export→Bearer "lin_…"401sexportTests
audit-updater-misc.test.ts— empty config returns{}; SKIPPED/NEUTRAL/STALE/CANCELLED → success while TIMED_OUT/ACTION_REQUIRED → failure; truncated download rejected (valid-checksum isolation); env quote stripping.Verification
typecheck clean · lint exit 0 ·
bun test859 pass / 0 fail.🤖 Generated with Claude Code