summaryrefslogtreecommitdiffhomepage
path: root/src/core/wire
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-06-25 10:52:13 +0900
committerAdam Malczewski <[email protected]>2026-06-25 10:52:13 +0900
commit17ce47987e673b6618454d033885b17b2a01912e (patch)
tree2bd7259d51725eeadc20d410667d529f66834197 /src/core/wire
parenteff289b2b4cc41db706f3c3274a089d46012be87 (diff)
downloaddispatch-web-17ce47987e673b6618454d033885b17b2a01912e.tar.gz
dispatch-web-17ce47987e673b6618454d033885b17b2a01912e.zip
feat(core): chunks retry-banner, wire conformance, ws logic, history adapter
- core/chunks: add retry-banner view-model (+test), update reducer/selectors/types - core/wire: update conformance checks (+test) - adapters/ws: update reconnect logic (+tests) - adapters/history: new client-side routing adapter (history + popstate wrapper)
Diffstat (limited to 'src/core/wire')
-rw-r--r--src/core/wire/conformance.test.ts17
-rw-r--r--src/core/wire/conformance.ts2
2 files changed, 16 insertions, 3 deletions
diff --git a/src/core/wire/conformance.test.ts b/src/core/wire/conformance.test.ts
index c50cbf4..b5dd8e1 100644
--- a/src/core/wire/conformance.test.ts
+++ b/src/core/wire/conformance.test.ts
@@ -76,6 +76,15 @@ describe("classifies every AgentEvent type", () => {
{ type: "done", conversationId: "c1", turnId: "t1", reason: "complete" },
{ type: "turn-sealed", conversationId: "c1", turnId: "t1" },
{ type: "steering", conversationId: "c1", turnId: "t1", text: "steer mid-turn" },
+ {
+ type: "provider-retry",
+ conversationId: "c1",
+ turnId: "t1",
+ attempt: 0,
+ delayMs: 5000,
+ message: "HTTP 429: overloaded",
+ code: "429",
+ },
];
it("returns a stable label for every AgentEvent.type variant", () => {
@@ -95,11 +104,12 @@ describe("classifies every AgentEvent type", () => {
"done",
"turn-sealed",
"steering",
+ "provider-retry",
]);
});
- it("covers all 14 AgentEvent variants", () => {
- expect(samples).toHaveLength(14);
+ it("covers all 15 AgentEvent variants", () => {
+ expect(samples).toHaveLength(15);
});
});
@@ -139,11 +149,12 @@ describe("classifies every WsServerMessage type", () => {
event: { type: "done" as const, conversationId: "c", turnId: "t", reason: "r" },
},
{ type: "chat.error" as const, message: "e" },
- { type: "conversation.open" as const, conversationId: "c1" },
+ { type: "conversation.open" as const, conversationId: "c1", workspaceId: "w1" },
{
type: "conversation.statusChanged" as const,
conversationId: "c1",
status: "active" as const,
+ workspaceId: "w1",
},
{
type: "conversation.compacted" as const,
diff --git a/src/core/wire/conformance.ts b/src/core/wire/conformance.ts
index 07808fc..7da4794 100644
--- a/src/core/wire/conformance.ts
+++ b/src/core/wire/conformance.ts
@@ -36,6 +36,8 @@ export function assertAgentEventExhaustive(event: AgentEvent): string {
return "step-complete";
case "steering":
return "steering";
+ case "provider-retry":
+ return "provider-retry";
default:
return event satisfies never;
}