Files
coder/coderd/x/chatd
Steven Masley d2f9ad783e feat(coderd/x/chatd): overlay user-set custom_headers at runtime
Threads the per-user custom_headers values stored on
mcp_server_user_header_values through the chatd MCP client so users
who provided a value for an admin-marked CustomHeadersUserKey see it
mixed into the outgoing request alongside the admin-static headers.

Changes:

- mcpclient.ConnectAll grows a fourth indexed input,
  []database.McpServerUserHeaderValue, which buildAuthHeaders
  consults inside the custom_headers branch to overlay per-user
  values on top of admin static headers, scoped to
  cfg.CustomHeadersUserKeys.
- chatd loads the user's stored header values via
  GetMCPServerUserHeaderValuesByUserID alongside the existing
  GetMCPServerUserTokensByUserID call and threads them into
  ConnectAll. A missing row is non-fatal: admin headers still
  ship, user-keyed headers are simply absent and a warning is
  logged.
- mcpclient.go inlines its own DefaultTransport clone for test
  isolation, replacing the standalone helper in mcphttpclient.go,
  which is removed.

Stack: 4/6 (chatd runtime overlay)
2026-06-01 15:02:34 +00:00
..