Skip to content

Add ai:proxyurl to Wave AI mode config and wire proxy support through Gemini/OpenAI Chat#2961

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/add-proxyurl-to-aimodeconfigtype
Draft

Add ai:proxyurl to Wave AI mode config and wire proxy support through Gemini/OpenAI Chat#2961
Copilot wants to merge 3 commits intomainfrom
copilot/add-proxyurl-to-aimodeconfigtype

Conversation

Copy link
Contributor

Copilot AI commented Feb 28, 2026

Wave AI mode config (waveai entries) did not expose a per-mode proxy URL, so AIOptsType.ProxyURL was never populated from mode settings. As a result, proxy routing worked in some backends only when set elsewhere, and uctypes.AIModeConfig remained as an obsolete, confusing duplicate type.

  • Config model + schema

    • Added ProxyURL string \json:"ai:proxyurl,omitempty"`towconfig.AIModeConfigType`.
    • Regenerated schema/waveai.json so ai:proxyurl is accepted in Wave AI mode config.
  • Runtime option plumbing

    • Updated getWaveAISettings to propagate mode-level ProxyURL into uctypes.AIOptsType.ProxyURL.
  • Backend proxy handling parity

    • Added proxy-aware HTTP client construction in:
      • pkg/aiusechat/gemini/gemini-backend.go
      • pkg/aiusechat/openaichat/openaichat-backend.go
    • Behavior now matches existing OpenAI/Anthropic handling: parse proxy URL, fail fast on invalid URLs, and set http.Transport.Proxy.
  • Type cleanup

    • Removed unused uctypes.AIModeConfig and its helper method to eliminate stale/duplicate AI mode config definitions.
  • Focused coverage

    • Added minimal tests for proxy client creation in Gemini/OpenAI Chat backends.
    • Added mode-default test ensuring ProxyURL survives provider-default resolution.

Example Wave AI mode config:

{
  "waveai": {
    "my-openai-mode": {
      "display:name": "OpenAI via Proxy",
      "ai:provider": "openai",
      "ai:model": "gpt-5-mini",
      "ai:proxyurl": "http://localhost:8080"
    }
  }
}

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 28, 2026

Deploying waveterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1019c2a
Status: ✅  Deploy successful!
Preview URL: https://912998a2.waveterm.pages.dev
Branch Preview URL: https://copilot-add-proxyurl-to-aimo.waveterm.pages.dev

View logs

Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
Copilot AI changed the title [WIP] Add ProxyUrl to AIModeConfigType and clean up unused config Add ai:proxyurl to Wave AI mode config and wire proxy support through Gemini/OpenAI Chat Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants