Skip to content

Commit 64cc6f4

Browse files
committed
fix(registry/modules/goose): default subdomain to false
1 parent 2937286 commit 64cc6f4

File tree

3 files changed

+37
-15
lines changed

3 files changed

+37
-15
lines changed

registry/coder/modules/goose/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,6 @@ Note: The indentation in the heredoc is preserved, so you can write the YAML nat
123123

124124
## Troubleshooting
125125

126+
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`.
127+
126128
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.

registry/coder/modules/goose/main.test.ts

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {
22
test,
33
afterEach,
44
describe,
5+
it,
56
setDefaultTimeout,
67
beforeAll,
78
expect,
@@ -253,22 +254,41 @@ describe("goose", async () => {
253254
expect(prompt.stderr).toContain("No such file or directory");
254255
});
255256

256-
test("subdomain-false", async () => {
257-
const { id } = await setup({
258-
agentapiMockScript: await loadTestFile(
259-
import.meta.dir,
260-
"agentapi-mock-print-args.js",
261-
),
262-
moduleVariables: {
263-
subdomain: "false",
264-
},
257+
describe("subdomain", async () => {
258+
it("sets AGENTAPI_CHAT_BASE_PATH when false", async () => {
259+
const { id } = await setup({
260+
agentapiMockScript: await loadTestFile(
261+
import.meta.dir,
262+
"agentapi-mock-print-args.js",
263+
),
264+
moduleVariables: {
265+
subdomain: "false",
266+
},
267+
});
268+
269+
await execModuleScript(id);
270+
271+
const agentapiMockOutput = await readFileContainer(id, agentapiStartLog);
272+
expect(agentapiMockOutput).toContain(
273+
"AGENTAPI_CHAT_BASE_PATH=/@default/default.foo/apps/goose/chat",
274+
);
265275
});
266276

267-
await execModuleScript(id);
277+
it("does not set AGENTAPI_CHAT_BASE_PATH when true", async () => {
278+
const { id } = await setup({
279+
agentapiMockScript: await loadTestFile(
280+
import.meta.dir,
281+
"agentapi-mock-print-args.js",
282+
),
283+
moduleVariables: {
284+
subdomain: "true",
285+
},
286+
});
268287

269-
const agentapiMockOutput = await readFileContainer(id, agentapiStartLog);
270-
expect(agentapiMockOutput).toContain(
271-
"AGENTAPI_CHAT_BASE_PATH=/@default/default.foo/apps/goose/chat",
272-
);
288+
await execModuleScript(id);
289+
290+
const agentapiMockOutput = await readFileContainer(id, agentapiStartLog);
291+
expect(agentapiMockOutput).toMatch(/AGENTAPI_CHAT_BASE_PATH=$/m);
292+
});
273293
});
274294
});

registry/coder/modules/goose/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ variable "agentapi_version" {
6969
variable "subdomain" {
7070
type = bool
7171
description = "Whether to use a subdomain for AgentAPI."
72-
default = true
72+
default = false
7373
}
7474

7575
variable "goose_provider" {

0 commit comments

Comments
 (0)