Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: add yaml config option to standalone AI gateway - #28258

Merged
pawbana merged 1 commit into
mainfrom
pawel/aigov-563-coder-ai-gateway-start-has-no-c-config-flag-so-yaml-config
Aug 19, 2026
Merged

feat: add yaml config option to standalone AI gateway#28258
pawbana merged 1 commit into
mainfrom
pawel/aigov-563-coder-ai-gateway-start-has-no-c-config-flag-so-yaml-config

Conversation

@pawbana

@pawbana pawbana commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

This PR was generated with Coder Agents.

Summary

coder ai-gateway start now accepts a --config / -c flag (and CODER_CONFIG_PATH) to load configuration from a YAML file, matching coder server.

Details

  • Inherit the existing Config Path option (--config / CODER_CONFIG_PATH) into the standalone AI Gateway command, so YAML config is loaded and applied by serpent.
  • Emit the same experimental-YAML warning coder server uses when a config file is set.
  • Update TestAIGatewayStart_InheritedOptions to include the Config group.
  • Add TestAIGatewayStart_ConfigYAML, an end-to-end test that enables the Prometheus listener via YAML and verifies it comes up.
  • Extract a shared startUnreachableCoderd test helper.

@linear-code

linear-code Bot commented Aug 18, 2026

Copy link
Copy Markdown

AIGOV-563

@ssncferreira ssncferreira left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a few suggestions

defer stop()

if vals.Config != "" {
cliui.Warnf(inv.Stderr, "YAML support is experimental and offers no compatibility guarantees.")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this under an experimental flag? 🤔 or is it just to say that "we reserve the right to change the YAML schema without keeping backward compatibility"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is copied from coder server:

coder/cli/server.go

Lines 424 to 426 in 1fbd029

if vals.Config != "" {
cliui.Warnf(inv.Stderr, "YAML support is experimental and offers no compatibility guarantees.")
}

My understanding is that YAML configuration was added some time ago but never "matured" out of experimental status when it was added.

// Fake coderd that answers 503 so the daemon keeps retrying to connect.
coderURL := startUnreachableCoderd(t)
configFile := filepath.Join(t.TempDir(), "config.yaml")
err := os.WriteFile(configFile, []byte(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should we add a test where the config contains an invalid schema? I assume the CLI will fail in that case, saying it is an unknown field or something like that

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added.

@pawbana
pawbana force-pushed the pawel/aigov-563-coder-ai-gateway-start-has-no-c-config-flag-so-yaml-config branch from 6170905 to f36230c Compare August 19, 2026 09:30
@pawbana
pawbana enabled auto-merge (squash) August 19, 2026 09:31
@pawbana
pawbana disabled auto-merge August 19, 2026 09:31
@pawbana
pawbana enabled auto-merge (squash) August 19, 2026 09:32
@pawbana
pawbana force-pushed the pawel/aigov-563-coder-ai-gateway-start-has-no-c-config-flag-so-yaml-config branch from f36230c to c4ed2fb Compare August 19, 2026 09:56
@pawbana
pawbana merged commit a441b03 into main Aug 19, 2026
31 checks passed
@pawbana
pawbana deleted the pawel/aigov-563-coder-ai-gateway-start-has-no-c-config-flag-so-yaml-config branch August 19, 2026 10:07
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants