MGMT-21113: Return less on error#44
MGMT-21113: Return less on error#44openshift-merge-bot[bot] merged 2 commits intoopenshift-assisted:masterfrom
Conversation
Before this, it was possible that internal implementation details in error messages would be returned to the LLM when the MCP server encountered an error. This isn't what we want because users shouldn't get messages from the LLM about the application. This continues to log issues, while returning just a minimal response message to the agent on error. https://issues.redhat.com/browse/MGMT-21113
|
@carbonin: This pull request references MGMT-21113 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.20.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
WalkthroughCentralized exception handling for the Assisted Service client is introduced by implementing a Changes
Sequence Diagram(s)sequenceDiagram
participant Test
participant InventoryClient
participant AssistedServiceAPI
participant sanitize_exceptions
Test->>InventoryClient: Call public async method (e.g., get_cluster)
InventoryClient->>sanitize_exceptions: Method wrapped by decorator
sanitize_exceptions->>AssistedServiceAPI: Perform API call
AssistedServiceAPI-->>sanitize_exceptions: Success or Exception
alt ApiException or Exception occurs
sanitize_exceptions-->>Test: Raise AssistedServiceAPIError
else Success
sanitize_exceptions-->>Test: Return result
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15 minutes Possibly related PRs
Suggested labels
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: carbonin The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@carbonin: This pull request references MGMT-21113 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.20.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
| """ | ||
|
|
||
| def decorator(func: Callable[P, Awaitable[T]]) -> Callable[P, Awaitable[T]]: | ||
| @wraps(func) |
There was a problem hiding this comment.
You can do:
operation_name = func.__name__
And get rid of the peration_name: str in line 25
There was a problem hiding this comment.
Nice, thanks. I'll do that
38251e7 to
3621f22
Compare
|
@carbonin: This pull request references MGMT-21113 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.20.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
2c3e194
into
openshift-assisted:master
Before this, it was possible that internal implementation details in error messages would be returned to the LLM when the MCP server encountered an error. This isn't what we want because users shouldn't get messages from the LLM about the application.
This continues to log issues, while returning just a minimal response message to the agent on error.
https://issues.redhat.com/browse/MGMT-21113
Summary by CodeRabbit