Skip to content

Repair incomplete skill-cache collisions - #4856

Open
bb-slop-cop[bot] wants to merge 1 commit into
mainfrom
slopcop/issue-4855
Open

bb-slop-cop[bot] wants to merge 1 commit into
mainfrom
slopcop/issue-4855

Conversation

@bb-slop-cop

@bb-slop-cop bb-slop-cop Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

🚨 SLOP COP 🚨 · new-issue-autopilot

Human comments

What was wrong

The host's skill-cache installer discarded a complete downloaded tree after a destination rename collision without validating the resident cache. A nonempty incomplete resident therefore survived repeated requests, causing required-skill staging to fail or use incomplete content. Reproduction and root-cause report.

What changed

  • Share the completion-marker/content-directory check between cache lookup and collision handling.
  • Preserve complete concurrent installs; replace incomplete destinations and retry the validated temporary-tree rename once.
  • Restrict collision handling to rename and always clean up the temporary tree.
  • Add four partial-cache cases and a complete concurrent-winner regression in the existing staging test owner.

The change is confined to two host-daemon files: 150 changed text lines (132 additions + 18 deletions). No dependencies, stored-data format, public protocol, CLI, SDK, packaging, or release changes. Underlying transient EIO retries and startup sweeps are deliberately outside this verified fix.

How you verified

  • On trusted main 09ff18a73bd0a8037f43c6ed86c28eb02228089c, the focused regression failed in two separate clean checkouts: 3 failing cases, 2 passing controls. Each partial-cache case attempts staging twice against the same isolated data directory.
  • pnpm exec turbo run test --filter=@bb/host-daemon -- src/injected-skills.test.ts: 20 tests pass after the fix.
  • pnpm exec turbo run typecheck --filter=@bb/host-daemon: passes.
  • The broader pnpm exec turbo run test typecheck --filter=@bb/host-daemon run passes 720 tests, including all 62 staging, global-install, and command-dispatch tests, with 2 skipped and 2 unrelated server-move failures.
  • Both server-move failures also reproduce on unchanged trusted-main production code in the second checkout: a mode expectation under umask 0077 and a null disk-free inspection result. They are not modified by this PR.
  • Formatting and git diff --check pass; no binary changes.

The empty-directory control recovers on this Linux filesystem. The reported storage-restoration trigger and exact last-used error remain unverified; the report distinguishes those limits from the reproduced nonempty-cache bug.

Fixes #4855

AGENT GENERATED

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant