Skip to content

fix(api): drop deactivated NyxID services from system-services facet (#715)#736

Merged
chronoai-shining merged 1 commit into
developfrom
fix/715-filter-deactivated-nyxid-services
May 28, 2026
Merged

fix(api): drop deactivated NyxID services from system-services facet (#715)#736
chronoai-shining merged 1 commit into
developfrom
fix/715-filter-deactivated-nyxid-services

Conversation

@chronoai-shining
Copy link
Copy Markdown
Collaborator

Summary

  • /skill-facets/system-services now intersects the DB aggregation with NyxID's live active set (via a new NyxidServiceClient.listActiveServiceIdsAsPlatform(saToken)), so services NyxID has deactivated stop appearing as filter chips.
  • NyxID catalog cache TTL drops 60s → 10s — /me/nyxid-services and /nyxid-services/:serviceId/skills (which already filter is_active=false) now reflect deactivations within 10s instead of 60s.
  • Both code paths fail-soft: if NyxID is unreachable, the facet falls back to the legacy raw aggregation rather than emptying the response.
  • 8 new colocated tests in service.test.ts.

Test plan

  • bun test src/clients/nyxid/service.test.ts — 8/8 green
  • bun run typecheck:api — no new errors
  • Full ornn-api suite — 730 pass / 18 unrelated pre-existing failures (validateSkillFrontmatter [Bug] [Skill Upload] Some frontmatter validation errors only show generic Invalid input #649)
  • Local manual: per the QA repro — create a NyxID public service, bind a skill, deactivate the service, wait ≥10s, hit /skill-facets/system-services and confirm the service no longer appears.

Out of scope: skill-detail still shows the historical nyxidServiceId/slug/label even when the service is deactivated. The issue lists multiple acceptable mitigations; closing the discovery surface is the highest-leverage one. Follow-up can mark detail as 'service unavailable' if we want a louder signal.

Fixes #715

…715)

NyxID's DELETE /services/:id is a soft delete that flips is_active to
false. The Ornn DB aggregation behind /skill-facets/system-services
reads nyxidServiceId/slug/label straight off skill documents, so any
skill ever bound to a now-deactivated service kept surfacing the
service as a usable filter chip. Per-caller paths
(/me/nyxid-services, /nyxid-services/:serviceId/skills) already
filtered is_active=false inside NyxidServiceClient, but the 60-second
catalog cache widened the post-deletion visibility lag.

Fix:

- NyxidServiceClient.listActiveServiceIdsAsPlatform(saToken) (new):
  SA-token fetch of NyxID's /services projected to a Set<string> of
  active ids, kept in a one-slot cache (SA view is uniform across
  callers). Fail-soft: returns null on non-2xx or thrown fetch so
  callers can fall through to legacy behaviour when NyxID is
  unreachable.
- /skill-facets/system-services intersects the DB aggregation with
  that active set when the client + SA accessor are wired in; falls
  through to the raw aggregation otherwise. Bootstrap passes both.
- cacheTtlMs 60s -> 10s. After a NyxID deactivation every surface
  that goes through findVisibleToCaller drops the service within at
  most 10s instead of 60s.
- invalidateCache() also clears the platform cache.

Skill detail still shows the historical nyxidServiceId/slug/label
even when the service is deactivated — out of scope here. The issue
lists multiple acceptable mitigations; closing the discovery surface
is the highest-leverage one. A follow-up can mark the detail panel
as "service unavailable" if a louder signal is wanted.

Coverage: 8 colocated tests in service.test.ts — per-caller
is_active drop (defence-in-depth), missing is_active default,
platform method URL + auth header, caching, fail-soft on 5xx and
network throw, empty-SA short-circuit, invalidateCache re-fetch.
748 tests pass total / 18 unrelated pre-existing failures.

Fixes #715
@chronoai-shining chronoai-shining merged commit 74b8f93 into develop May 28, 2026
15 checks passed
@chronoai-shining chronoai-shining deleted the fix/715-filter-deactivated-nyxid-services branch May 28, 2026 05:49
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.

[Bug] [NyxID Integration] Deactivated NyxID service is still exposed as an Ornn system service

1 participant