Skip to content

Commit 32cdc54

Browse files
committed
test(agents): validate protected error marker capture
Narrow the generated marker capture before recording it so the real network-error loop regression also passes its owning test-type graph.
1 parent c7bd4a6 commit 32cdc54

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎src/agents/agent-tools.before-tool-call.network-error.test.ts‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,12 @@ describe("before-tool-call network execution error boundary", () => {
8181
...(failure as Error).message.matchAll(/EXTERNAL_UNTRUSTED_CONTENT id="([a-f0-9]{16})"/g),
8282
];
8383
expect(matches).toHaveLength(2);
84-
expect(matches[0]?.[1]).toBe(matches[1]?.[1]);
85-
markerIds.add(matches[0]![1]);
84+
const markerId = matches[0]?.[1];
85+
if (!markerId) {
86+
throw new Error("Expected a generated external-content marker");
87+
}
88+
expect(markerId).toBe(matches[1]?.[1]);
89+
markerIds.add(markerId);
8690
}
8791
expect(markerIds.size).toBe(20);
8892
const result = await tool.execute("network-loop-blocked", {});

0 commit comments

Comments
 (0)