Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions registry/coder/modules/goose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`. 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.
48 changes: 34 additions & 14 deletions registry/coder/modules/goose/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
test,
afterEach,
describe,
it,
setDefaultTimeout,
beforeAll,
expect,
Expand Down Expand Up @@ -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);
});
});
});
2 changes: 1 addition & 1 deletion registry/coder/modules/goose/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
Loading