Hide exception details in mock integration server responses - #482
Merged
Rodrigo Brandão (rodrigobr-msft) merged 4 commits intoJul 22, 2026
Merged
Conversation
Copilot
AI
changed the title
[WIP] Fix code scanning alert 17
Hide exception details in mock integration server responses
Jul 21, 2026
Rodrigo Brandão (rodrigobr-msft)
approved these changes
Jul 21, 2026
Rodrigo Brandão (rodrigobr-msft)
approved these changes
Jul 21, 2026
Copilot started reviewing on behalf of
Rodrigo Brandão (rodrigobr-msft)
July 21, 2026 20:33
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the dev/microsoft-agents-testing integration-test mock HTTP agent server to avoid reflecting raw exception text back to HTTP clients, addressing a security/code-scanning concern (e.g., CodeQL) while preserving the same error status behavior.
Changes:
- Replace
Response(status=500, text=str(e))with a fixed generic message ("Internal server error") when the mock server handler hits an unexpected exception.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Rodrigo Brandão (rodrigobr-msft)
enabled auto-merge (squash)
July 21, 2026 20:35
Kyle Rohn (kylerohn-msft)
approved these changes
Jul 22, 2026
Kyle Rohn (kylerohn-msft)
approved these changes
Jul 22, 2026
Copilot started reviewing on behalf of
Rodrigo Brandão (rodrigobr-msft)
July 22, 2026 17:41
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
dev/microsoft-agents-testing/tests/core/test_integration.py:143
- The exception is no longer returned to the client (good), but it is now fully swallowed without being logged. That can make integration test failures difficult to diagnose because the only visible error becomes the generic 500 body.
except Exception:
return Response(status=500, text="Internal server error")
Rodrigo Brandão (rodrigobr-msft)
merged commit Jul 22, 2026
37c4e77
into
main
10 of 11 checks passed
Rodrigo Brandão (rodrigobr-msft)
deleted the
copilot/fix-code-scanning-alert-17
branch
July 22, 2026 17:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change addresses a CodeQL finding in the testing infrastructure where the mock HTTP agent server could return raw exception text to clients. The handler now returns a generic 500 response while preserving the existing failure path.
Scope
dev/microsoft-agents-testingintegration tests.Behavior change
Implementation