Skip to content

feat(agentgateway): enhance credential detection logic for service bi…#170

Open
KoblerS wants to merge 11 commits into
SAP:mainfrom
KoblerS:main
Open

feat(agentgateway): enhance credential detection logic for service bi…#170
KoblerS wants to merge 11 commits into
SAP:mainfrom
KoblerS:main

Conversation

@KoblerS

@KoblerS KoblerS commented Jun 17, 2026

Copy link
Copy Markdown
Member

…nding and defaults

Disclaimer: Do not include SAP-internal or customer-specific information in this PR (e.g. internal system URLs, customer names, tenant IDs, or confidential configurations). This is a public repository.

Description

Provide a clear description of your changes here.

Related Issue

Closes #<issue_number>

(Link to the GitHub issue this PR addresses)

Type of Change

Please check the relevant option:

  • 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
  • Code refactoring
  • Dependency update

How to Test

Describe how reviewers can test your changes:

  1. Step 1
  2. Step 2
  3. Expected result

Checklist

Before submitting your PR, please review and check the following:

  • I have read the Contributing Guidelines
  • I have verified that my changes solve the issue
  • I have added/updated automated tests to cover my changes
  • All tests pass locally
  • I have verified that my code follows the Code Guidelines
  • I have updated documentation (if applicable)
  • I have added type hints for all public APIs
  • My code does not contain sensitive information (credentials, tokens, etc.)
  • I have followed Conventional Commits for commit messages

Breaking Changes

If this PR introduces breaking changes, please describe:

  • What breaks
  • Migration path for users
  • Alternative approaches considered

Additional Notes

Add any additional context, screenshots, or information that would help reviewers.

@KoblerS KoblerS requested a review from a team as a code owner June 17, 2026 15:18
@cla-assistant

cla-assistant Bot commented Jun 17, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

KoblerS and others added 6 commits June 18, 2026 11:51
- Introduced a new module `_mcp_session.py` to encapsulate MCP session management logic.
- Added `invoke_mcp_tool` function to handle tool invocation with improved error handling.
- Updated test cases in `test_lob.py` to reflect changes in error messages and patching for MCP session.
- Updated package version to 0.26.1 in `uv.lock`.
…umentation

- Added `_resolve_dependency` function to resolve integration dependencies by ORD ID.
- Updated `get_mcp_tools_customer` and `list_mcp_tools` to support filtering by ORD ID.
- Refactored `call_mcp_tool` to handle tool name resolution with optional ORD ID.
- Enhanced user guide with detailed credential detection and usage examples.
- Added unit tests for new functionality and edge cases related to ORD ID resolution.
Comment thread src/sap_cloud_sdk/agentgateway/_customer.py Outdated
@NicoleMGomes

Copy link
Copy Markdown
Contributor

Please fulfill PR template to facilitate review

@NicoleMGomes

Copy link
Copy Markdown
Contributor

Please resolve conflicts

KoblerS added 4 commits June 30, 2026 15:12
…gent-card changes

- Resolved conflicts in _lob.py, agw_client.py, user-guide.md
- Replaced invoke_mcp_tool with call_mcp_tool_customer/call_mcp_tool_lob
- Added call_mcp_tool_customer to _customer.py (from upstream extensibility PR)
- Preserved resolve_base_mount reuse in detect_customer_agent_credentials
- Remove _SERVICE_BINDING_ROOT_ENV from _customer.py (replaced by resolve_base_mount); update test_customer.py to use string literal
- Apply ruff formatting to _customer.py, _mcp_session.py, agw_client.py
- Bump version 0.31.0 → 0.32.0 (src/ modified)
- Add ord_id=None to get_mcp_tools_customer assertions
- Update IAS fragment error message regexes to match new specific messages
- Redirect call_mcp_tool_lob mock patches from _mcp_session to _lob
logger = logging.getLogger(__name__)


async def invoke_mcp_tool(

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.

How s this different from run_mcp_tool?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

could you point me to run_mcp_tool please, not sure where this comes?

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.

# Filter to a specific ORD ID — tenant ID is derived from credentials automatically
tools = await agw_client.list_mcp_tools(
user_token="user-jwt",
ord_id="sap.s4:apiResource:API_PRODUCT_0002_MCP:v1",

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.

Isn't the ord id declared on asset.yaml? Has this definition changed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yes but the agent still needs to specify what to call in the MCP call case so in which skill context etc

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.

The filter use case is still pending discussion and it was not aligned with us. We should have consistency for LoB and Customer Agents.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Could you please follow up with Felipe on this he is aware of it

@NicoleMGomes

Copy link
Copy Markdown
Contributor

Please fulfill PR template to facilitate review

@KoblerS Can you please provider explanation for these changes? Thank you

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