Skip to content

Commit 248791f

Browse files
zainmitchellclaude
andcommitted
test(contracts): pin that dispatched Stops drop the internal retry bound
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 813a255 commit 248791f

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

‎packages/contracts/src/rpc.test.ts‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,28 @@ describe("WebSocket RPC contracts", () => {
5656
).toBe(true);
5757
});
5858

59+
it("drops a client-supplied retry bound from a dispatched Stop", () => {
60+
const dispatchCommand = WsRpcGroup.requests.get(ORCHESTRATION_V2_WS_METHODS.dispatchCommand);
61+
if (dispatchCommand === undefined) throw new Error("dispatchCommand is not registered");
62+
const decode = Schema.decodeUnknownSync(dispatchCommand.payloadSchema);
63+
64+
const decoded = decode({
65+
type: "thread.stop",
66+
commandId: "stop-1",
67+
threadId: "thread-1",
68+
reason: "User stopped the thread.",
69+
throughSequence: 0,
70+
});
71+
72+
expect(decoded).not.toHaveProperty("throughSequence");
73+
expect(decoded).toStrictEqual({
74+
type: "thread.stop",
75+
commandId: "stop-1",
76+
threadId: "thread-1",
77+
reason: "User stopped the thread.",
78+
});
79+
});
80+
5981
it("lets the server pick a new worktree's folder", () => {
6082
const createWorktree = WsRpcGroup.requests.get(WS_METHODS.vcsCreateWorktree);
6183
if (createWorktree === undefined) throw new Error("vcs.createWorktree is not registered");

0 commit comments

Comments
 (0)