-
Notifications
You must be signed in to change notification settings - Fork 43
feat(agentapi): Add support for running under a subdomain #297
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for running the agentapi module under a subdomain by introducing a new agentapi_subdomain
variable. When subdomain is disabled, the module configures a custom chat base path to ensure proper routing.
Key changes:
- Added
agentapi_subdomain
boolean variable with validation to ensure compatibility with agentapi >= v0.3.2 - Updated default agentapi version to v0.3.2 to support the new functionality
- Modified scripts to conditionally set
--chat-base-path
when subdomain is false
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
main.tf | Adds subdomain variable, validation logic, and chat base path configuration |
scripts/main.sh | Exports AGENTAPI_CHAT_BASE_PATH environment variable |
testdata/agentapi-start.sh | Updates agentapi server command to include --chat-base-path when needed |
test-util.ts | Enhances container cleanup with debug mode support |
main.test.ts | Adds comprehensive tests for subdomain functionality and version validation |
Comments suppressed due to low confidence (2)
registry/coder/modules/agentapi/main.test.ts:212
- The test case expects setup() to reject with validation errors, but setup() may not be the function that performs Terraform validation. Consider testing the validation logic more directly or ensuring this test actually triggers the validation failure.
expect(setup({ moduleVariables: moduleVariables as Record<string, string> })).rejects.toThrow(shouldThrow);
registry/coder/modules/agentapi/main.test.ts:214
- The test expects setup() to resolve, but doesn't await the promise. This could lead to unhandled promise rejections or false positive test results. Consider using 'await expect(setup(...)).resolves.toBeDefined()' or properly handling the async expectation.
expect(setup({ moduleVariables: moduleVariables as Record<string, string> })).resolves.toBeDefined();
❌ Version Bump Validation FailedBump Type: Module versions need to be updated but haven't been bumped yet. Required Actions:
Script Output:
|
… AGENTAPI_CHAT_BASE_PATH will land
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the comments I left, the PR looks good to me. 👍 Please address them before merging. I'll release agentapi v0.3.3 shortly.
Updates coder/coder#18779 Builds on #297 ## Description Adds support for specifying `subdomain = false` in the agentapi module. Change added in #297 NOTE: `AGENTAPI_CHAT_BASE_PATH` is exported before running `main.sh` in agentapi, so this environment variable is available to calling modules if `var.subdomain = false`. ## Type of Change - [ ] New module - [ ] Bug fix - [X] Feature/enhancement - [ ] Documentation - [ ] Other ## Testing & Validation - [X] Tests pass (`bun test`) - [X] Code formatted (`bun run fmt`) - [X] Changes tested locally ## Related Issues coder/coder#18779
Updates coder/coder#18779
A separate PR will update dependant modules
goose
andaider
.Description
subdomain
argument toagentapi
moduleagentapi
module to setAGENTAPI_CHAT_BASE_PATH
to an autogenerated path ifvar.subdomain = false
agentapi
version tov0.3.3
to support running without subdomainType of Change
Testing & Validation
bun test
)bun run fmt
)Related Issues
"user" must be an existing uuid or username.
coder#18779