-
Notifications
You must be signed in to change notification settings - Fork 80
feat: add disable_autoupdater variable to control auto-updates #545
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new enable_auto_update variable to control whether Claude Code automatically updates itself. By default, auto-updates are now disabled, addressing the confusing behavior where Claude Code would update itself even when users specified a specific version to install.
- Added
enable_auto_updateboolean variable (default: false) to control auto-update behavior - Implemented conditional
DISABLE_AUTOUPDATERenvironment variable based on the new setting - Updated all README examples to reference version 4.2.0
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| registry/coder/modules/claude-code/main.tf | Added enable_auto_update variable and conditional coder_env resource to set DISABLE_AUTOUPDATER when auto-updates are disabled |
| registry/coder/modules/claude-code/README.md | Updated version references from 4.1.0 to 4.2.0 across all usage examples |
Comments suppressed due to low confidence (1)
registry/coder/modules/claude-code/README.md:99
- The new
enable_auto_updatevariable is not documented in the README. Consider adding an example that demonstrates how to use this variable, especially since the PR description mentions that this resolves a confusing issue where claude-code updates itself even when a specific version is pinned. An example showing how to pin a version and disable auto-updates would be helpful:
module "claude-code" {
source = "registry.coder.com/coder/claude-code/coder"
version = "4.2.0"
agent_id = coder_agent.example.id
workdir = "/home/coder/project"
claude_code_version = "1.0.82"
enable_auto_update = false # Ensures Claude Code stays on version 1.0.82
} version = "4.2.0"
agent_id = coder_agent.example.id
workdir = "/home/coder/project"
claude_api_key = "xxxx-xxxxx-xxxx"
# OR
claude_code_oauth_token = "xxxxx-xxxx-xxxx"
claude_code_version = "1.0.82" # Pin to a specific version
agentapi_version = "v0.10.0"
ai_prompt = data.coder_parameter.ai_prompt.value
model = "sonnet"
permission_mode = "plan"
mcp = <<-EOF
{
"mcpServers": {
"my-custom-tool": {
"command": "my-tool-server"
"args": ["--port", "8080"]
}
}
}
EOF
}
|
I think we should keep the default behavior and allow disabling as opt in for the ones who need it. |
…se which mimics the native behaviour of claude-code
|
I have updated this and you are right it feels much better this way |
Description
Claude-Code auto-updates itself unless the
DISABLE_AUTOUPDATERenv is set. This PR adds adisable_autoupdatervariable which allows the user to disable claude-code's auto updating feature. This should resolve the issue where claude-code updates itself when a user defines a specific claude-code version to be installed which was confusing for the end user.Type of Change
Module Information
Path:
registry/coder/modules/claude-codeNew version:
v4.2.0Breaking change: [ ] Yes [X] No
Testing & Validation
bun test)bun fmt)Related Issues