Skip to content

Commit 3e0ac42

Browse files
fix: regenerate stale hook snapshots for updated runtime
1 parent 6e3d72c commit 3e0ac42

9 files changed

Lines changed: 20 additions & 159 deletions

dotnet/test/HooksTests.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ await session.SendAsync(new MessageOptions
4646
Assert.Contains(preToolUseInputs, i => !string.IsNullOrEmpty(i.ToolName));
4747
}
4848

49-
// TODO: Re-enable once runtime postToolUse hooks are fixed (https://github.com/github/copilot-sdk/issues/972)
50-
[Fact(Skip = "Runtime postToolUse hooks broken")]
49+
[Fact]
5150
public async Task Should_Invoke_PostToolUse_Hook_After_Model_Runs_A_Tool()
5251
{
5352
var postToolUseInputs = new List<PostToolUseHookInput>();
@@ -84,8 +83,7 @@ await session.SendAsync(new MessageOptions
8483
Assert.Contains(postToolUseInputs, i => i.ToolResult != null);
8584
}
8685

87-
// TODO: Re-enable once runtime postToolUse hooks are fixed (https://github.com/github/copilot-sdk/issues/972)
88-
[Fact(Skip = "Runtime postToolUse hooks broken")]
86+
[Fact]
8987
public async Task Should_Invoke_Both_PreToolUse_And_PostToolUse_Hooks_For_Single_Tool_Call()
9088
{
9189
var preToolUseInputs = new List<PreToolUseHookInput>();

go/internal/e2e/hooks_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ func TestHooks(t *testing.T) {
7474
}
7575
})
7676

77-
// TODO: Re-enable once runtime postToolUse hooks are fixed (https://github.com/github/copilot-sdk/issues/972)
7877
t.Run("should invoke postToolUse hook after model runs a tool", func(t *testing.T) {
79-
t.Skip("Runtime postToolUse hooks broken")
8078
ctx.ConfigureForTest(t)
8179

8280
var postToolUseInputs []copilot.PostToolUseHookInput
@@ -141,9 +139,7 @@ func TestHooks(t *testing.T) {
141139
}
142140
})
143141

144-
// TODO: Re-enable once runtime postToolUse hooks are fixed (https://github.com/github/copilot-sdk/issues/972)
145142
t.Run("should invoke both preToolUse and postToolUse hooks for a single tool call", func(t *testing.T) {
146-
t.Skip("Runtime postToolUse hooks broken")
147143
ctx.ConfigureForTest(t)
148144

149145
var preToolUseInputs []copilot.PreToolUseHookInput

nodejs/test/e2e/hooks.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ describe("Session hooks", async () => {
4848
await session.disconnect();
4949
});
5050

51-
// TODO: Re-enable once runtime postToolUse hooks are fixed (https://github.com/github/copilot-sdk/issues/972)
52-
it.skip("should invoke postToolUse hook after model runs a tool", async () => {
51+
it("should invoke postToolUse hook after model runs a tool", async () => {
5352
const postToolUseInputs: PostToolUseHookInput[] = [];
5453

5554
const session = await client.createSession({
@@ -80,8 +79,7 @@ describe("Session hooks", async () => {
8079
await session.disconnect();
8180
});
8281

83-
// TODO: Re-enable once runtime postToolUse hooks are fixed (https://github.com/github/copilot-sdk/issues/972)
84-
it.skip("should invoke both preToolUse and postToolUse hooks for a single tool call", async () => {
82+
it("should invoke both preToolUse and postToolUse hooks for a single tool call", async () => {
8583
const preToolUseInputs: PreToolUseHookInput[] = [];
8684
const postToolUseInputs: PostToolUseHookInput[] = [];
8785

python/e2e/test_hooks.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ async def on_pre_tool_use(input_data, invocation):
4141

4242
await session.disconnect()
4343

44-
# TODO: Re-enable once runtime postToolUse hooks are fixed (https://github.com/github/copilot-sdk/issues/972)
45-
@pytest.mark.skip(reason="Runtime postToolUse hooks broken")
4644
async def test_should_invoke_posttooluse_hook_after_model_runs_a_tool(
4745
self, ctx: E2ETestContext
4846
):
@@ -73,8 +71,6 @@ async def on_post_tool_use(input_data, invocation):
7371

7472
await session.disconnect()
7573

76-
# TODO: Re-enable once runtime postToolUse hooks are fixed (https://github.com/github/copilot-sdk/issues/972)
77-
@pytest.mark.skip(reason="Runtime postToolUse hooks broken")
7874
async def test_should_invoke_both_pretooluse_and_posttooluse_hooks_for_a_single_tool_call(
7975
self, ctx: E2ETestContext
8076
):

test/snapshots/hooks/invoke_both_hooks_for_single_tool_call.yaml

Lines changed: 0 additions & 47 deletions
This file was deleted.

test/snapshots/hooks/invoke_post_tool_use_hook_after_model_runs_a_tool.yaml

Lines changed: 0 additions & 47 deletions
This file was deleted.

test/snapshots/hooks/should_invoke_both_pretooluse_and_posttooluse_hooks_for_a_single_tool_call.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ conversations:
66
content: ${system}
77
- role: user
88
content: Read the contents of both.txt
9+
- role: assistant
10+
content: I'll read the contents of both.txt for you.
911
- role: assistant
1012
tool_calls:
1113
- id: toolcall_0
@@ -26,6 +28,7 @@ conversations:
2628
- role: user
2729
content: Read the contents of both.txt
2830
- role: assistant
31+
content: I'll read the contents of both.txt for you.
2932
tool_calls:
3033
- id: toolcall_0
3134
type: function
@@ -44,4 +47,8 @@ conversations:
4447
tool_call_id: toolcall_1
4548
content: 1. Testing both hooks!
4649
- role: assistant
47-
content: 'The file contains a single line: "Testing both hooks!"'
50+
content: |-
51+
The file `both.txt` contains a single line:
52+
```
53+
Testing both hooks!
54+
```

test/snapshots/hooks/should_invoke_both_pretooluse_and_posttooluse_hooks_for_single_tool_call.yaml

Lines changed: 0 additions & 47 deletions
This file was deleted.

test/snapshots/hooks/should_invoke_posttooluse_hook_after_model_runs_a_tool.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ conversations:
66
content: ${system}
77
- role: user
88
content: Read the contents of world.txt and tell me what it says
9+
- role: assistant
10+
content: I'll read the contents of world.txt for you.
911
- role: assistant
1012
tool_calls:
1113
- id: toolcall_0
@@ -26,6 +28,7 @@ conversations:
2628
- role: user
2729
content: Read the contents of world.txt and tell me what it says
2830
- role: assistant
31+
content: I'll read the contents of world.txt for you.
2932
tool_calls:
3033
- id: toolcall_0
3134
type: function
@@ -44,4 +47,8 @@ conversations:
4447
tool_call_id: toolcall_1
4548
content: 1. World from the test!
4649
- role: assistant
47-
content: 'The file contains: "World from the test!"'
50+
content: |-
51+
The file **world.txt** contains:
52+
```
53+
World from the test!
54+
```

0 commit comments

Comments
 (0)