earendil-works/pi · error
API cannot cancel deferred responses
Error message
API cannot cancel deferred responses
What it means
Error "API cannot cancel deferred responses" thrown in earendil-works/pi.
Source
Thrown at packages/ai/src/api/lazy.ts:92
const api: ProviderStreams = {
stream: (model, context, options) =>
lazyStream(model, async () => (await load()).stream(model, context, options)),
streamSimple: (model, context, options) =>
lazyStream(model, async () => (await load()).streamSimple(model, context, options)),
};
if (capabilities?.fetchDeferred) {
api.fetchDeferred = (model, handle, options) =>
lazyStream(model, async () => {
const implementation = await load();
if (!implementation.fetchDeferred) throw new Error("API does not support deferred responses");
return implementation.fetchDeferred(model, handle, options);
});
}
if (capabilities?.cancelDeferred) {
api.cancelDeferred = async (model, handle, options) => {
const implementation = await load();
if (!implementation.cancelDeferred) throw new Error("API cannot cancel deferred responses");
await implementation.cancelDeferred(model, handle, options);
};
}
return api;
}
View on GitHub (pinned to 4af9d21d3b)
Solutions
- Do not cancel deferred responses through this API; let them complete or discard the handle.
When it happens
Trigger: Thrown at packages/ai/src/api/lazy.ts:92 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of earendil-works/pi@4af9d21d3b (2026-08-24).
Data as JSON: /api/errors/777abaf4fc6c5bbf.
Report an issue: GitHub.