Skip to content

chore: add compile-time interface assertions for tool implementations#750

Open
merkulovlad wants to merge 1 commit intogoogle:mainfrom
merkulovlad:refactor/tools-compilet-time-check
Open

chore: add compile-time interface assertions for tool implementations#750
merkulovlad wants to merge 1 commit intogoogle:mainfrom
merkulovlad:refactor/tools-compilet-time-check

Conversation

@merkulovlad
Copy link
Copy Markdown

Description of Change

Problem:
Currently, explicit compile-time checks exist only for the MCP tool via RequestProcessor and FunctionTool. Other tool
types rely on runtime validation in base_flow, which makes interface conformance checks less explicit.

Solution:
Add compile-time var _ interface assertions to all tool implementations that implement toolinternal.RequestProcessor
and/or toolinternal.FunctionTool, consistent with the existing pattern in mcpTool.

Testing Plan

No tests needed.
This PR only adds explicit compile-time interface checks and does not change runtime behavior.

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have manually tested my changes end-to-end.
  • Any dependent changes have been merged and published in downstream modules.

@google-cla
Copy link
Copy Markdown

google-cla Bot commented Apr 22, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds compile-time interface satisfaction checks for various tool implementations, ensuring they adhere to the toolinternal.FunctionTool and toolinternal.RequestProcessor interfaces. I have no feedback to provide.

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.

1 participant