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:
arc53-machine committed 2026-09-28 23:16:42 +01:00
1 parent a9390ec39e
commit 46928cba3d
2 files changed
+5 -1

No files matched your search

+4
View File
@@ -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