Skip to content

fix(skills): don't conflate fs errors with binary/not-found in skill reads#336

Merged
inkeep-oss-sync[bot] merged 1 commit into
mainfrom
copybara/sync
Jun 26, 2026
Merged

fix(skills): don't conflate fs errors with binary/not-found in skill reads#336
inkeep-oss-sync[bot] merged 1 commit into
mainfrom
copybara/sync

Conversation

@inkeep-oss-sync

Copy link
Copy Markdown
Contributor

No description provided.

…reads (#2203)

* fix(skills): don't conflate fs errors with binary/not-found in skill reads

Two post-merge review findings from PR #1662:

- readSkillBundledFiles returned text=null for BOTH binary/oversize files AND
  genuine IO errors (EACCES/EIO/EISDIR). The cross-scope move treats a null-text
  file as binary, SKIPS it, then deletes the source — so a read error became
  silent data loss. It now throws on a real IO error (only binary/oversize and
  a vanished ENOENT file stay null), which fails GET /api/skill and aborts the
  move before any delete. +test (guarded for root, which bypasses perms).

- skill-restore's ls-tree catch mapped every git failure to version-not-found
  (HTTP 404), so a git I/O error / corrupt repo was masked as a stale-version
  404. It now classifies a bad-object/revision as version-not-found (404) and
  any other git failure as io-error (500), matching the sibling git-show catch.

* test+refactor(skills): pin the git not-found/io-error boundary, align catch

Addresses the two review suggestions on this PR:
- Extract the ls-tree error classifier to an exported isGitObjectNotFound() so
  the load-bearing 404-vs-500 regex is single-sourced and unit-tested (a bad
  object/revision stays 404; corrupt-repo / missing-binary / EACCES → 500).
- Align the sibling git-show catch to the safe e instanceof Error ? e.message
  : String(e) extraction so a non-Error rejection can't surface as 'undefined'.

* style: single-quote the test fixture strings (biome format)

---------

GitOrigin-RevId: 5a50169587c6e470a9b5a1b321b24f32245bca57

@inkeep-internal-ci inkeep-internal-ci 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.

Automated approval from agents-private public-mirror-sync (run: https://github.com/inkeep/agents-private/actions/runs/28267000246). Source of truth is the monorepo; direct edits on inkeep/open-knowledge are overwritten on next sync.

@inkeep-oss-sync
inkeep-oss-sync Bot merged commit 329d01d into main Jun 26, 2026
@inkeep-oss-sync
inkeep-oss-sync Bot deleted the copybara/sync branch June 26, 2026 21:47
@CLAassistant

CLAassistant commented Jun 26, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

2 participants