Skip to content

feat(control-api): add GET /__aimock/fixtures introspection endpoint - #407

Open
Ayush7614 wants to merge 1 commit into
CopilotKit:mainfrom
Ayush7614:feat/aimock-fixtures-introspection
Open

feat(control-api): add GET /__aimock/fixtures introspection endpoint#407
Ayush7614 wants to merge 1 commit into
CopilotKit:mainfrom
Ayush7614:feat/aimock-fixtures-introspection

Conversation

@Ayush7614

Copy link
Copy Markdown

Returns the current number of loaded fixtures as { count }.

Why: The control API already allows dynamic fixture management via POST /__aimock/fixtures (add) and DELETE /__aimock/fixtures (clear) and full resets, but had no read-only introspection. CI jobs, integration tests, and debugging sessions had no way to verify fixtures were loaded short of making a probe chat request.

What:

  • GET /__aimock/fixtures200 { count: number }
  • Read-only, CORS headers set, and respects inbound AIMOCK_API_KEYS auth (same path as other /__aimock/* routes)
  • No serialization of predicate functions — just the count, so no leakage of server-side closures

Verified:

  • pnpm build && pnpm test src/__tests__/control-api.test.ts — 19 passed
  • Manual probe:
    GET /__aimock/fixtures  { count: 2 }
    POST /__aimock/fixtures { fixtures:[...] }  { added: 1 }
    GET /__aimock/fixtures  { count: 3 }
  • pnpm run format:check / pnpm run lint / pnpm run typecheck clean

Returns the current number of loaded fixtures as { count }. Useful
for CI debugging, health checks, and verifying fixture loads after
dynamic POST /__aimock/fixtures adds or DELETE clears. The endpoint
is read-only, CORS-enabled, and respects inbound API-key auth like
the other control routes.
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.

1 participant