Skip to content

Commit ba96325

Browse files
ellismgCopilot
andcommitted
Correlate sandbox tool completion by call ID
Track the grep execution start so the E2E can verify its successful denied-path result even when completion events omit the tool name. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 28822b2 commit ba96325

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

nodejs/test/e2e/sandbox_bypass.e2e.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,13 @@ describe("Sandbox bypass", async () => {
4949
},
5050
});
5151
expect(update.success).toBe(true);
52+
let grepToolCallId: string | undefined;
5253
session.on((event) => {
53-
if (
54+
if (event.type === "tool.execution_start" && event.data.toolName === "grep") {
55+
grepToolCallId = event.data.toolCallId;
56+
} else if (
5457
event.type === "tool.execution_complete" &&
55-
event.data.toolName === "grep" &&
58+
event.data.toolCallId === grepToolCallId &&
5659
event.data.success &&
5760
event.data.result?.content.includes("OUTSIDE_MATCH_LINE bypass-approved")
5861
) {

0 commit comments

Comments
 (0)