earendil-works/pi · error · TypeError
Deferred assistant messages are not supported by protocol v1
Error message
Deferred assistant messages are not supported by protocol v1
What it means
toProtocolAssistantMessage hit stopReason 'deferred', which protocol v1 has no wire representation for. The internal agent produced a deferred (continued-later) assistant message that cannot yet be surfaced to protocol clients; it should be withheld until it resolves to a supported stop reason.
Solutions
- Protocol v1 cannot carry deferred assistant messages; upgrade the protocol or avoid deferral.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/server/src/protocol.ts:314 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/9f7868f8776683f6.
Report an issue: GitHub.
Appendix: source
Thrown at packages/server/src/protocol.ts:314
...(message.responseModel === undefined
? {}
: { responseModel: identifier(message.responseModel, "Assistant response model") }),
...(usage ? { usage } : {}),
timestamp: timestamp(message.timestamp),
} as const;
switch (message.stopReason) {
case "pending":
return { ...common, status: "streaming" } satisfies AssistantTranscriptItem;
case "stop":
case "length":
case "toolUse":
return {
...common,
status: "complete",
stopReason: message.stopReason,
} satisfies AssistantTranscriptItem;
case "deferred":
throw new TypeError("Deferred assistant messages are not supported by protocol v1");
case "error":
if (message.errorMessage?.length === 0) {
throw new TypeError("Assistant error messages must not be empty");
}
return {
...common,
status: "error",
stopReason: "error",
...(message.errorMessage === undefined ? {} : { errorMessage: message.errorMessage }),
} satisfies AssistantTranscriptItem;
case "aborted":
return {
...common,
status: "aborted",
stopReason: "aborted",
...(message.errorMessage === undefined ? {} : { errorMessage: message.errorMessage }),
} satisfies AssistantTranscriptItem;
default: {View on GitHub (pinned to 4af9d21d3b)