fix(routing): retry ACP transport disconnects instead of failing outright (#2680)

Co-authored-by: nova28 <17953305+nova28@users.noreply.github.com>
Co-authored-by: Carlos Florencio <carlosmflorencio@gmail.com>
This commit is contained in:
nova28
2026-08-15 23:00:55 +08:00
committed by GitHub
parent 1ae8f4cf9f
commit de4c7fbf9c
24 changed files with 645 additions and 12 deletions
@@ -247,6 +247,22 @@ describe("ActionMessage — transient retry (warning variant)", () => {
});
});
describe("ActionMessage — agent transport lost", () => {
it("renders the agent-transport-lost reason for a dropped ACP connection", () => {
renderAction(
retryMessage({
content: "Agent connection lost",
metadata: {
...transientRetryMetadata(1, 5),
failure_code: "agent_transport_lost",
},
}),
"WAITING_FOR_INPUT",
);
expect(screen.getByText(/Agent connection lost/i)).toBeTruthy();
});
});
describe("ActionMessage — retry schedule updates", () => {
it("resets the fallback countdown when a later retry schedule arrives", () => {
vi.useFakeTimers();
@@ -198,6 +198,8 @@ function transientRetryReasonKey(failureCode?: string) {
return "chat:transientRetryReasonProviderUnavailable";
case "rate_limited":
return "chat:transientRetryReasonRateLimited";
case "agent_transport_lost":
return "chat:transientRetryReasonAgentTransportLost";
default:
return "chat:transientRetryReasonGeneric";
}