Repository navigation
fix(skills): keep a failed update run honest when nothing converged - #11112
brennanb2025 wants to merge 1 commit into
Conversation
a866083 stopped blaming the run for copies `skills update` merely leaves old (lock drift: the CLI compares its lock to the source, prints up-to-date, exits 0, writes nothing). But finish() discards the spawn error whenever the re-scan verdict is empty — so after that change an offline or ENOENT run whose skills stayed merely outdated published green "Updated N skills". Thread the command's own result into the verdict: `outdated` is forgiven only when the CLI reported success. Current/newer-known copies still count as landed even on a non-zero exit (a peer skill can fail the process), and the clean-exit lock-drift case still settles success.
|
Closing: superseded by the revert in #11110. This patched the spawnError/exit-code interaction inside the forgiven-outdated semantics from a866083, but the forgiveness itself was the wrong layer — on the exact user-reported path (clean exit 0, CLI no-ops off its lock cache) it turns a universal false red into a universal false green. The real fix is upstream eligibility gating (don't offer an update the command cannot converge: lock skillFolderHash vs the disk revision's gitTreeSha via matchingKnownSnapshot in skill-package-identity.ts), owned by @nwparker on nwparker/fix-skill-updater-registration. The exit-code-honesty test pins in this branch are worth carrying into that work. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughSkill update outcome evaluation now accepts a command failure flag. Outdated placements are forgiven only when the update command succeeds; they can count as failures when the command fails. ✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What regressed
#11105 (a866083) reclassified
outdatedas not-a-failed-run so a clean-exit lock-drift no-op stops arming the red banner + Retry loop. Correct — butfinish()insrc/main/skills/skill-update-run.tsdiscardsspawnErrorwhenever the re-scan verdict is empty (failedNames ?? (spawnError ? names : [])short-circuits on[]). Pre-#11105 an empty verdict proved the requested skills converged; post-#11105 it also covers "left old and untouched".Exact false-success path: offline / npx ENOENT / non-zero exit -> CLI writes nothing -> skills still merely
outdated-> verdict[]-> run publishes green "Updated N skills" and a green status-bar check, masking the process failure.Fix
Thread the command's own result into the verdict (the cheap honest signal — no pre-run state, no stdout parsing):
skill-update-run.ts:rescan(names, spawnError !== null)ipc/skills.ts: forwards the flagskill-update-outcome.ts:outdatedis forgiven only when the CLI reported success;current/newer-knownstill count as landed even on a failed exit (a peer skill can fail the process — preserves the tested behavior)The #11105 core fix survives: exit 0 + outdated -> success, no banner, no Retry.
Test evidence
pnpm vitest runoutcome + run + ipc/skills tests: 38/38 passoutdatedunconditionally:still blames an outdated copy when the command itself failedfails (1/12)commandFailed=false:reports the failure when the command failed and nothing convergedfails (1/20)treats a clean re-scan as success even though the exit code is non-zero) and both fix(skills): stop reporting a failed update when the CLI succeeded #11105 reversal pins still passrm -f config/*.tsbuildinfo && pnpm run tc: clean