Skip to content

Conversation

@timothedelion
Copy link
Collaborator

@timothedelion timothedelion commented Dec 5, 2025

Issue:APPAI-154

https://linear.app/gitguardian/issue/APPAI-154/toolerror-error-calling-tool-create-code-fix-request-failed-to-create

Root Cause

The httpx.AsyncClient() by default has follow_redirects=False. When the GitGuardian API at https://api.staging.gitguardian.tech/v1/code-fix-requests returns a 301 redirect (to add a trailing slash), httpx raises an error instead of following it.

Fix

Added follow_redirects=True to all httpx.AsyncClient() instantiations:

File Line Method
client.py 435 _request() - general request method
client.py 655 _request_list() - list endpoints
oauth.py 693 OAuth token exchange
oauth.py 766 Token info fetch

All 42 tests pass. The MCP server will now properly follow HTTP redirects from the API.

@timothedelion timothedelion self-assigned this Dec 5, 2025
@timothedelion timothedelion merged commit d557952 into main Dec 5, 2025
4 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