Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: conditionally disableaibridge in dogfood template#20686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
dannykopping merged 1 commit intomainfromdk/conditional-bridge-tmpl
Nov 10, 2025
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 28 additions & 6 deletionsdogfood/coder/main.tf
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -217,6 +217,24 @@ data "coder_parameter" "devcontainer_autostart" {
mutable = true
}

data "coder_parameter" "use_ai_bridge" {
type = "bool"
name = "Use AI Bridge"
default = true
description = "If enabled, AI requests will be sent via AI Bridge."
mutable = true
}

# Only used if AI Bridge is disabled.
# dogfood/main.tf injects this value from a GH Actions secret;
# `coderd_template.dogfood` passes the value injected by .github/workflows/dogfood.yaml in `TF_VAR_CODER_DOGFOOD_ANTHROPIC_API_KEY`.
variable "anthropic_api_key" {
type = string
description = "The API key used to authenticate with the Anthropic API, if AI Bridge is disabled."
default = ""
sensitive = true
}

provider "docker" {
host = lookup(local.docker_host, data.coder_parameter.region.value)
}
Expand DownExpand Up@@ -458,11 +476,15 @@ resource "coder_agent" "dev" {
arch = "amd64"
os = "linux"
dir = local.repo_dir
env = {
OIDC_TOKEN : data.coder_workspace_owner.me.oidc_access_token,
ANTHROPIC_BASE_URL : "https://dev.coder.com/api/v2/aibridge/anthropic",
ANTHROPIC_AUTH_TOKEN : data.coder_workspace_owner.me.session_token
}
env = merge(
{
OIDC_TOKEN : data.coder_workspace_owner.me.oidc_access_token,
},
data.coder_parameter.use_ai_bridge.value ? {
ANTHROPIC_BASE_URL : "https://dev.coder.com/api/v2/aibridge/anthropic",
ANTHROPIC_AUTH_TOKEN : data.coder_workspace_owner.me.session_token,
} : {}
)
startup_script_behavior = "blocking"

display_apps {
Expand DownExpand Up@@ -836,7 +858,7 @@ module "claude-code" {
workdir = local.repo_dir
claude_code_version = "latest"
order = 999
claude_api_key = data.coder_workspace_owner.me.session_token# To Enable AI Bridge integration
claude_api_key = data.coder_parameter.use_ai_bridge.value ? data.coder_workspace_owner.me.session_token: var.anthropic_api_key
agentapi_version = "latest"

system_prompt = local.claude_system_prompt
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp