Skip to content

fix(python): dereference $ref/$defs in Google provider - #4297

Merged
Alberto Schiabel (jkomyno) merged 3 commits into
ComposioHQ:nextfrom
CoralGarden52:fix/python-google-deref-ref
Sep 7, 2026
Merged

fix(python): dereference $ref/$defs in Google provider#4297
Alberto Schiabel (jkomyno) merged 3 commits into
ComposioHQ:nextfrom
CoralGarden52:fix/python-google-deref-ref

Conversation

@CoralGarden52

Copy link
Copy Markdown
Contributor

Summary

The Python Vertex AI Google provider rebuilt tool parameter schemas from properties and required without resolving internal $ref/$defs references first. As a result, referenced properties were sent as dangling references and could not be interpreted by Vertex AI.

This change dereferences internal schema references before the existing Google-specific translation. It follows the provider behavior fixed in TypeScript PR #4288.

Changes

  • Dereference Google provider input schemas with the existing dereference_json_schema helper.
  • Use the resolved schema when extracting properties and required fields.
  • Add a regression test covering a property defined through $ref/$defs.

Type of change

  • Bug fix
  • New feature
  • Refactor/Chore
  • Documentation
  • Breaking change

How Has This Been Tested?

  • pytest tests/test_google_provider.py tests/test_json_schema.py tests/test_provider.py -q -k 'not TestLangchainReservedKeywords and not TestLangchainFreeFormObjectArguments' — 59 passed, 4 skipped, 5 deselected.
  • ruff check --config config/ruff.toml providers/google/composio_google/provider.py tests/test_google_provider.py — passed.
  • ruff format --check providers/google/composio_google/provider.py tests/test_google_provider.py — passed.
  • mypy --config-file config/mypy.ini providers/google/composio_google/provider.py tests/test_google_provider.py — passed.

Screenshots (if applicable)

Not applicable.

Checklist

  • I have read the Code of Conduct and this PR adheres to it
  • I ran linters/tests locally and they passed
  • I updated documentation as needed
  • I added tests or explain why not applicable
  • I added a changeset if this change affects published TypeScript packages

Additional context

This is a Python-only provider fix; no TypeScript changeset is required. No existing issue was found for the Python provider, so this PR includes the minimal reproduction and regression test directly.

@vercel

vercel Bot commented Aug 30, 2026

Copy link
Copy Markdown

CoralGarden52 is attempting to deploy a commit to the Composio Team on Vercel.

A member of the Team first needs to authorize it.

Enumerate every Python provider package and require each one to be
classified as either resolving internal $ref/$defs before schema
translation or forwarding the schema whole to a vendor that resolves
references natively. Mirrors the TypeScript contract test.

Claude-Session: https://claude.ai/code/session_01Nk6kGs5SCq8T3eAxcwsyMk

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f07a288. Configure here.

Comment thread python/tests/test_provider_ref_contract.py
json_schema_to_model types a referenced property as Any, so CrewAI
exposed an untyped argument to the model. Inline internal $ref/$defs
before building the args schema, add a regression test, and correct the
cross-provider contract so json_schema_to_model no longer counts as a
reference resolver.

Claude-Session: https://claude.ai/code/session_01Nk6kGs5SCq8T3eAxcwsyMk
@jkomyno

Copy link
Copy Markdown
Collaborator

Thanks!

@jkomyno
Alberto Schiabel (jkomyno) merged commit 85d4923 into ComposioHQ:next Sep 7, 2026
3 of 4 checks passed
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.

2 participants