You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/ai-coder/tasks.md
+39-2Lines changed: 39 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -41,14 +41,51 @@ Try prompts such as:
41
41
42
42
To import the template and begin configuring it, follow the [documentation in the Coder Registry](https://registry.coder.com#coming-soon)
43
43
44
+
> [!NOTE]
45
+
> The Tasks tab will appear automatically after you add a Tasks-compatible template and refresh the page.
46
+
44
47
### Option 2) Create or Duplicate Your Own Template
45
48
46
-
Because Tasks run unpredictable AI agents, often for background tasks, we recommend creating a separate template for Coder Tasks with limited permissions.
49
+
A template becomes a Task template if it defines a `coder_ai_task` resource and a `coder_parameter` named `"AI Prompt"`. Coder analyzes template files during template version import to determine if these requirements are met.
50
+
51
+
```hcl
52
+
data "coder_parameter" "ai_prompt" {
53
+
name = "AI Prompt"
54
+
type = "string"
55
+
}
56
+
57
+
# Multiple coder_ai_tasks can be defined in a template
58
+
resource "coder_ai_task" "claude-code" {
59
+
# At most one coder ai task can be instantiated during a workspace build.
60
+
# Coder fails the build if it would instantiate more than 1.
# which app to display in the sidebar on the task page
65
+
id = coder_app.claude-code.id
66
+
}
67
+
}
68
+
```
69
+
70
+
> [!NOTE]
71
+
> This definition is not final and may change while Tasks is in beta. After any changes, we guarantee backwards compatibility for one minor Coder version. After that, you may need to update your template to continue using it with Tasks.
47
72
48
-
You can always duplicate your existing template, then apply separate network policies/firewalls/permissions to the template. From there, follow the docs for one of our [built-in modules for agents](https://registry.coder.com/modules?search=tag%3Aagent) in order to add it to your template, configure your LLM provider.
73
+
Because Tasks run unpredictable AI agents, often for background tasks, we recommend creating a separate template for Coder Tasks with limited permissions. You can always duplicate your existing template, then apply separate network policies/firewalls/permissions to the template. From there, follow the docs for one of our [built-in modules for agents](https://registry.coder.com/modules?search=tag%3Aagent) in order to add it to your template, configure your LLM provider.
49
74
50
75
Alternatively, follow our guide for [custom agents](./custom-agents.md)
51
76
77
+
## Customizing the Task UI
78
+
79
+
The Task UI displays all workspace apps declared in a Task template. You can customize the app shown in the sidebar using the `sidebar_app.id` field on the `coder_ai_task` resource.
80
+
81
+
If a workspace app has the special `"preview"` slug, a navbar will appear above it. This is intended for templates that let users preview a web app they’re working on.
82
+
83
+
We plan to introduce more customization options in future releases.
84
+
85
+
## Opting out of Tasks
86
+
87
+
If you tried Tasks and decided you don't want to use it, you can hide the Tasks tab by starting `coder server` with the `CODER_HIDE_AI_TASKS=true` environment variable or the `--hide-ai-tasks` flag.
0 commit comments