Skip to content

feat(extensibility): add extensibility module#102

Merged
tiagoek merged 4 commits into
SAP:mainfrom
steffensa:feature/extensibility
May 11, 2026
Merged

feat(extensibility): add extensibility module#102
tiagoek merged 4 commits into
SAP:mainfrom
steffensa:feature/extensibility

Conversation

@steffensa
Copy link
Copy Markdown
Contributor

Description

Add the extensibility module to the SAP Cloud SDK for Python. This module enables SAP AI agents to be extended at runtime with third-party tools (delivered via MCP servers) and custom instructions. It communicates with UMS via GraphQL to retrieve the active extension's contribution, and provides helpers to declare extensible capabilities in the agent's A2A card for discovery.

Key capabilities:

  • ExtensibilityClient with get_extension_capability_implementation() and call_hook() operations
  • Backend transport with pagination, caching, and mTLS authentication via BTP Destination Service
  • Local file transport for development and testing without backend connectivity
  • A2A (Agent-to-Agent) protocol integration for tool execution via JSON-RPC
  • ORD (Open Resource Discovery) integration for capability declaration and runtime dependency injection
  • Telemetry extensions for tracking extension context, tool/hook call metrics, and summary spans

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

How to Test

  1. Unit tests — run all extensibility and telemetry extension tests:

    uv run pytest tests/extensibility/ tests/core/unit/telemetry/test_extensions.py -m "not integration" -q
  2. Local mode — set CLOUD_SDK_LOCAL_EXTENSIBILITY_FILE to a JSON file path (see local_extensibility_example.json for the schema) and verify the client loads extensions from disk:

    from sap_cloud_sdk.extensibility import create_client
    
    client = create_client("sap.ai:agent:myAgent:v1")
    ext = client.get_extension_capability_implementation(tenant="test-tenant")
    assert ext.mcp_servers is not None
  3. Full test suite — confirm no regressions across the entire SDK:

    uv run pytest tests/ -m "not integration" -q

Checklist

  • My code follows the project's Code Guidelines
  • I have added type hints for all public APIs
  • I have added unit tests covering the new functionality
  • I have added or updated the user guide (user-guide.md) in the module directory
  • All existing tests pass locally
  • My commits follow Conventional Commits format
  • No confidential or SAP-internal information is included

Additional Notes

  • The a2a-sdk package is an optional dependency — install with pip install sap-cloud-sdk[extensibility]. The module raises a clear ImportError at import time if the extra is missing.
  • The module includes a no-op transport fallback: if the client cannot connect to the backend (e.g., missing credentials in local dev), it logs the error and returns empty results so the agent can always start.
  • Telemetry extensions (extensions.py) are re-exported from sap_cloud_sdk.core.telemetry for convenient access and provide extension context propagation via OpenTelemetry baggage.

telemetry and ORD support

Co-authored-by: Max Heidinger <max.heidinger@sap.com>
Co-authored-by: Udit Marolia <udit.marolia@sap.com>
Co-authored-by: Gregor Hollmig <gregor.hollmig@sap.com>
Co-authored-by: Sophia Abiezzi <sophia.abiezzi@sap.com>
Co-authored-by: Rishi Kunnath <rishi.kunnath@sap.com>
Co-authored-by: Lucas Vianna <lucas.vianna@sap.com>
Co-authored-by: Gabriel Silva <gabriel.silva02@sap.com>
Co-authored-by: Arup Sengupta <arup.sengupta@sap.com>
@steffensa steffensa requested a review from a team as a code owner May 11, 2026 14:38
@cla-assistant
Copy link
Copy Markdown

cla-assistant Bot commented May 11, 2026

CLA assistant check
All committers have signed the CLA.

@tiagoek tiagoek merged commit 6aa929d into SAP:main May 11, 2026
11 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