Skip to content

fix(registry): shield skills search route cache behind cached() - #251

Merged
harlan-zw merged 1 commit into
mainfrom
fix/issue-249
Sep 17, 2026
Merged

harlan-zw merged 1 commit into
mainfrom
fix/issue-249

Conversation

@harlan-github-agent

Copy link
Copy Markdown
Contributor

🔗 Linked issue

Closes #249

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

The daily-checkin routine caught a KV GET failed: 500 on /api/skills (Sentry SKILLD-28) and traced it to this route, the last registry route still on Nitro's defineCachedEventHandler. The detail route (#146) and skill-files (#201) hit the same family and moved to the repo's own SWR cache helper, where a failed KV read is a miss, a failed write is a dropped cache entry, neither can reach the request, and both report as wide events. This route now does the same, keeping the old cache identity: deployment-scoped, full sorted query string, hashed so distinct searches cannot collapse into one key.

One caveat I measured before migrating: driving the installed Nitro 2.13.4 with a storage whose getItem throws KV GET failed: 500 Internal Server Error, the request still answered 200. Nitro's own catch already absorbed the read and reported it through captureError, which is what Sentry recorded. So on the current version the exposure was the shielding being a Nitro version detail plus a captured error per failed read, not a user-facing 500. The cache key namespace moved to skills-list:v2: because the stored envelope format changed; old entries age out within the 60s + 5min window.

One thing for a reviewer to confirm: Nitro's route cache also set response headers (etag, last-modified, x-nitro-cache); I believe nothing consumes those on this JSON surface, and #146 dropped them the same way, but I did not audit every client.

🤖 AI disclosure: Harlan Agent Kit modified this description. My AI open-source policy.

@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. labels Sep 16, 2026
@harlan-github-agent

harlan-github-agent Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 MERGED

Harlan Agent Kit posted this automated review. It is not Harlan's personal review or approval. AI open source policy. Last updated: 2026-09-17 03:31 UTC.

GitHub merged this pull request.

No material findings were recorded.

73a9f4d5-1b84-40d5-8507-6881d42e07f8

@harlan-github-agent harlan-github-agent Bot added harlan-agent-ready The automated Review passed every gate on this head commit. and removed harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. labels Sep 16, 2026
@harlan-zw
harlan-zw merged commit 8173c2e into main Sep 17, 2026
5 checks passed
@harlan-github-agent harlan-github-agent Bot removed the harlan-agent-ready The automated Review passed every gate on this head commit. label Sep 17, 2026
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.

Skills search route cache turns a KV GET 500 into a request 500

1 participant