Skip to content

fix(skills-init): allow Git retries after stale destinations - #2655

Open
Tethys0 wants to merge 1 commit into
kagent-dev:mainfrom
Tethys0:fix/skills-init-retry-2646
Open

fix(skills-init): allow Git retries after stale destinations#2655
Tethys0 wants to merge 1 commit into
kagent-dev:mainfrom
Tethys0:fix/skills-init-retry-2646

Conversation

@Tethys0

@Tethys0 Tethys0 commented Sep 1, 2026

Copy link
Copy Markdown

Summary

Fixes #2646.

skills-init retries its configured Git refs after an init-container restart. A prior attempt can leave a ref destination populated, so the next git clone fails with destination path already exists and masks the original fetch failure. This change stages each clone in a temporary sibling, preserves the existing destination until the new clone is ready, then atomically installs the staged result. It also validates the managed destination, preserves the existing 0755 skill-root permissions, and keeps SubPath processing inside the staged tree.

Scope

  • Git ref fetches only.
  • OCI and S3 destinations are intentionally unchanged.
  • No new dependencies or API changes.

Testing

  • go test -race ./core/internal/skillsinit (43 passed)
  • go vet ./core/internal/skillsinit
  • gofmt and git diff --check

The broader core test suite was also exercised; database tests require a Docker/Postgres provider unavailable in this WSL environment, while the non-database core tests passed.

Signed-off-by: Bo Zhang <187063395+Tethys0@users.noreply.github.com>
@Tethys0
Tethys0 requested a review from a team as a code owner September 1, 2026 16:14
@github-actions github-actions Bot added the bug Something isn't working label Sep 1, 2026

@EItanya EItanya 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.

What if we just make the skills download code reentrant safe? We can just check for the presence of an existing skill, and if it exists don't download the new one

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

skills-init: not idempotent across init-container restarts — leftover clone dest bricks the pod until manual deletion

2 participants