DocsGPT icon indicating copy to clipboard operation
DocsGPT copied to clipboard

Kubernetes worker overrides the public API_URL used by MCP OAuth callback fallback

Open darshan-shanthveer-patil opened this issue 1 month ago • 1 comments

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:

  1. Set API_URL=https://docs.example.com in the shared Secret as the Kubernetes guide instructs.
  2. Merge the worker container's explicit env entries over those Secret values.
  3. The effective worker API_URL becomes http://docsgpt-api-service.
  4. With no explicit MCP_OAUTH_REDIRECT_URI, no configured redirect URI, and no CONNECTOR_REDIRECT_BASE_URI, call the actual MCPTool._resolve_redirect_uri fallback.

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_URL entry to WORKER_API_URL in deployment/k8s/deployments/docsgpt-deploy.yaml.
  • Update the publishing instructions in docs/content/Deploying/Kubernetes-Deploying.mdx to 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.0 image supports WORKER_API_URL before changing the manifest. For any UI changes, follow frontend/DESIGN.md and include a screenshot or short recording.

Automated triage. A maintainer will follow up.

arc53-machine avatar Oct 12 '26 01:10 arc53-machine