Repository navigation
Conversation
Docs previewCheck off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here. |
| } | ||
| "ANTHROPIC_BASE_URL": "<your-deployment-url>/api/v2/ai-gateway/anthropic" | ||
| }, | ||
| "apiKeyHelper": "token=$(coder login token 2>/dev/null) && [ -n \"$token\" ] && printf \"%s\" \"$token\" || printenv ANTHROPIC_AUTH_TOKEN" |
There was a problem hiding this comment.
This preferentially uses coder login token, meaning that if ANTHROPIC_AUTH_TOKEN is set it won't be used.
Don't we want to first try the env then fall back?
Using the login token is probably not ideal since it may have more permissions than needed (in the future, since we don't downscope the keys at the moment).
There was a problem hiding this comment.
fair call. I opted for coder login token as we can not be sure if ANTHROPIC_BASE_URL is set and points to the correct deployment.
There was a problem hiding this comment.
I will remove coder login token from module configuration but want to keep it for the genetic config as its easier for users to use it if they ave Coder CLI instaleld and logged in locally.
Will move it as the falback as oer the suggestion.
nickvigilante
left a comment
There was a problem hiding this comment.
Documentation Check
Blocking
-
docs/ai-coder/ai-gateway/clients/claude-code.md(open) - The example pins the module to~> 5.5.3(line 82), but that version is not published to the Coder Registry; it only exists in the open coder/registry#1204. Merging this PR first would maketerraform initfail to resolve the module. -
docs/ai-coder/ai-gateway/clients/claude-code.md(open) - The sentence on line 89 says the module configures the helper automatically, but no published module version has that behavior; it lands with coder/registry#1204, which is not merged.
Related open PRs
- coder/registry#1204 (open) publishes module 5.5.3 and adds the
setup_gateway_api_key_helperauto-config that this page documents. Both findings above resolve if this PR merges after coder/registry#1204 is published. - coder/dogfood#739 (open) bumps the dogfood template to module 5.5.3.
Findings for agents
- id: accuracy-1
persona: accuracy
class: wrong
blocking: true
file: docs/ai-coder/ai-gateway/clients/claude-code.md
line: 82
quote: ' version = "~> 5.5.3"'
evidence:
- "gh api repos/coder/registry/tags (pages 1-7): latest claude-code module tag is release/coder/claude-code/v5.5.2; no release/coder/claude-code/v5.5.3 exists"
- "curl registry main install.sh.tftpl: 0 occurrences of setup_gateway_api_key_helper; all README examples still pin 5.5.2"
- "gh pr view 1204 --repo coder/registry: state OPEN, mergedAt null. The 5.5.3 bump and the helper auto-config live only in this unmerged PR."
rule: null
problem: The Terraform example pins the module to `~> 5.5.3`, but the Coder Registry has not published that version. If this PR merges first, a reader who copies the block gets a `terraform init` that cannot resolve the module, because the latest published tag is 5.5.2.
fix: Merge coder/registry#1204 and publish release/coder/claude-code/v5.5.3 before or with this PR. Merging after coder/registry#1204 is published resolves it.
verified: true
- id: accuracy-2
persona: accuracy
class: wrong
blocking: true
file: docs/ai-coder/ai-gateway/clients/claude-code.md
line: 89
quote: 'The module configures the helper in `~/.claude/settings.json` automatically when you set `enable_ai_gateway = true`.'
evidence:
- "curl registry main install.sh.tftpl: 0 occurrences of setup_gateway_api_key_helper, the function that writes apiKeyHelper to ~/.claude/settings.json"
- "gh pr view 1204 --repo coder/registry: state OPEN, not merged; setup_gateway_api_key_helper is added only in this PR"
rule: null
problem: The sentence says the module configures the helper automatically when `enable_ai_gateway = true`, but that behavior does not exist in any published module version. It only exists once coder/registry#1204 merges, which is still open. If this PR merges first, the docs describe behavior a reader cannot get.
fix: Merge coder/registry#1204 and publish the module before or with this PR. Merging after coder/registry#1204 is published resolves it.
verified: trueGenerated by Coder Agents on behalf of @nickvigilante, using the proposed doc-check skill from #31193 on Solstice-1 Local. Reply in a thread if a finding is wrong.
| module "claude-code" { | ||
| source = "registry.coder.com/coder/claude-code/coder" | ||
| version = "~> 5.2" | ||
| version = "~> 5.5.3" |
There was a problem hiding this comment.
Blocking: (Fact Checker) This example pins the module to ~> 5.5.3, but the Coder Registry has not published that version: the latest tag is release/coder/claude-code/v5.5.2, and the 5.5.3 bump only exists in the open, unmerged coder/registry#1204. If this PR merges first, terraform init cannot resolve the module for a reader who copies this block. Fix: merge and publish coder/registry#1204 before or with this PR. Merging after coder/registry#1204 is published resolves it.
| } | ||
| ``` | ||
|
|
||
| The module configures the helper in `~/.claude/settings.json` automatically when you set `enable_ai_gateway = true`. |
There was a problem hiding this comment.
Blocking: (Fact Checker) This sentence says the module configures the helper in ~/.claude/settings.json automatically, but that behavior is not in any published module version: the setup_gateway_api_key_helper function that writes the helper was added only in the open, unmerged coder/registry#1204, and registry main still pins 5.5.2. If this PR merges first, the docs describe a behavior the reader cannot get. Fix: merge and publish coder/registry#1204 before or with this PR. Merging after coder/registry#1204 is published resolves it.
There was a problem hiding this comment.
The PR body already says that this depends on the registry PR. So this comment does not add any value and add noise.
|
Closing this until I come back to it again as part of the easier AI Gateway Configuration through clients. |
Document one Claude Code API key helper for AI Gateway that tries
coder login tokenand falls back toANTHROPIC_AUTH_TOKENwhen the CLI fails or returns an empty token. The helper reads credentials at runtime without copying token values into Claude settings.Update the template example to module
5.5.3, which sets the helper automatically in user settings and preserves existing custom helpers. Depends on coder/registry#1204 and publication of that version. Related template bump: https://github.com/coder/dogfood/pull/739.