Skip to main content

AIMock Testing

CortexFS can use @copilotkit/aimock as a local OpenAI-compatible provider for provider-path tests that should not call a real cloud API.

Start the mock server:

npm install
npm run aimock

The server listens on:

http://127.0.0.1:4010/v1

The default fixture lives at:

tests/fixtures/aimock/cortexfs-openai-chat.json

It returns cortexfs aimock ok for hi and hello cortexfs.

Run the smoke test:

npm run aimock:smoke

To point CortexFS at the mock, add a provider config in your local runtime environment:

{
"name": "aimock",
"base_url": "http://127.0.0.1:4010/v1"
}

Then store the fixture key in the CortexFS system secret store:

printf '%s\n' mock | sudo ctx provider secret set aimock

This stays outside the /ctx root ABI and outside process environments. It is a local provider test fixture, not a new CortexFS provider namespace.