Reject empty agent session ids in websocket event envelopes
Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
1 parent
dd02660502
commit
e0a9865d02
1 file changed
+26
@@ -383,6 +383,32 @@ describe("wsServerMessageSchema", () => {
|
||||
).toThrow();
|
||||
});
|
||||
|
||||
it("rejects agent events with empty session ids", () => {
|
||||
expect(() =>
|
||||
wsServerMessageSchema.parse({
|
||||
type: "event",
|
||||
channel: WS_EVENT_CHANNELS.agentOutput,
|
||||
payload: {
|
||||
sessionId: "",
|
||||
stream: "stdout",
|
||||
data: "hello",
|
||||
},
|
||||
}),
|
||||
).toThrow();
|
||||
|
||||
expect(() =>
|
||||
wsServerMessageSchema.parse({
|
||||
type: "event",
|
||||
channel: WS_EVENT_CHANNELS.agentExit,
|
||||
payload: {
|
||||
sessionId: "",
|
||||
code: 0,
|
||||
signal: null,
|
||||
},
|
||||
}),
|
||||
).toThrow();
|
||||
});
|
||||
|
||||
it("rejects unexpected event properties", () => {
|
||||
expect(() =>
|
||||
wsServerMessageSchema.parse({
|
||||
|
||||
Reference in new issue
Block a user