From 64cc6f45b05b6f5af8e558635cd4e4375a3fa058 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Fri, 12 Sep 2025 13:01:05 +0100 Subject: [PATCH 1/4] fix(registry/modules/goose): default subdomain to false --- registry/coder/modules/goose/README.md | 2 + registry/coder/modules/goose/main.test.ts | 48 ++++++++++++++++------- registry/coder/modules/goose/main.tf | 2 +- 3 files changed, 37 insertions(+), 15 deletions(-) diff --git a/registry/coder/modules/goose/README.md b/registry/coder/modules/goose/README.md index cdc63c3f6..57d7440b6 100644 --- a/registry/coder/modules/goose/README.md +++ b/registry/coder/modules/goose/README.md @@ -123,4 +123,6 @@ Note: The indentation in the heredoc is preserved, so you can write the YAML nat ## Troubleshooting +By default, this module is configured to run the embedded chat interface as a path-based application. In production, we recommend that you configure a [wildcard access URL](https://coder.com/docs/admin/setup#wildcard-access-url) and set `subdomain = true`. + 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. diff --git a/registry/coder/modules/goose/main.test.ts b/registry/coder/modules/goose/main.test.ts index 9dd4dc796..ae5635b00 100644 --- a/registry/coder/modules/goose/main.test.ts +++ b/registry/coder/modules/goose/main.test.ts @@ -2,6 +2,7 @@ import { test, afterEach, describe, + it, setDefaultTimeout, beforeAll, expect, @@ -253,22 +254,41 @@ describe("goose", async () => { expect(prompt.stderr).toContain("No such file or directory"); }); - test("subdomain-false", async () => { - const { id } = await setup({ - agentapiMockScript: await loadTestFile( - import.meta.dir, - "agentapi-mock-print-args.js", - ), - moduleVariables: { - subdomain: "false", - }, + describe("subdomain", async () => { + it("sets AGENTAPI_CHAT_BASE_PATH when false", async () => { + const { id } = await setup({ + agentapiMockScript: await loadTestFile( + import.meta.dir, + "agentapi-mock-print-args.js", + ), + moduleVariables: { + subdomain: "false", + }, + }); + + await execModuleScript(id); + + const agentapiMockOutput = await readFileContainer(id, agentapiStartLog); + expect(agentapiMockOutput).toContain( + "AGENTAPI_CHAT_BASE_PATH=/@default/default.foo/apps/goose/chat", + ); }); - await execModuleScript(id); + it("does not set AGENTAPI_CHAT_BASE_PATH when true", async () => { + const { id } = await setup({ + agentapiMockScript: await loadTestFile( + import.meta.dir, + "agentapi-mock-print-args.js", + ), + moduleVariables: { + subdomain: "true", + }, + }); - const agentapiMockOutput = await readFileContainer(id, agentapiStartLog); - expect(agentapiMockOutput).toContain( - "AGENTAPI_CHAT_BASE_PATH=/@default/default.foo/apps/goose/chat", - ); + await execModuleScript(id); + + const agentapiMockOutput = await readFileContainer(id, agentapiStartLog); + expect(agentapiMockOutput).toMatch(/AGENTAPI_CHAT_BASE_PATH=$/m); + }); }); }); diff --git a/registry/coder/modules/goose/main.tf b/registry/coder/modules/goose/main.tf index 69f93aa37..2e015e765 100644 --- a/registry/coder/modules/goose/main.tf +++ b/registry/coder/modules/goose/main.tf @@ -69,7 +69,7 @@ variable "agentapi_version" { variable "subdomain" { type = bool description = "Whether to use a subdomain for AgentAPI." - default = true + default = false } variable "goose_provider" { From 7a19dab81c2ae3516e167efbea51e6f397a3d89e Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Fri, 12 Sep 2025 13:09:57 +0100 Subject: [PATCH 2/4] add link to recommendations re path-based apps --- registry/coder/modules/goose/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry/coder/modules/goose/README.md b/registry/coder/modules/goose/README.md index 57d7440b6..e226f967f 100644 --- a/registry/coder/modules/goose/README.md +++ b/registry/coder/modules/goose/README.md @@ -123,6 +123,6 @@ Note: The indentation in the heredoc is preserved, so you can write the YAML nat ## Troubleshooting -By default, this module is configured to run the embedded chat interface as a path-based application. In production, we recommend that you configure a [wildcard access URL](https://coder.com/docs/admin/setup#wildcard-access-url) and set `subdomain = true`. +By default, this module is configured to run the embedded chat interface as a path-based application. In production, we recommend that you configure a [wildcard access URL](https://coder.com/docs/admin/setup#wildcard-access-url) and set `subdomain = true`. See [here](https://coder.com/docs/tutorials/best-practices/security-best-practices#disable-path-based-apps) for more details. 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. From 4125c370db10ce14c66cdb913f6dca7eb38c4880 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Fri, 12 Sep 2025 14:09:25 +0100 Subject: [PATCH 3/4] chore: bump goose module version (patch) --- registry/coder/modules/goose/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/registry/coder/modules/goose/README.md b/registry/coder/modules/goose/README.md index e226f967f..2da8ffe67 100644 --- a/registry/coder/modules/goose/README.md +++ b/registry/coder/modules/goose/README.md @@ -13,7 +13,7 @@ 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 = "2.1.1" + version = "2.1.2" agent_id = coder_agent.example.id folder = "/home/coder" install_goose = true @@ -79,7 +79,7 @@ resource "coder_agent" "main" { module "goose" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/goose/coder" - version = "2.1.1" + version = "2.1.2" agent_id = coder_agent.example.id folder = "/home/coder" install_goose = true From 5e5f99035b082641383ae6e407e6db70e07dc5b8 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Fri, 12 Sep 2025 14:11:24 +0100 Subject: [PATCH 4/4] fmt --- registry/coder/modules/goose/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/registry/coder/modules/goose/README.md b/registry/coder/modules/goose/README.md index 2da8ffe67..a1dbfefec 100644 --- a/registry/coder/modules/goose/README.md +++ b/registry/coder/modules/goose/README.md @@ -13,7 +13,7 @@ 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 = "2.1.2" + version = "2.1.2" agent_id = coder_agent.example.id folder = "/home/coder" install_goose = true @@ -79,7 +79,7 @@ resource "coder_agent" "main" { module "goose" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/goose/coder" - version = "2.1.2" + version = "2.1.2" agent_id = coder_agent.example.id folder = "/home/coder" install_goose = true