Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions dotnet/test/HooksTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ await session.SendAsync(new MessageOptions
Assert.Contains(preToolUseInputs, i => !string.IsNullOrEmpty(i.ToolName));
}

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

// TODO: Re-enable once runtime postToolUse hooks are fixed (https://github.com/github/copilot-sdk/issues/972)
[Fact(Skip = "Runtime postToolUse hooks broken")]
[Fact]
public async Task Should_Invoke_Both_PreToolUse_And_PostToolUse_Hooks_For_Single_Tool_Call()
{
var preToolUseInputs = new List<PreToolUseHookInput>();
Expand Down
4 changes: 0 additions & 4 deletions go/internal/e2e/hooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ func TestHooks(t *testing.T) {
}
})

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

var postToolUseInputs []copilot.PostToolUseHookInput
Expand Down Expand Up @@ -141,9 +139,7 @@ func TestHooks(t *testing.T) {
}
})

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

var preToolUseInputs []copilot.PreToolUseHookInput
Expand Down
6 changes: 2 additions & 4 deletions nodejs/test/e2e/hooks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@
await session.disconnect();
});

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

const session = await client.createSession({
Expand All @@ -71,7 +70,7 @@
});

// Should have received at least one postToolUse hook call
expect(postToolUseInputs.length).toBeGreaterThan(0);

Check failure on line 73 in nodejs/test/e2e/hooks.test.ts

View workflow job for this annotation

GitHub Actions / Node.js SDK Tests (ubuntu-latest)

test/e2e/hooks.test.ts > Session hooks > should invoke postToolUse hook after model runs a tool

AssertionError: expected 0 to be greater than 0 ❯ test/e2e/hooks.test.ts:73:42

Check failure on line 73 in nodejs/test/e2e/hooks.test.ts

View workflow job for this annotation

GitHub Actions / Node.js SDK Tests (macos-latest)

test/e2e/hooks.test.ts > Session hooks > should invoke postToolUse hook after model runs a tool

AssertionError: expected 0 to be greater than 0 ❯ test/e2e/hooks.test.ts:73:42

Check failure on line 73 in nodejs/test/e2e/hooks.test.ts

View workflow job for this annotation

GitHub Actions / Node.js SDK Tests (windows-latest)

test/e2e/hooks.test.ts > Session hooks > should invoke postToolUse hook after model runs a tool

AssertionError: expected 0 to be greater than 0 ❯ test/e2e/hooks.test.ts:73:42

// Should have received the tool name and result
expect(postToolUseInputs.some((input) => input.toolName)).toBe(true);
Expand All @@ -80,8 +79,7 @@
await session.disconnect();
});

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

Expand All @@ -107,7 +105,7 @@

// Both hooks should have been called
expect(preToolUseInputs.length).toBeGreaterThan(0);
expect(postToolUseInputs.length).toBeGreaterThan(0);

Check failure on line 108 in nodejs/test/e2e/hooks.test.ts

View workflow job for this annotation

GitHub Actions / Node.js SDK Tests (ubuntu-latest)

test/e2e/hooks.test.ts > Session hooks > should invoke both preToolUse and postToolUse hooks for a single tool call

AssertionError: expected 0 to be greater than 0 ❯ test/e2e/hooks.test.ts:108:42

Check failure on line 108 in nodejs/test/e2e/hooks.test.ts

View workflow job for this annotation

GitHub Actions / Node.js SDK Tests (macos-latest)

test/e2e/hooks.test.ts > Session hooks > should invoke both preToolUse and postToolUse hooks for a single tool call

AssertionError: expected 0 to be greater than 0 ❯ test/e2e/hooks.test.ts:108:42

Check failure on line 108 in nodejs/test/e2e/hooks.test.ts

View workflow job for this annotation

GitHub Actions / Node.js SDK Tests (windows-latest)

test/e2e/hooks.test.ts > Session hooks > should invoke both preToolUse and postToolUse hooks for a single tool call

AssertionError: expected 0 to be greater than 0 ❯ test/e2e/hooks.test.ts:108:42

// The same tool should appear in both
const preToolNames = preToolUseInputs.map((i) => i.toolName);
Expand Down
4 changes: 0 additions & 4 deletions python/e2e/test_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ async def on_pre_tool_use(input_data, invocation):

await session.disconnect()

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

await session.disconnect()

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

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ conversations:
content: ${system}
- role: user
content: Read the contents of both.txt
- role: assistant
content: I'll read the contents of both.txt for you.
- role: assistant
tool_calls:
- id: toolcall_0
Expand All @@ -26,6 +28,7 @@ conversations:
- role: user
content: Read the contents of both.txt
- role: assistant
content: I'll read the contents of both.txt for you.
tool_calls:
- id: toolcall_0
type: function
Expand All @@ -44,4 +47,8 @@ conversations:
tool_call_id: toolcall_1
content: 1. Testing both hooks!
- role: assistant
content: 'The file contains a single line: "Testing both hooks!"'
content: |-
The file `both.txt` contains a single line:
```
Testing both hooks!
```

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ conversations:
content: ${system}
- role: user
content: Read the contents of world.txt and tell me what it says
- role: assistant
content: I'll read the contents of world.txt for you.
- role: assistant
tool_calls:
- id: toolcall_0
Expand All @@ -26,6 +28,7 @@ conversations:
- role: user
content: Read the contents of world.txt and tell me what it says
- role: assistant
content: I'll read the contents of world.txt for you.
tool_calls:
- id: toolcall_0
type: function
Expand All @@ -44,4 +47,8 @@ conversations:
tool_call_id: toolcall_1
content: 1. World from the test!
- role: assistant
content: 'The file contains: "World from the test!"'
content: |-
The file **world.txt** contains:
```
World from the test!
```
Loading