mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-12 16:15:14 +00:00
Return the OAuth task id from the MCP test route
The client follows an MCP sign-in by its task's events, but the test route kept only success, requires_oauth and auth_url, so the wizard and the custom MCP modal reported a failed sign-in before the popup could load.
This commit is contained in:
1 parent
a9390ec39e
commit
46928cba3d
2 files changed
+5
-1
No files matched your search
@@ -217,7 +217,7 @@ class TestMCPServerConfig(Resource):
|
||||
safe_result = {
|
||||
k: v
|
||||
for k, v in result.items()
|
||||
if k in ("success", "requires_oauth", "auth_url")
|
||||
if k in ("success", "requires_oauth", "auth_url", "task_id")
|
||||
}
|
||||
return make_response(jsonify(safe_result), 200)
|
||||
|
||||
|
||||
@@ -232,6 +232,8 @@ class TestTestMCPServerConfig:
|
||||
"success": False,
|
||||
"requires_oauth": True,
|
||||
"auth_url": "https://auth/ex",
|
||||
"task_id": "task-123",
|
||||
"message": "OAuth required",
|
||||
}
|
||||
|
||||
with patch(
|
||||
@@ -252,6 +254,8 @@ class TestTestMCPServerConfig:
|
||||
response = TestMCPServerConfig().post()
|
||||
assert response.status_code == 200
|
||||
assert response.json["requires_oauth"] is True
|
||||
# The client follows the sign-in by this task's events.
|
||||
assert response.json["task_id"] == "task-123"
|
||||
|
||||
def test_unexpected_exception_returns_500(self, app):
|
||||
from docsgpt.api.user.tools.mcp import TestMCPServerConfig
|
||||
|
||||
Reference in new issue
Block a user