Kubernetes worker overrides the public API_URL used by MCP OAuth callback fallback
Description
The Kubernetes worker Deployment overrides API_URL with http://docsgpt-api-service, even when the shared Secret sets a public API_URL. That keeps internal calls inside the cluster, but it also changes the worker's fallback MCP OAuth callback address.
There is already a separate WORKER_API_URL setting: docsgpt/worker.py::_worker_api_url uses it for index handoff and falls back to API_URL. The manifests could use it for the internal Service address and leave the public address intact.
Reproduction
This is a configuration-level reproduction on current main, not a live Kubernetes/OAuth test:
- Set
API_URL=https://docs.example.comin the shared Secret as the Kubernetes guide instructs. - Merge the worker container's explicit
enventries over those Secret values. - The effective worker
API_URLbecomeshttp://docsgpt-api-service. - With no explicit
MCP_OAUTH_REDIRECT_URI, no configured redirect URI, and noCONNECTOR_REDIRECT_BASE_URI, call the actualMCPTool._resolve_redirect_urifallback.
I parsed the checked-in Deployment and executed that method extracted from the checked-in Python AST with synthetic settings. It returns:
Public URL from Secret: https://docs.example.com
Worker effective API_URL: http://docsgpt-api-service
Actual fallback redirect: http://docsgpt-api-service/api/mcp_server/callback
A browser outside the cluster cannot normally resolve that Service hostname. Explicit redirect settings avoid this fallback, so this report does not claim every connector fails.
Expected behavior
The worker retains the public API_URL used for browser-facing links. Its internal index handoff uses WORKER_API_URL=http://docsgpt-api-service.
Proposed change
- Rename the worker's explicit
API_URLentry toWORKER_API_URLindeployment/k8s/deployments/docsgpt-deploy.yaml. - Update the publishing instructions in
docs/content/Deploying/Kubernetes-Deploying.mdxto describe the two addresses. - Verify public callback generation and internal index handoff with distinct addresses.
- Check compatibility with the image release pinned in the manifests before submitting a PR.
Environment
Linux; repository inspection and isolated resolver reproduction. No live cluster, OAuth provider or browser sign-in was used.
Duplicate check
I searched issues and PRs for Kubernetes OAuth callbacks and WORKER_API_URL and did not find this manifest mismatch.
Contribution
I would like to work on the manifest and documentation fix. Could you confirm the scope and assign the issue before I start?
@darshan-shanthveer-patil, you're assigned.
- Open a PR or post progress within 14 days; otherwise the issue goes back to other contributors.
- Read
CONTRIBUTING.md. Keep the fix focused on the worker manifest and deployment docs, with regression checks for distinct public callback and internal index-handoff addresses. - Verify that the pinned
arc53/docsgpt:1.0.0image supportsWORKER_API_URLbefore changing the manifest. For any UI changes, followfrontend/DESIGN.mdand include a screenshot or short recording.
Automated triage. A maintainer will follow up.