Skip to content

fix(sdk): support TypeSafe integration discovery (SAO-18273) - #638

Merged
BipinShetty merged 2 commits into
mainfrom
fix/typesafe-discovery-compat
Oct 14, 2026
Merged

BipinShetty merged 2 commits into
mainfrom
fix/typesafe-discovery-compat

Conversation

@BipinShetty

Copy link
Copy Markdown
Contributor

Story: SAO-18273

Description:

Support TypeSafe in Python SDK integration discovery without treating it as a chat provider.

  • Update the OpenAPI source and regenerate the provider enum to recognize typesafe.
  • Send X-Galileo-Integration-Capabilities: typesafe only on GET /integrations and GET /integrations/available; keep this in the generator template.
  • Hydrate TypeSafe metadata through the existing GenericProvider, including selected and disabled state.
  • Refresh provider metadata from the supported list endpoint and match the exact integration ID, including shared/owned rows for the same provider.
  • Reject TypeSafe LLM-model discovery before making a request.

This SDK change can ship while decision_model_metrics is off. It does not enable the feature. The separate backend compatibility change must deploy before the flag is enabled so already installed older SDKs keep receiving compatible discovery responses. This PR does not implement SDK decision-evaluator creation or change inference, credential selection, retries, sharing permissions, or runner capacity.

Tests:

  • Unit tests added for wire decoding, mixed-provider discovery, exact-ID refresh, disabled/selected metadata, early LLM rejection, and capability headers.
  • Deployed end-to-end test added/run.
  • 62 focused SDK tests passed in an isolated single process with network sockets disabled. Runtime checks were on 9eaa169c; c55a057a only corrects a docstring.
  • Actual pinned API-client regeneration produced exactly three generated file changes: the enum and the two discovery endpoints.
  • Thirty decoder checks passed across SDK 2.3.0, SDK 2.6.0 and the updated SDK using synthetic responses from the companion backend checks, including negative controls for older decoders.
  • Changed handwritten code/tests pass Ruff lint and format; committed diff passes whitespace checks.
  • Scoped mypy reports three errors also present on the unchanged base, with zero introduced errors. Full suites and deployed DB/auth end-to-end testing were not run.

Draft for private Astra review. Normal CI and maintainer review are still required.

@baz-reviewer

baz-reviewer Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Review this PR on Baz

Baz Summary

Enable TypeSafe integration discovery in the Python SDK by updating OpenAPI-generated provider models and discovery endpoints. Extend Integration and Provider metadata hydration and refresh behavior while rejecting unsupported LLM model discovery before requests.

Topics

TopicDetails
TypeSafe Discovery Support TypeSafe discovery alongside chat providers by advertising capabilities only on integration discovery endpoints, decoding mixed provider responses, and hydrating GenericProvider metadata including selection and disabled state.
Modified files (9)
  • codegen_templates/endpoint_module.py.jinja
  • openapi.yaml
  • src/galileo/integration.py
  • src/galileo/resources/api/integrations/list_available_integrations_integrations_available_get.py
  • src/galileo/resources/api/integrations/list_integrations_integrations_get.py
  • src/galileo/resources/models/integration_provider.py
  • src/galileo/utils/headers_data.py
  • tests/test_api_headers.py
  • tests/test_typesafe_discovery.py
Latest Contributors(2)
UserCommitDate
bipin@galileo.aifix(sdk): support Type...October 12, 2026
namratag@cisco.comfeat: add trace, sessi...October 09, 2026
Provider Metadata Flow Refresh provider metadata from the full supported integration list using exact integration IDs, including shared rows, and prevent TypeSafe providers from attempting chat model discovery.
Modified files (3)
  • src/galileo/integration.py
  • src/galileo/provider.py
  • tests/test_typesafe_discovery.py
Latest Contributors(2)
UserCommitDate
bipin@galileo.aidocs(sdk): clarify dis...October 12, 2026
jeisen@cisco.comfeat: Add annotation q...July 13, 2026

Merger  Activate to get a short verdict whether this PR is good to go or not

Skills  Activate Skill Maintainer to keep your skills up to date

Planner  This PR would have been improved with Baz Planner - Try it now

@codecov

codecov Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.86%. Comparing base (7aadc4d) to head (6acfff0).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #638      +/-   ##
==========================================
+ Coverage   83.66%   83.86%   +0.20%     
==========================================
  Files         124      124              
  Lines       11042    11045       +3     
==========================================
+ Hits         9238     9263      +25     
+ Misses       1804     1782      -22     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@BipinShetty
BipinShetty marked this pull request as ready for review October 13, 2026 18:58
integration_db.is_selected if not isinstance(integration_db.is_selected, Unset) else False
)
provider.permissions = integration_db.permissions if not isinstance(integration_db.permissions, Unset) else None
provider._update_from_api_response(integration_db)

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.

Drops TypeSafe integration identity during deletion

Deleting a selected TypeSafe integration can mark it DELETED without removing that row because inherited delete() ignores the hydrated provider ID and calls DELETE /integrations/typesafe; use an ID-scoped delete request instead.

Severity guidelines

Want Baz to fix this for you? Activate Fixer

Other fix methods

Fix in Cursor

Prompt for AI Agents
Before applying, verify this suggestion against the current code. In
`src/galileo/integration.py` around lines 344-346, review `_to_provider` and the
inherited `delete()` path: `_update_from_api_response()` hydrates a TypeSafe row with an
ID, but `GenericProvider` deletion still targets `/integrations/typesafe` and can delete
or mark the wrong same-provider integration. Refactor the deletion logic so it uses the
hydrated integration ID (or an identity-aware endpoint/override) for the selected row,
and only marks that provider `DELETED` after that specific deletion succeeds. Add or
update tests covering multiple integrations with the same provider.

@BipinShetty
BipinShetty enabled auto-merge (squash) October 14, 2026 15:31
@BipinShetty
BipinShetty force-pushed the fix/typesafe-discovery-compat branch from c55a057 to 6acfff0 Compare October 14, 2026 15:36
@BipinShetty
BipinShetty merged commit a33259c into main Oct 14, 2026
19 checks passed
@BipinShetty
BipinShetty deleted the fix/typesafe-discovery-compat branch October 14, 2026 15:53
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