You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The MCP Google device-flow and refresh requests currently let requests.ConnectionError and requests.Timeout escape. As a result, login prints a traceback and status can crash when Google's token endpoint is unreachable.
Route all three Google POST operations through a small helper that converts transport failures to AuthError. Login now reports a concise failure; status returns its existing logged_in: false result with a useful error. The exception text is deliberately omitted so request details and credentials cannot leak into CLI output.
This is separate from #1163/#1165, which address REST calls made by MCP tools, and from #1229, which addresses file-backed token storage on Windows.
Verification
Four new regression tests cover device endpoint connection failure, polling timeout, refresh connection failure in status, and refresh timeout. PYTHONPATH=/tmp/opencre-app-deps:$PWD python -m unittest application.tests.mcp_auth_test application.tests.mcp_auth_network_test -v passed: 17 tests total (dependencies installed only in a temporary path).
uvx black --check on both changed files passed.
python -m compileall -q and git diff --check passed.
The full application test suite remains unrun. No live Google request was made.
LLM Usage Considerations
Codex helped investigate, implement, test, and describe this change. The behavior was checked with the stated tests. Independent review by the human contributor is pending; no claim of human validation is made.
No actionable comments were generated in the recent review.
Summary by CodeRabbit
Bug Fixes
Sign-in and token refresh now handle connection failures more clearly, showing a general message instead of exposing underlying network errors.
Timeouts during device authorization and token refresh are reported distinctly, including the applicable timeout duration.
Walkthrough
Google authentication POST requests now use a shared helper that handles timeouts and other request failures. Tests cover device authorization, device-code polling, and token refresh failures.
Changes
Google authentication request handling
Layer / File(s)
Summary
Request handling and network failure coverage application/mcp/auth.py, application/tests/mcp_auth_network_test.py
Refresh, device authorization, and device-code polling use a shared helper for timed Google POST requests. The helper converts timeouts and other request failures into operation-specific AuthError messages. Tests check login and refresh behavior for connection failures and timeouts.
Google login and token refresh now report network timeouts and connection failures as concise authentication errors instead of raw exceptions. The change is small and localized, with regression tests for the failure paths. No merge-blocking risk was identified.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "Handle Google MCP auth transport failures" matches the main change: the Google device-flow and token-refresh POST calls now convert requests.ConnectionError and requests.Timeout into AuthEr…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description states the problem (ConnectionError and Timeout escaping from Google device-flow and refresh POSTs), the fix (a helper that converts these to AuthError), the affected commands (login a…
Full details: Title check
Explanation
The title "Handle Google MCP auth transport failures" matches the main change: the Google device-flow and token-refresh POST calls now convert requests.ConnectionError and requests.Timeout into AuthError via a helper in application/mcp/auth.py. It is specific and concise, and a teammate scanning history would understand the primary change.
Full details: Description check
Explanation
The description states the problem (ConnectionError and Timeout escaping from Google device-flow and refresh POSTs), the fix (a helper that converts these to AuthError), the affected commands (login and status), and the regression tests run. It is directly related to the changeset, so the check passes.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Reviewing files that changed from the base of the PR and between 6bc7a30 and 2ecc758.
Files selected for processing: 2
application/mcp/auth.py
application/tests/mcp_auth_network_test.py
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.
This branch has not been deployed
No deployments
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
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.
Summary
The MCP Google device-flow and refresh requests currently let
requests.ConnectionErrorandrequests.Timeoutescape. As a result,loginprints a traceback andstatuscan crash when Google's token endpoint is unreachable.Route all three Google POST operations through a small helper that converts transport failures to
AuthError. Login now reports a concise failure; status returns its existinglogged_in: falseresult with a useful error. The exception text is deliberately omitted so request details and credentials cannot leak into CLI output.This is separate from #1163/#1165, which address REST calls made by MCP tools, and from #1229, which addresses file-backed token storage on Windows.
Verification
PYTHONPATH=/tmp/opencre-app-deps:$PWD python -m unittest application.tests.mcp_auth_test application.tests.mcp_auth_network_test -vpassed: 17 tests total (dependencies installed only in a temporary path).uvx black --checkon both changed files passed.python -m compileall -qandgit diff --checkpassed.LLM Usage Considerations
Codex helped investigate, implement, test, and describe this change. The behavior was checked with the stated tests. Independent review by the human contributor is pending; no claim of human validation is made.