Skip to content

feat: update the goose module to support Tasks #178

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

Merged
merged 2 commits into from
Jul 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"devDependencies": {
"@types/bun": "^1.2.18",
"bun-types": "^1.2.18",
"dedent": "^1.6.0",
"gray-matter": "^4.0.3",
"marked": "^16.0.0",
"prettier": "^3.6.2",
Expand Down
89 changes: 26 additions & 63 deletions registry/coder/modules/goose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Run Goose in your workspace
icon: ../../../../.icons/goose.svg
maintainer_github: coder
verified: true
tags: [agent, goose, ai]
tags: [agent, goose, ai, tasks]
---

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

```tf
module "goose" {
source = "registry.coder.com/coder/goose/coder"
version = "1.3.0"
agent_id = coder_agent.example.id
folder = "/home/coder"
install_goose = true
goose_version = "v1.0.16"
source = "registry.coder.com/coder/goose/coder"
version = "2.0.0"
agent_id = coder_agent.example.id
folder = "/home/coder"
install_goose = true
goose_version = "v1.0.31"
goose_provider = "anthropic"
goose_model = "claude-3-5-sonnet-latest"
agentapi_version = "latest"
}
```

## Prerequisites

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

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

## Examples

Your workspace must have `screen` or `tmux` installed to use the background session functionality.

### Run in the background and report tasks (Experimental)

> This functionality is in early access as of Coder v2.21 and is still evolving.
> For now, we recommend testing it in a demo or staging environment,
> rather than deploying to production
>
> Learn more in [the Coder documentation](https://coder.com/docs/tutorials/ai-agents)
>
> Join our [Discord channel](https://discord.gg/coder) or
> [contact us](https://coder.com/contact) to get help or share feedback.
### Run in the background and report tasks

```tf
module "coder-login" {
Expand Down Expand Up @@ -81,37 +72,23 @@ resource "coder_agent" "main" {
EOT
GOOSE_TASK_PROMPT = data.coder_parameter.ai_prompt.value

# An API key is required for experiment_auto_configure
# See https://block.github.io/goose/docs/getting-started/providers
ANTHROPIC_API_KEY = var.anthropic_api_key # or use a coder_parameter
}
}

module "goose" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/goose/coder"
version = "1.3.0"
agent_id = coder_agent.example.id
folder = "/home/coder"
install_goose = true
goose_version = "v1.0.16"

# Enable experimental features
experiment_report_tasks = true

# Run Goose in the background with screen (pick one: screen or tmux)
experiment_use_screen = true
# experiment_use_tmux = true # Alternative: use tmux instead of screen

# Optional: customize the session name (defaults to "goose")
# session_name = "goose-session"

# Avoid configuring Goose manually
experiment_auto_configure = true

# Required for experiment_auto_configure
experiment_goose_provider = "anthropic"
experiment_goose_model = "claude-3-5-sonnet-latest"
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/goose/coder"
version = "2.0.0"
agent_id = coder_agent.example.id
folder = "/home/coder"
install_goose = true
goose_version = "v1.0.31"
agentapi_version = "latest"

goose_provider = "anthropic"
goose_model = "claude-3-5-sonnet-latest"
}
```

Expand All @@ -123,11 +100,11 @@ You can extend Goose's capabilities by adding custom extensions. For example, to
module "goose" {
# ... other configuration ...

experiment_pre_install_script = <<-EOT
pre_install_script = <<-EOT
npm i -g @wonderwhy-er/desktop-commander@latest
EOT

experiment_additional_extensions = <<-EOT
additional_extensions = <<-EOT
desktop-commander:
args: []
cmd: desktop-commander
Expand All @@ -145,20 +122,6 @@ This will add the desktop-commander extension to Goose, allowing it to run comma

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

## Run standalone
## Troubleshooting

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.

```tf
module "goose" {
source = "registry.coder.com/coder/goose/coder"
version = "1.3.0"
agent_id = coder_agent.example.id
folder = "/home/coder"
install_goose = true
goose_version = "v1.0.16"

# Icon is not available in Coder v2.20 and below, so we'll use a custom icon URL
icon = "https://raw.githubusercontent.com/block/goose/refs/heads/main/ui/desktop/src/images/icon.svg"
}
```
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.
Loading