Skip to content

Port shouldUseReplacedIdentitySectionInResponse E2E test to dotnet, go, nodejs, python, and rust#1691

Merged
edburns merged 4 commits into
mainfrom
copilot/port-java-test-to-multiple-languages
Jun 16, 2026
Merged

Port shouldUseReplacedIdentitySectionInResponse E2E test to dotnet, go, nodejs, python, and rust#1691
edburns merged 4 commits into
mainfrom
copilot/port-java-test-to-multiple-languages

Conversation

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

The Java-only E2E test validating that a REPLACE override on the identity system message section causes the assistant to adopt a custom persona had no equivalent in any other SDK. This ports that behavior to all five remaining languages using the same snapshot (system_message_sections/should_use_replaced_identity_section_in_response.yaml).

Changes

  • dotnetdotnet/test/E2E/SystemMessageSectionsE2ETests.cs (new): SystemMessageSectionsE2ETests class with Should_Use_Replaced_Identity_Section_In_Response
  • gogo/internal/e2e/system_message_sections_e2e_test.go (new): TestSystemMessageSectionsE2E with subtest should_use_replaced_identity_section_in_response
  • nodejsnodejs/test/e2e/system_message_sections.e2e.test.ts (new): Vitest describe("System message sections") with matching test name
  • pythonpython/e2e/test_system_message_sections_e2e.py (new): TestSystemMessageSections.test_should_use_replaced_identity_section_in_response
  • rustrust/tests/e2e/system_message_sections.rs (new) + wired into rust/tests/e2e.rs

Test behavior (consistent across all languages)

Each test:

  1. Creates a session with systemMessage.mode = customize
  2. Sets the identity section to action: replace, content: "You are a helpful gardening assistant called Botanica…"
  3. Sends "Who are you?"
  4. Asserts the response (lowercased) contains botanica, garden, or plant

Example (Go):

session, _ := client.CreateSession(ctx, &copilot.SessionConfig{
    OnPermissionRequest: copilot.PermissionHandler.ApproveAll,
    SystemMessage: &copilot.SystemMessageConfig{
        Mode: "customize",
        Sections: map[string]copilot.SectionOverride{
            "identity": {
                Action:  copilot.SectionActionReplace,
                Content: "You are a helpful gardening assistant called Botanica...",
            },
        },
    },
})
response, _ := session.SendAndWait(ctx, copilot.MessageOptions{Prompt: "Who are you?"})
// assert response contains "botanica" | "garden" | "plant"

…-Java languages

Co-authored-by: edburns <75821+edburns@users.noreply.github.com>
Copilot AI changed the title [WIP] Port Java-only test to other languages Port shouldUseReplacedIdentitySectionInResponse E2E test to dotnet, go, nodejs, python, and rust Jun 16, 2026
Copilot AI requested a review from edburns June 16, 2026 18:55
@github-actions

This comment has been minimized.

@edburns

edburns commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

@copilot investigate and resolve the failures in the Python SDK tests. Run only the Python SDK tests locally to verify you have fixed the problems.

https://github.com/github/copilot-sdk/actions/runs/27640669484/job/81752408215?pr=1691

…ctions e2e test

Co-authored-by: edburns <75821+edburns@users.noreply.github.com>

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot investigate and resolve the failures in the Python SDK tests. Run only the Python SDK tests locally to verify you have fixed the problems.

https://github.com/github/copilot-sdk/actions/run...

The CI failure was a ruff format --check violation in python/e2e/test_system_message_sections_e2e.py. The file also had three E501 (line too long > 100) lint violations.

Fixed in commit fix(python): fix ruff format and lint violations in system_message_sections e2e test:

  • Applied ruff format to bring the file in line with the project's formatter
  • Shortened the docstring to stay within the 100-char limit
  • Split the long content string literal across two lines
  • Split the long f-string assertion message across two lines

Both ruff format --check and ruff check now pass locally.

@github-actions

This comment has been minimized.

@edburns edburns marked this pull request as ready for review June 16, 2026 21:27
@edburns edburns requested a review from a team as a code owner June 16, 2026 21:27
Copilot AI review requested due to automatic review settings June 16, 2026 21:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 ports the existing Java-only E2E coverage for system message section overrides—specifically identity section action: replace in systemMessage.mode = customize—to the other SDKs (C#/.NET, Go, Node.js, Python, Rust) using the shared snapshot system_message_sections/should_use_replaced_identity_section_in_response.yaml.

Changes:

  • Added a new E2E test in each remaining SDK to validate that replacing the identity section causes the assistant response to reflect the custom persona.
  • Wired the new Rust E2E module into the Rust E2E test suite entrypoint.
Show a summary per file
File Description
rust/tests/e2e/system_message_sections.rs Adds Rust E2E test asserting persona adoption via identity section replace override.
rust/tests/e2e.rs Registers the new Rust E2E module so it runs with the rest of the suite.
python/e2e/test_system_message_sections_e2e.py Adds Python E2E test for system_message.sections.identity replace behavior.
nodejs/test/e2e/system_message_sections.e2e.test.ts Adds Node/Vitest E2E test covering systemMessage.sections.identity replace behavior.
go/internal/e2e/system_message_sections_e2e_test.go Adds Go E2E test verifying identity section replacement influences assistant response.
dotnet/test/E2E/SystemMessageSectionsE2ETests.cs Adds .NET E2E test validating Identity section replace override affects assistant response.

Copilot's findings

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

@github-actions

Copy link
Copy Markdown
Contributor

Cross-SDK Consistency Review ✅

This PR is a well-executed consistency port. All six SDK implementations now share the same E2E test for shouldUseReplacedIdentitySectionInResponse.

Test behavior — consistent across all SDKs

SDK File Snapshot used
Java (original) java/src/test/java/com/github/copilot/SystemMessageSectionsIT.java system_message_sections/should_use_replaced_identity_section_in_response.yaml
.NET (new) dotnet/test/E2E/SystemMessageSectionsE2ETests.cs same
Go (new) go/internal/e2e/system_message_sections_e2e_test.go same
Node.js (new) nodejs/test/e2e/system_message_sections.e2e.test.ts same
Python (new) python/e2e/test_system_message_sections_e2e.py same
Rust (new) rust/tests/e2e/system_message_sections.rs same

Language-idiomatic API usage — all correct

  • Go: uses the typed constant copilot.SectionActionReplace
  • .NET: uses the SectionOverrideAction.Replace enum and SystemMessageSection.Identity typed constant ✅
  • Node.js/Python: use string literal "replace" inline, consistent with their union/TypedDict types ✅
  • Rust: uses string literal "replace", consistent with existing Rust E2E tests (e.g., session.rs) ✅

Other checks

  • Rust module added alphabetically before system_message_transform in e2e.rs
  • Go uses t.Context() — valid since the repo targets Go 1.24 ✅
  • All assertions use the same three-term OR check (botanica || garden || plant) ✅

No inconsistencies found. This PR brings the cross-SDK test coverage into full parity.

Generated by SDK Consistency Review Agent for issue #1691 · sonnet46 2.7M ·

@edburns edburns merged commit 931bc4c into main Jun 16, 2026
39 checks passed
@edburns edburns deleted the copilot/port-java-test-to-multiple-languages branch June 16, 2026 22:08
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