earendil-works/pi · error
Unhandled proxy event type
Error message
Unhandled proxy event type: ${(proxyEvent as any).type} What it means
Exhaustiveness fallback in processProxyEvent: the switch over the proxy event discriminant hit the default case, which TypeScript's `never` check (_exhaustiveCheck) proves is unreachable for known event types. A value reaching it means an unrecognized/forward-incompatible event type arrived; the event is dropped with a console.warn (cast to any for the type field) and undefined is returned so the stream continues.
Solutions
- An unknown proxy event type arrived; update the proxy and client to compatible versions.
Defensive patterns
Strategy: type-guard
When it happens
Trigger: Thrown at packages/agent/src/proxy.ts:366 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/e4f3461a4ab631a5.
Report an issue: GitHub.
Appendix: source
Thrown at packages/agent/src/proxy.ts:366
};
}
return undefined;
}
case "done":
partial.stopReason = proxyEvent.reason;
partial.usage = proxyEvent.usage;
return { type: "done", reason: proxyEvent.reason, message: partial };
case "error":
partial.stopReason = proxyEvent.reason;
partial.errorMessage = proxyEvent.errorMessage;
partial.usage = proxyEvent.usage;
return { type: "error", reason: proxyEvent.reason, error: partial };
default: {
const _exhaustiveCheck: never = proxyEvent;
console.warn(`Unhandled proxy event type: ${(proxyEvent as any).type}`);
return undefined;
}
}
}
View on GitHub (pinned to 4af9d21d3b)