fix: surface reviewer response failures
This commit is contained in:
@@ -105,6 +105,30 @@ test("assistant provider errors are sanitized and leave the turn failed", () =>
|
||||
expect(JSON.stringify(seen)).not.toContain("DO_NOT_LEAK");
|
||||
});
|
||||
|
||||
test("subscription model errors become a safe actionable client message", () => {
|
||||
const { rpc, fire } = fakeRpc();
|
||||
const bridge = new SessionBridge(rpc);
|
||||
const seen: any[] = [];
|
||||
bridge.onClientEvent((event) => seen.push(event));
|
||||
|
||||
fire({
|
||||
type: "message_end",
|
||||
message: {
|
||||
role: "assistant",
|
||||
stopReason: "error",
|
||||
errorMessage: "429: {\"code\":\"1311\",\"message\":\"Your current subscription plan does not yet include access to GLM-5.3\",\"secret\":\"DO_NOT_LEAK\"}",
|
||||
},
|
||||
});
|
||||
|
||||
expect(seen).toContainEqual({
|
||||
type: "info",
|
||||
level: "error",
|
||||
text: "The selected model is unavailable for the current subscription. Choose another model and start a new session.",
|
||||
});
|
||||
expect(JSON.stringify(seen)).not.toContain("GLM-5.3");
|
||||
expect(JSON.stringify(seen)).not.toContain("DO_NOT_LEAK");
|
||||
});
|
||||
|
||||
test("markFailed records backend-detected failure without emitting raw detail", () => {
|
||||
const { rpc } = fakeRpc();
|
||||
const bridge = new SessionBridge(rpc);
|
||||
|
||||
Reference in New Issue
Block a user