Skip to content

Commit b742900

Browse files
authored
feat: update the goose module to support Tasks (#178)
Addresses coder/internal#700. In addition to the automated tests in the PR, I manually tested this module in dev.coder.com.
1 parent d7fdc79 commit b742900

File tree

9 files changed

+454
-292
lines changed

9 files changed

+454
-292
lines changed

bun.lockb

383 Bytes
Binary file not shown.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"devDependencies": {
1111
"@types/bun": "^1.2.18",
1212
"bun-types": "^1.2.18",
13+
"dedent": "^1.6.0",
1314
"gray-matter": "^4.0.3",
1415
"marked": "^16.0.0",
1516
"prettier": "^3.6.2",

registry/coder/modules/goose/README.md

Lines changed: 26 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Run Goose in your workspace
44
icon: ../../../../.icons/goose.svg
55
maintainer_github: coder
66
verified: true
7-
tags: [agent, goose, ai]
7+
tags: [agent, goose, ai, tasks]
88
---
99

1010
# Goose
@@ -13,36 +13,27 @@ Run the [Goose](https://block.github.io/goose/) agent in your workspace to gener
1313

1414
```tf
1515
module "goose" {
16-
source = "registry.coder.com/coder/goose/coder"
17-
version = "1.3.0"
18-
agent_id = coder_agent.example.id
19-
folder = "/home/coder"
20-
install_goose = true
21-
goose_version = "v1.0.16"
16+
source = "registry.coder.com/coder/goose/coder"
17+
version = "2.0.0"
18+
agent_id = coder_agent.example.id
19+
folder = "/home/coder"
20+
install_goose = true
21+
goose_version = "v1.0.31"
22+
goose_provider = "anthropic"
23+
goose_model = "claude-3-5-sonnet-latest"
24+
agentapi_version = "latest"
2225
}
2326
```
2427

2528
## Prerequisites
2629

27-
- `screen` or `tmux` must be installed in your workspace to run Goose in the background
2830
- You must add the [Coder Login](https://registry.coder.com/modules/coder-login) module to your template
2931

3032
The `codercom/oss-dogfood:latest` container image can be used for testing on container-based workspaces.
3133

3234
## Examples
3335

34-
Your workspace must have `screen` or `tmux` installed to use the background session functionality.
35-
36-
### Run in the background and report tasks (Experimental)
37-
38-
> This functionality is in early access as of Coder v2.21 and is still evolving.
39-
> For now, we recommend testing it in a demo or staging environment,
40-
> rather than deploying to production
41-
>
42-
> Learn more in [the Coder documentation](https://coder.com/docs/tutorials/ai-agents)
43-
>
44-
> Join our [Discord channel](https://discord.gg/coder) or
45-
> [contact us](https://coder.com/contact) to get help or share feedback.
36+
### Run in the background and report tasks
4637

4738
```tf
4839
module "coder-login" {
@@ -81,37 +72,23 @@ resource "coder_agent" "main" {
8172
EOT
8273
GOOSE_TASK_PROMPT = data.coder_parameter.ai_prompt.value
8374
84-
# An API key is required for experiment_auto_configure
8575
# See https://block.github.io/goose/docs/getting-started/providers
8676
ANTHROPIC_API_KEY = var.anthropic_api_key # or use a coder_parameter
8777
}
8878
}
8979
9080
module "goose" {
91-
count = data.coder_workspace.me.start_count
92-
source = "registry.coder.com/coder/goose/coder"
93-
version = "1.3.0"
94-
agent_id = coder_agent.example.id
95-
folder = "/home/coder"
96-
install_goose = true
97-
goose_version = "v1.0.16"
98-
99-
# Enable experimental features
100-
experiment_report_tasks = true
101-
102-
# Run Goose in the background with screen (pick one: screen or tmux)
103-
experiment_use_screen = true
104-
# experiment_use_tmux = true # Alternative: use tmux instead of screen
105-
106-
# Optional: customize the session name (defaults to "goose")
107-
# session_name = "goose-session"
108-
109-
# Avoid configuring Goose manually
110-
experiment_auto_configure = true
111-
112-
# Required for experiment_auto_configure
113-
experiment_goose_provider = "anthropic"
114-
experiment_goose_model = "claude-3-5-sonnet-latest"
81+
count = data.coder_workspace.me.start_count
82+
source = "registry.coder.com/coder/goose/coder"
83+
version = "2.0.0"
84+
agent_id = coder_agent.example.id
85+
folder = "/home/coder"
86+
install_goose = true
87+
goose_version = "v1.0.31"
88+
agentapi_version = "latest"
89+
90+
goose_provider = "anthropic"
91+
goose_model = "claude-3-5-sonnet-latest"
11592
}
11693
```
11794

@@ -123,11 +100,11 @@ You can extend Goose's capabilities by adding custom extensions. For example, to
123100
module "goose" {
124101
# ... other configuration ...
125102
126-
experiment_pre_install_script = <<-EOT
103+
pre_install_script = <<-EOT
127104
npm i -g @wonderwhy-er/desktop-commander@latest
128105
EOT
129106
130-
experiment_additional_extensions = <<-EOT
107+
additional_extensions = <<-EOT
131108
desktop-commander:
132109
args: []
133110
cmd: desktop-commander
@@ -145,20 +122,6 @@ This will add the desktop-commander extension to Goose, allowing it to run comma
145122

146123
Note: The indentation in the heredoc is preserved, so you can write the YAML naturally.
147124

148-
## Run standalone
125+
## Troubleshooting
149126

150-
Run Goose as a standalone app in your workspace. This will install Goose and run it directly without using screen or tmux, and without any task reporting to the Coder UI.
151-
152-
```tf
153-
module "goose" {
154-
source = "registry.coder.com/coder/goose/coder"
155-
version = "1.3.0"
156-
agent_id = coder_agent.example.id
157-
folder = "/home/coder"
158-
install_goose = true
159-
goose_version = "v1.0.16"
160-
161-
# Icon is not available in Coder v2.20 and below, so we'll use a custom icon URL
162-
icon = "https://raw.githubusercontent.com/block/goose/refs/heads/main/ui/desktop/src/images/icon.svg"
163-
}
164-
```
127+
The module will create log files in the workspace's `~/.goose-module` directory. If you run into any issues, look at them for more information.

0 commit comments

Comments
 (0)