Cortex · Failed runs

model_call_failed

A run fails with code model_call_failed when the call to the model fails. The run still returns a result: ok is false, and the error’s message is the one Signal reported. No model turn is scripted: the API key is passed empty, so no request is sent.

Agent, client without API key
const desk = defineAgent({ id: 'desk', instructions: 'Answer the member in one sentence.' });
const llm = createSignal('groq', { apiKey: '' });

const result = await desk.run('When do the doors open on Saturday?', { llm }).result;
Result
{
  ok: false,
  error: {
    code: 'model_call_failed',
    message: 'Missing API key for groq. Set GROQ_API_KEY or pass apiKey.',
  },
}
Output matches the expected value

Runs in this page on the installed package. The input and the expected output are defined by the example.