Skip to content

fix(daemon): skip a locally edited installed skill instead of failing every turn - #2803

Merged
zfy0701 merged 1 commit into
mainfrom
claude/github-issue-2802-16ceba
Oct 6, 2026
Merged

zfy0701 merged 1 commit into
mainfrom
claude/github-issue-2802-16ceba

Conversation

@zfy0701

@zfy0701 zfy0701 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Refs #2802

Problem

When an agent edited one of its own installed skills (changed SKILL.md, added a references/ file), the next skill reinstall failed every turn with SkillLedgerSafetyError: ... the prior executable set could not be restored:

  1. Planning placed the edited bundle in prior without checking it against its receipt and scheduled a replacement.
  2. The confined helper's reserve refused it (refusing to replace unowned skill: skill mutation source changed). Nothing had moved yet.
  3. Recovery's discard and restore verified the same bundle against the receipt and failed again, so the ledger stayed in applying.
  4. Every later preparation started by recovering that journal and hit the same failure.

Fix

  • Planning: each recorded bundle is checked against its receipt. A bundle that no longer matches is given up and left exactly as it is:
    • Still desired: it takes the existing unowned-conflict path (skills: skipped unowned skill <path>: it was modified after installation; remove it to reinstall), and the other skills still install.
    • No longer desired: it is left in place, not removed, and is not reported as removed.
  • Recovery: a prior that is still at its own path, with no quarantine or tombstone from its operation beside it, and no longer matches its receipt is given up instead of discarded or restored. A workspace already stuck in applying therefore recovers on its own. A quarantined prior that cannot be put back still fails closed.

The cluster coordinator path (trustedPrior) is unchanged. It already treats any conflict as a hard failure.

Acceptance (from the issue)

  • A previously owned bundle that no longer matches its receipt is skipped with a warning and reported as a conflict; it does not fail the turn or block other skills.
  • The misleading "could not be restored" error no longer appears for this case, because recovery now succeeds when nothing was moved. The message still names the installation failure when recovery genuinely fails.

Tests

  • skill-install-ledger.test.ts:
    • Issue repro: an edited skill is skipped while its sibling updates.
    • An edited skill that is no longer desired is left in place.
    • A stuck applying journal whose prior was edited in place recovers.
    • A modified retained prior is given up in recovery.
    • The refusal tests now expect skip-as-conflict.
    • The "names the installation failure" test now triggers a real recovery failure (a tampered quarantine).
  • unified-skills.test.ts: the tamper test now expects a conflict error entry instead of a rejection.
  • Ran skill-install-ledger and unified-skills on Linux with bwrap active (53 passed). Also ran the shim and cluster skill tests (40 passed).

🤖 Generated with Claude Code . Claude Opus 5.5

… every turn

An agent that edited one of its own installed skills wedged the workspace:
the next reinstall planned a replacement of the edited bundle, the confined
helper refused it, and recovery then failed verifying the same bundle, so the
ledger stayed in `applying` and every later turn hit the same error.

Planning now checks each recorded bundle against its receipt. One that no
longer matches is given up and left in place: skipped and reported as a
conflict like a foreign bundle when still desired, left alone rather than
removed when not. Recovery gives up a prior edited where it stands, with no
quarantine or tombstone of its operation beside it, instead of discarding or
restoring it, so a workspace already stuck in `applying` recovers on its own.

Refs #2802

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zfy0701
zfy0701 enabled auto-merge (squash) October 6, 2026 00:20

@agentconnect-md-test agentconnect-md-test Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed d030f3f. No blocking findings.

The change preserves edited bundles, reports desired ones as conflicts, and allows sibling skills to update. Recovery relinquishes ownership when an edited bundle remains in place without quarantine or tombstone artifacts, while damaged quarantines still fail closed.

Validation: inspected the reconciliation, mutation, recovery, and caller paths plus the regression tests; git diff --check passed. Linux sandbox CI passed, with other checks still pending. Local focused tests did not run because dependency setup remained incomplete.

sent by review-bot (Codex · gpt-6-astra) · open in session

@zfy0701
zfy0701 merged commit 1195ce8 into main Oct 6, 2026
13 checks passed
@zfy0701
zfy0701 deleted the claude/github-issue-2802-16ceba branch October 6, 2026 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant