Skip to content

Normalize skill context replay snapshots#1269

Merged
stephentoub merged 1 commit into
mainfrom
stephentoub/runtime-test-failure
May 12, 2026
Merged

Normalize skill context replay snapshots#1269
stephentoub merged 1 commit into
mainfrom
stephentoub/runtime-test-failure

Conversation

@stephentoub
Copy link
Copy Markdown
Collaborator

The live runtime changed the skill prompt context so SKILL.md YAML frontmatter may be omitted before the model call. That made the shared replay snapshot for the skills E2E brittle during the transition, causing cache mismatches even though the behavior under test is unchanged.

This updates the replay proxy to canonicalize skill-context user messages by stripping skill metadata frontmatter before matching or writing snapshots. The shared skills snapshot now stores the normalized no-frontmatter form, and a harness unit test covers the normalization so Node, Python, Go, .NET, and Rust E2Es all use the same compatible replay behavior.

Validation:

  • npm test -- replayingCapiProxy.test.ts from test/harness
  • dotnet test dotnet\test\GitHub.Copilot.SDK.Test.csproj --filter "FullyQualifiedName~SkillsE2ETests.Should_Load_And_Apply_Skill_From_SkillDirectories" --no-restore --no-build with GITHUB_ACTIONS=true

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 12, 2026 20:31
@stephentoub stephentoub requested a review from a team as a code owner May 12, 2026 20:31
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

This PR stabilizes cross-SDK E2E replay snapshots for skills by normalizing <skill-context> user messages so YAML frontmatter from SKILL.md metadata is stripped before snapshot matching/writing. This prevents snapshot cache mismatches during runtime transitions where the metadata block may be present or omitted.

Changes:

  • Normalize skill-context user messages in the replay proxy by removing --- ... --- metadata frontmatter after the “Base directory for this skill:” line.
  • Update the shared skills replay snapshot to store the normalized (no-frontmatter) form.
  • Add a harness unit test to ensure the normalization is applied when recording snapshots.
Show a summary per file
File Description
test/snapshots/skills/should_load_and_apply_skill_from_skilldirectories.yaml Updates the stored conversation to the normalized skill-context form (frontmatter removed).
test/harness/replayingCapiProxy.ts Adds skill-context frontmatter stripping as part of user-message normalization.
test/harness/replayingCapiProxy.test.ts Adds coverage asserting frontmatter is removed from recorded skill-context user messages.

Copilot's findings

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

@stephentoub stephentoub merged commit 4a3f210 into main May 12, 2026
33 checks passed
@stephentoub stephentoub deleted the stephentoub/runtime-test-failure branch May 12, 2026 20:49
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.

2 participants