Add Node.js low-level tool-definition E2E test [3/6]#1725
Conversation
There was a problem hiding this comment.
Pull request overview
Adds Node.js E2E coverage for the shared “low-level tool definition” snapshot scenario, and updates the session-lifecycle replay snapshot + Node test prompt to address a replay-matching mismatch.
Changes:
- Add Node.js E2E test
low_level_tool_definitionthat exercises explicit tool definitions + available-tools filtering using the shared replay snapshot. - Update the session-lifecycle E2E prompt from “Say world” → “Say hi” and adjust the stored replay snapshot content accordingly.
- Import and use
ToolSetin Node E2E tools tests to express source-qualified available-tools patterns.
Show a summary per file
| File | Description |
|---|---|
nodejs/test/e2e/tools.e2e.test.ts |
Adds the Node E2E test that replays tools/low_level_tool_definition.yaml and validates tool execution + handler side effects. |
nodejs/test/e2e/session_lifecycle.e2e.test.ts |
Changes the second session activity prompt to “Say hi” to match the updated shared replay snapshot. |
test/snapshots/session_lifecycle/should_list_created_sessions_after_sending_a_message.yaml |
Updates the recorded replay conversation for the session-lifecycle scenario (prompt + assistant response). |
Copilot's findings
- Files reviewed: 3/3 changed files
- Comments generated: 2
| - role: user | ||
| content: Say world | ||
| content: Say hi | ||
| - role: assistant | ||
| content: world | ||
| content: Hi! I'm GitHub Copilot CLI, ready to help with your software engineering tasks. What would you like to work on? |
| // Sessions must have activity to be persisted to disk | ||
| await session1.sendAndWait({ prompt: "Say hello" }); | ||
| await session2.sendAndWait({ prompt: "Say world" }); | ||
| await session2.sendAndWait({ prompt: "Say hi" }); |
- Apply Prettier formatting to tools.e2e.test.ts so Node ubuntu format check passes. - Drop session lifecycle carryover from this PR by restoring Node session lifecycle files to upstream/main content, keeping this PR focused on low-level tool-definition coverage. Related to issue #1682 but does not fix #1682. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Cross-SDK Consistency ReviewSummaryThis PR is part of a planned 6-PR series adding One Consistency Observation: Java vs Node.js Test ScopeThe Java test ( The PR description explicitly notes this choice: "no unexercised
Suggestion for the remaining PRs in this series (Python, Go, .NET, Rust): consider aligning on one approach — either consistently include the Everything Else Looks Good
|
Summary
Adds Node.js low-level tool-definition E2E coverage and includes the session-lifecycle replay mismatch fix needed for stable cross-platform replay matching.
This PR is related to issue #1682 but does not fix #1682.
What changed
low_level_tool_definitiontest coverage in:nodejs/test/e2e/tools.e2e.test.tsnodejs/test/e2e/session_lifecycle.e2e.test.tstest/snapshots/session_lifecycle/should_list_created_sessions_after_sending_a_message.yamltest/snapshots/tools/low_level_tool_definition.yamlgrepoverride in this scenario).Dependency / sequencing
Related