



























@@ -5890,7 +5890,7 @@ describe("runAgentTurnWithFallback", () => {
58905890}
58915891});
589258925893-it("surfaces gateway restart text when fallback exhaustion wraps a drain error", async () => {
5893+it("surfaces restart text when fallback exhaustion wraps a drain error, keeping fail bookkeeping", async () => {
58945894const { replyOperation, failMock } = createMockReplyOperation();
58955895state.runWithModelFallbackMock.mockRejectedValueOnce(
58965896Object.assign(new Error("fallback exhausted"), {
@@ -5943,7 +5943,7 @@ describe("runAgentTurnWithFallback", () => {
59435943expect(failCall[1]).toBeInstanceOf(GatewayDrainingError);
59445944});
594559455946-it("surfaces gateway restart text when fallback exhaustion wraps a cleared lane error", async () => {
5946+it("surfaces restart text when fallback exhaustion wraps a cleared lane error, keeping fail bookkeeping", async () => {
59475947const { replyOperation, failMock } = createMockReplyOperation();
59485948state.runWithModelFallbackMock.mockRejectedValueOnce(
59495949Object.assign(new Error("fallback exhausted"), {
@@ -5996,7 +5996,7 @@ describe("runAgentTurnWithFallback", () => {
59965996expect(failCall[1]).toBeInstanceOf(CommandLaneClearedError);
59975997});
599859985999-it("surfaces gateway restart text when the reply operation was aborted for restart", async () => {
5999+it("stays silent (NO_REPLY) when the reply operation was aborted for restart", async () => {
60006000const agentEvents = await import("../../infra/agent-events.js");
60016001const emitAgentEvent = vi.mocked(agentEvents.emitAgentEvent);
60026002const { replyOperation, failMock } = createMockReplyOperation();
@@ -6031,13 +6031,12 @@ describe("runAgentTurnWithFallback", () => {
60316031sessionKey: "main",
60326032getActiveSessionEntry: () => undefined,
60336033resolvedVerboseLevel: "off",
6034+isRestartRecoveryArmed: () => true,
60346035});
6035603660366037expect(result.kind).toBe("final");
60376038if (result.kind === "final") {
6038-expect(result.payload.text).toBe(
6039-"⚠️ Gateway is restarting. Please wait a few seconds and try again.",
6040-);
6039+expect(result.payload.text).toBe(SILENT_REPLY_TOKEN);
60416040}
60426041expect(failMock).not.toHaveBeenCalled();
60436042expect(
@@ -6087,12 +6086,13 @@ describe("runAgentTurnWithFallback", () => {
60876086sessionKey: "main",
60886087getActiveSessionEntry: () => undefined,
60896088resolvedVerboseLevel: "off",
6089+isRestartRecoveryArmed: () => true,
60906090});
6091609160926092expect(result).toEqual({
60936093kind: "final",
60946094payload: expect.objectContaining({
6095-text: "⚠️ Gateway is restarting. Please wait a few seconds and try again.",
6095+text: SILENT_REPLY_TOKEN,
60966096}),
60976097});
60986098expect(
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。