- Notifications
You must be signed in to change notification settings - Fork1.1k
fix(examples/templates/tasks-docker): support coder/claude-code 4.0.0#20420
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
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
3 commits Select commitHold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
40 changes: 22 additions & 18 deletionsexamples/templates/tasks-docker/main.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,8 @@ | ||
| terraform { | ||
| required_providers { | ||
| coder = { | ||
| source = "coder/coder" | ||
| version = ">= 2.13" | ||
| } | ||
| docker = { | ||
| source = "kreuzwerker/docker" | ||
| @@ -12,22 +13,32 @@ terraform { | ||
| # This template requires a valid Docker socket | ||
| # However, you can reference our Kubernetes/VM | ||
| # example templates and adapt the Claude Code module | ||
| # | ||
| #See: https://registry.coder.com/templates | ||
| provider "docker" {} | ||
| # A `coder_ai_task` resource enables Tasks and associates | ||
| # the task with the coder_app that will act as an AI agent. | ||
| resource "coder_ai_task" "task" { | ||
| count = data.coder_workspace.me.start_count | ||
| app_id = module.claude-code[count.index].task_app_id | ||
| } | ||
johnstcn marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| # You can read the task prompt from the `coder_task` data source. | ||
| data "coder_task" "me" {} | ||
| # The Claude Code module does the automatic task reporting | ||
| # Other agent modules: https://registry.coder.com/modules?search=agent | ||
| # Or use a custom agent: | ||
| module "claude-code" { | ||
| count = data.coder_workspace.me.start_count | ||
| source = "registry.coder.com/coder/claude-code/coder" | ||
| version = "4.0.0" | ||
| agent_id = coder_agent.main.id | ||
| workdir = "/home/coder/projects" | ||
| order = 999 | ||
| claude_api_key = "" | ||
| ai_prompt = data.coder_task.me.prompt | ||
| system_prompt = data.coder_parameter.system_prompt.value | ||
| model = "sonnet" | ||
| permission_mode = "plan" | ||
| @@ -51,13 +62,13 @@ data "coder_workspace_preset" "default" { | ||
| (servers, dev watchers, GUI apps). | ||
| -Built-in tools - use for everything else: | ||
| (file operations, git commands, builds & installs, one-off shell commands) | ||
| Remember this decision rule: | ||
| - Stays running? → desktop-commander | ||
| - Finishes immediately? → built-in tools | ||
| -- Context -- | ||
| There is an existing app and tmux dev server running on port 8000. Be sure to read it's CLAUDE.md (./realworld-django-rest-framework-angular/CLAUDE.md) to learn more about it. | ||
| Since this app is for demo purposes and the user is previewing the homepage and subsequent pages, aim to make the first visual change/prototype very quickly so the user can preview it, then focus on backend or logic which can be a more involved, long-running architecture plan. | ||
| @@ -107,7 +118,7 @@ data "coder_workspace_preset" "default" { | ||
| # Pre-builds is a Coder Premium | ||
| # feature to speed up workspace creation | ||
| # | ||
| # see https://coder.com/docs/admin/templates/extending-templates/prebuilt-workspaces | ||
| # prebuilds { | ||
| # instances = 1 | ||
| @@ -126,13 +137,6 @@ data "coder_parameter" "system_prompt" { | ||
| description = "System prompt for the agent with generalized instructions" | ||
| mutable = false | ||
| } | ||
| data "coder_parameter" "setup_script" { | ||
| name = "setup_script" | ||
| display_name = "Setup Script" | ||
| @@ -373,4 +377,4 @@ resource "docker_container" "workspace" { | ||
| label = "coder.workspace_name" | ||
| value = data.coder_workspace.me.name | ||
| } | ||
| } | ||
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.