Skip to content

Fix hook snapshot for runtime replay#1337

Merged
stephentoub merged 2 commits into
mainfrom
stephentoub/fix-csharp-sdk-tests
May 19, 2026
Merged

Fix hook snapshot for runtime replay#1337
stephentoub merged 2 commits into
mainfrom
stephentoub/fix-csharp-sdk-tests

Conversation

@stephentoub
Copy link
Copy Markdown
Collaborator

The live runtime now preserves the original tool-call arguments in one pre-tool-use history shape while still applying the hook-modified arguments to the tool result. The shared hooks_extended replay fixture only covered the older shape, so the C# SDK test failed when run against copilot-agent-runtime.

This adds the alternate cached conversation to the shared snapshot while keeping the existing one, so C#, Node, Go, Python, and Rust E2E tests can replay both valid histories.

Validation:

  • Focused hook replay checks passed for C#, Node, Go, Python, and Rust.
  • C# SDK net8.0 suite passed against D:\repos\copilot-agent-runtime\dist-cli\index.js: 470 total, 468 passed, 2 skipped.

Add the alternate pre-tool-use replay shape emitted by the live runtime so the shared hooks_extended fixture matches both histories.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@stephentoub stephentoub requested a review from a team as a code owner May 19, 2026 18:02
Copilot AI review requested due to automatic review settings May 19, 2026 18:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an alternate cached conversation to the shared hooks_extended snapshot so E2E hook-replay tests pass against the newer copilot-agent-runtime, which preserves original tool-call arguments in the pre-tool-use history while still applying hook-modified arguments to the tool result.

Changes:

  • Append a second conversation variant to the snapshot YAML preserving original value:"original" in the assistant tool_call while keeping modified by hook in the tool result.
Show a summary per file
File Description
test/snapshots/hooks_extended/should_allow_pretooluse_to_return_modifiedargs_and_suppressoutput.yaml Adds alternate conversation shape to support both old and new runtime history formats during replay.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

Cross-SDK Consistency Review ✅

This PR makes two types of changes:

  1. Go E2E test fixes (10 files in go/internal/e2e/): Adding return statements after t.Fatal()/t.Fatalf() calls. This is a Go-specific idiom — static analysis tools flag unreachable code after t.Fatal(), and the return makes control flow intent explicit. No equivalent changes are needed in other SDK test suites since their testing frameworks (NUnit/xUnit, pytest, Vitest) throw exceptions on assertion failure, naturally stopping execution.

  2. Shared snapshot update (test/snapshots/hooks_extended/should_allow_pretooluse_to_return_modifiedargs_and_suppressoutput.yaml): Adds an alternate cached conversation shape to support both the older and newer runtime hook replay behavior. Per the PR description, this shared fixture already covers C#, Node, Go, Python, and Rust — no language is left behind.

No cross-SDK consistency issues found. The changes are either Go-specific test correctness fixes or shared infrastructure that benefits all languages equally.

Generated by SDK Consistency Review Agent for issue #1337 · ● 105.5K ·

@stephentoub stephentoub merged commit 4dcbfc5 into main May 19, 2026
43 checks passed
@stephentoub stephentoub deleted the stephentoub/fix-csharp-sdk-tests branch May 19, 2026 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants