Use API base URL for AI configuration endpoint#41
Merged
miguelsanchez-upsun merged 2 commits intomainfrom Apr 10, 2026
Merged
Conversation
The /ai/generate-configuration endpoint is now served by the general Upsun API (api.upsun.com) instead of a separate AI service host (ai.upsun.com). Remove the separate ai_url config field and AIServiceURL references, using the existing API base URL instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR simplifies AI configuration endpoint handling by removing the dedicated AI base URL configuration and routing /ai/generate-configuration through the existing API base URL.
Changes:
- Removed the
ai_urlconfig field and theUPSUN_CLI_API_AI_URLenvironment variable override. - Renamed init options from
AIServiceURLtoAPIURLand wired it tocnf.API.BaseURL. - Updated validation/error messaging to reflect the API URL requirement.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
internal/init/command.go |
Switches AI configuration endpoint base from AIServiceURL to APIURL when building the request URL. |
commands/init.go |
Removes env override logic for AI URL and passes cnf.API.BaseURL into init options. |
internal/config/upsun-cli.yaml |
Drops the api.ai_url default entry. |
internal/config/schema.go |
Removes the AIServiceURL field from the config schema. |
Comments suppressed due to low confidence (1)
internal/init/command.go:96
- Building the AI endpoint URL by assigning
u.Path = "/ai/generate-configuration"discards any existing path component inopts.APIURL(e.g., if a user sets the base URL tohttps://example.com/apifor a proxy/dev environment). Consider preserving the existing base path by resolving a relative reference (or joining paths) instead of overwritingu.Path.
u, err := url.Parse(opts.APIURL)
if err != nil {
return err
}
u.Path = "/ai/generate-configuration"
urlStr := u.String()
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
miguelsanchez-upsun
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ai_urlconfig field (ai.upsun.com) and use the existing API base URL (api.upsun.com) for the/ai/generate-configurationendpointUPSUN_CLI_API_AI_URLenvironment variable overrideAIServiceURLtoAPIURLin init optionsGenerated with Claude Code