Skip to content

fix(server): diagnose learned-skill listing failures - #2644

Merged
jbeda merged 1 commit into
mainfrom
fix/learned-skill-list-diagnostics
Nov 2, 2026
Merged

jbeda merged 1 commit into
mainfrom
fix/learned-skill-list-diagnostics

Conversation

@jbeda

@jbeda jbeda commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Emit safe structured diagnostics when ListLearnedSkills fails during publication or repository listing, before the service replaces the backend error with its existing generic client response.
  • Classify wrapped causes by identity: generation change, deadline, cancellation, disk full, quota exceeded, or unclassified. Diagnostic fields contain only fixed operation/category strings—not raw backend errors, paths, skill contents, or caller identity.
  • Include captured diagnostics in the policy matrix's RPC failure output.
  • Preserve client error mappings and all existing retries, timeouts, synchronization, publication, and storage behavior.

Closes #1088.

Historical finding

#1230, merged September 8, already documented a reproduction of the matching untrusted_project_ignored / generic learned-skill error and fixed the missing publication lock across non-publishable partition writes. That PR had no linked closing issue, and #1088 remained open with its observability criteria unfinished.

This PR completes those diagnostic criteria; it is not another synchronization fix and does not claim every possible generic learned-skill error has the same cause. The separate missing-skill evidence-backoff fix in #2640 and catalog investigation in #1223 are distinct.

Verification

  • task test (rerun after review follow-ups)
  • task lint (rerun after review follow-ups)
  • task test:race (rerun after review follow-ups)
  • go run ./cmd/mecademo (tool call/result, permission ask/approval, terminal result)
  • Focused server diagnostics: -race -count=20 -cpu=1,2,4
  • Focused app diagnostics, complete policy matrix, original publication-lock regression, and stale-generation regression: -race -count=10 -cpu=1,2,4
  • Review follow-up: stale-generation, real-build diagnostics, and publication-lock regressions: -race -count=20 -cpu=1,2,4

Coverage includes:

  • Both failure stages and wrapped error categories; exact bounded diagnostic records; unchanged generic service/gRPC errors; no retry; success/validation behavior; nil diagnostic sink.
  • Real Build with a test-owned malformed skill manifest: the configured diagnostic sink receives the failure, does not expose repository details, and listing recovers after repair.
  • Negative controls: removing the publication log makes the injected-error tests fail; returning a different generation-error identity with identical text makes the real stale-publication regression fail.
  • Temporary disk-full injection in the real matrix failure path confirmed its output contains the unchanged generic client error plus the safe publication/no-space diagnostic, without the injected raw error detail. All temporary injections were removed.

Panel review

Reviewed against b78d227d3 across independent Spec, Standards, Test adequacy, Security, Architecture, Library reuse, and Duplication reviewers.

  • Spec and Standards: clear.
  • Test adequacy: one important finding addressed—the real generation-error producer is now checked against the server classifier's shared sentinel by the existing deterministic regression. The original reviewer verified resolution.
  • Domain: one advisory addressed—removed the redundant private sentinel alias. Security, architecture, and library-reuse reviews were clear.
  • No unresolved findings, ship-blockers, or reviewer failures.

API compatibility

Compatible observability-only change. Client error text and mapping, gRPC status/details, HTTP error classification, request/response schemas, and ordering remain unchanged. No API-major or feature identifier change, no client upgrade, and no persisted-data changes. The shared generation-error sentinel is confined to the root module's internal server/composition callback contract; no public engine/module Go API changes.

Record bounded operation and error-category diagnostics before ListLearnedSkills collapses backend errors. Preserve generic client responses and include captured diagnostics in matrix failures. Verify wrapped causes, configured sink delivery, and real publisher error identity.

Co-authored-by: Mecatl <[email protected]>
@jbeda
jbeda merged commit da8c09e into main Nov 2, 2026
45 checks passed
@jbeda
jbeda deleted the fix/learned-skill-list-diagnostics branch November 2, 2026 01:30
@toolhive-release-app toolhive-release-app Bot mentioned this pull request Nov 18, 2026
2 tasks
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.

test(learning): diagnose intermittent learned-skill publication failure

1 participant