Skip to content

Add Python low-level tool-definition E2E test [4/6]#1726

Merged
edburns merged 1 commit into
mainfrom
edburns/1682-04-python-new-test
Jun 18, 2026
Merged

Add Python low-level tool-definition E2E test [4/6]#1726
edburns merged 1 commit into
mainfrom
edburns/1682-04-python-new-test

Conversation

@edburns

@edburns edburns commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds Python low-level tool-definition E2E coverage in python/e2e/test_tools_e2e.py as part of the PR-1692 breakout.

This PR is related to issue #1682 but does not fix #1682.

What changed

  • Adds test_low_level_tool_definition coverage in Python E2E tests.
  • Reuses the shared snapshot introduced by PR Add Java low-level tool definition E2E test and skill [1/6] #1721:
    • test/snapshots/tools/low_level_tool_definition.yaml
  • Keeps low-level tool registration scoped to tools exercised by that snapshot (set_current_phase, search_items).
  • Validates decoded keyword argument handling in the tool invocation path.

Dependency / sequencing

Related

Related to issue #1682 but does not fix #1682.

Align low_level_tool_definition coverage with PR #1721 snapshot behavior by only defining tools exercised by the shared snapshot.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 18, 2026 19:57
@edburns edburns requested a review from a team as a code owner June 18, 2026 19:57

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

Adds Python E2E coverage for the “low-level tool definition” scenario by introducing a new test in the Python E2E suite that reuses the shared replay-proxy snapshot under test/snapshots/tools/low_level_tool_definition.yaml.

Changes:

  • Adds test_low_level_tool_definition to exercise explicit tool registration with two custom tools (set_current_phase, search_items).
  • Configures a per-session tool allowlist via ToolSet().add_custom("*").add_builtin("web_fetch") to mirror the shared scenario setup.
  • Asserts tool argument decoding/availability (keyword) and validates observable side effects (current_phase) after tool execution.
Show a summary per file
File Description
python/e2e/test_tools_e2e.py Adds a new E2E test that registers two tools and validates tool invocation + results using the shared tools/low_level_tool_definition snapshot.

Copilot's findings

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

@github-actions

Copy link
Copy Markdown
Contributor

Cross-SDK Consistency Review ✅

This PR is part of a well-coordinated 6-part breakout series (#1721#1728) adding low_level_tool_definition E2E coverage across all six SDKs. Cross-SDK consistency is maintained by the series as a whole:

PR SDK Status
#1721 Java + shared snapshot merged
#1724 Go [2/6] open
#1725 Node.js [3/6] open
#1726 Python [4/6] this PR
#1727 Rust [5/6] open
#1728 .NET [6/6] open

Python implementation analysis

API naming follows Python conventions correctly, parallel to other SDKs:

  • ToolSet().add_custom("*").add_builtin("web_fetch") matches Java's new ToolSet().addCustom("*").addBuiltIn("web_fetch")
  • PermissionHandler.approve_all matches Java's PermissionHandler.APPROVE_ALL
  • invocation.arguments matches Java's invocation.getArguments()

Tool scope intentionally limited to set_current_phase + search_items — the two tools actually exercised by the shared snapshot. This matches the stated design of PRs #1724, #1725, #1727, and #1728.

Minor observation (pre-existing, not introduced here)

The Java test (LowLevelToolDefinitionIT.java, merged in the series' first PR) includes an extra grepOverrideTool definition that the shared snapshot never exercises. The subsequent SDKs (#1724#1728, including this one) deliberately omit it. This creates a minor divergence between Java and the rest, but is intentional and acknowledged in this PR's description. The Python test's more focused approach is actually the pattern adopted for the remainder of the series.

No action required on this PR. The change is self-consistent and correctly aligned with the cross-SDK rollout plan.

Generated by SDK Consistency Review Agent for issue #1726 · sonnet46 1.2M ·

@edburns edburns merged commit 07fcf35 into main Jun 18, 2026
19 checks passed
@edburns edburns deleted the edburns/1682-04-python-new-test branch June 18, 2026 20:38
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.

Java: Ergonomics: Defining tools

2 participants