Skip to content

fix: make header names python-safe#592

Open
saurabhkoshatwar wants to merge 25 commits intogoogleapis:mainfrom
saurabhkoshatwar:skoshatwar/issue-fix-580
Open

fix: make header names python-safe#592
saurabhkoshatwar wants to merge 25 commits intogoogleapis:mainfrom
saurabhkoshatwar:skoshatwar/issue-fix-580

Conversation

@saurabhkoshatwar
Copy link
Copy Markdown

@saurabhkoshatwar saurabhkoshatwar commented Mar 14, 2026

Fixes #580

Summary

  • Allow Toolbox tools to use parameter/header names that are not valid Python identifiers (e.g. X-Application-ID).
  • Introduce a Python‑safe field name mapping so function signatures and Pydantic models stay valid while preserving the original parameter names over the wire.

Details

  • Sanitize schema parameter names into Python‑safe field names and use those in inspect.Parameter and Pydantic models.
  • Maintain a mapping from Python‑safe names back to original schema names in ToolboxTool so requests still use the exact header/parameter names defined in tools.yaml.

@anubhav756
Copy link
Copy Markdown
Contributor

/gcbrun

@anubhav756
Copy link
Copy Markdown
Contributor

Thanks for the PR @saurabhkoshatwar !

Could you please take a look at the integration test failure?

I'm also thinking if we could add any more integration/unit tests to verify this change. For instance to see if there could still be any validation failures while actually using hyphenated parameters?

@anubhav756 anubhav756 added priority: p2 Moderately-important priority. Fix may not be included in next release. help wanted labels Mar 16, 2026
@anubhav756 anubhav756 force-pushed the skoshatwar/issue-fix-580 branch 2 times, most recently from 99c3383 to 992c3a5 Compare March 25, 2026 06:26
@anubhav756
Copy link
Copy Markdown
Contributor

/gcbrun

@anubhav756
Copy link
Copy Markdown
Contributor

Thanks for the PR @saurabhkoshatwar !

Could you please take a look at the integration test failure?

I'm also thinking if we could add any more integration/unit tests to verify this change. For instance to see if there could still be any validation failures while actually using hyphenated parameters?

@saurabhkoshatwar Bumping this up in case it got missed :)

@anubhav756 anubhav756 force-pushed the skoshatwar/issue-fix-580 branch from 992c3a5 to de80c29 Compare March 27, 2026 21:37
@anubhav756
Copy link
Copy Markdown
Contributor

/gcbrun

@saurabhkoshatwar
Copy link
Copy Markdown
Author

@anubhav756 could you please rerun the tests? Thanks!

@anubhav756 anubhav756 force-pushed the skoshatwar/issue-fix-580 branch from a5305cd to d092006 Compare March 31, 2026 09:56
@anubhav756
Copy link
Copy Markdown
Contributor

/gcbrun

anubhav756 and others added 11 commits April 1, 2026 08:10
…Declaration` mapping (googleapis#594)

* fix(adk): Handle complex types in tool schemas

* chore: delint
…-adk` (googleapis#579)

* feat(adk): Support ToolContext for aut_token_getters in toolbox-adk

* chore: Add clarifying comment

* fix: fix lint and tests

* chore: refactor tool strict validation logic

* chore: delint

* chore: delint

* chore: fix tests and type check

* fix: fix CI/CD pipeline for toolbox-adk for local toolbox-core
)

* fix: Update core dependency package version

* feat(telemetry): add MCP semantic telemetry to toolbox-core client

- Instrument toolbox-core Client per MCP semantic conventions
- Enable telemetry across adk, langchain, and llamaindex modules
- Update test coverage and telemetry-related dependencies

* tests(telemetry): added coverage and documentation for telemetry

* fix(tests): lint errors

* fix(telemetry): client naming + type fixes

* feat(telemetry): add warnings

---------

Co-authored-by: Anubhav Dhawan <anubhavdhawan@google.com>
…oogleapis#602)

* chore(adk): remove id_token monkey patch following upstream ADK fix

### Description
Removes the `id_token` monkey-patching in `toolbox_adk/tool.py` since the upstream fix in ADK has been successfully merged ([google/adk-python#4402](google/adk-python#4402)).

With the ADK natively retaining the `id_token`, the workaround is no longer necessary.

* fix(adk): bump ADK version

* fix(adk): upgrade google-auth dep version
…o v0.30.0 to v0.30.0 (googleapis#598)

Co-authored-by: dishaprakash <57954147+dishaprakash@users.noreply.github.com>
Settings are controlled through UI
* fix: improve func_docstring

* file format
* docs: cleanup README

* adk readme cleanup v1

* adk readme cleanup v2

* core readme cleanup v1

* core readme cleanup v2

* langchain readme cleanup v1

* langchain readme cleanup v2

* langchain readme cleanup v3

* llamaindex readme cleanup v1

* Apply suggestions from code review

Co-authored-by: Anubhav Dhawan <anubhavdhawan@google.com>

* suggested changes from review

* Update README.md

Co-authored-by: Anubhav Dhawan <anubhavdhawan@google.com>

* added open telemetry link

* Update README.md

Co-authored-by: Anubhav Dhawan <anubhavdhawan@google.com>

* fix identation

* minor fix

* minor fix v2

* Update README.md

Co-authored-by: Anubhav Dhawan <anubhavdhawan@google.com>

---------

Co-authored-by: Anubhav Dhawan <anubhavdhawan@google.com>
release-please bot and others added 12 commits April 1, 2026 08:10
* chore(main): release toolbox-core 1.0.0

* Update CHANGELOG.md

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Anubhav Dhawan <anubhavdhawan@google.com>
* chore(main): release toolbox-adk 1.0.0

* dep: Update toolbox-core dep version

* Update CHANGELOG.md

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Anubhav Dhawan <anubhavdhawan@google.com>
* chore(main): release toolbox-langchain 1.0.0

* Update CHANGELOG.md

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Anubhav Dhawan <anubhavdhawan@google.com>
* chore(main): release toolbox-llamaindex 1.0.0

* Update CHANGELOG.md

* Update CHANGELOG.md

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Anubhav Dhawan <anubhavdhawan@google.com>
…leapis#615)

Bumps [langchain-core](https://github.com/langchain-ai/langchain) from 1.2.11 to 1.2.22.
- [Release notes](https://github.com/langchain-ai/langchain/releases)
- [Commits](langchain-ai/langchain@langchain-core==1.2.11...langchain-core==1.2.22)

---
updated-dependencies:
- dependency-name: langchain-core
  dependency-version: 1.2.22
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Twisha Bansal <58483338+twishabansal@users.noreply.github.com>
@saurabhkoshatwar saurabhkoshatwar force-pushed the skoshatwar/issue-fix-580 branch from 3ab9bb9 to 8aa416d Compare April 1, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p2 Moderately-important priority. Fix may not be included in next release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP Toolbox HTTP Source - Header Parameter don't allow headers with hyphen.

7 participants