config,server: add defaultProfile to select a profile at startup - #993
config,server: add defaultProfile to select a profile at startup#993sousekd wants to merge 1 commit into
Conversation
Profiles can only be activated at runtime through the UI or the API, so a restart or a configuration reload always lands on "no profile". Deployments that run unattended have no way to express which profile they want. Add an optional top-level defaultProfile naming a key under profiles. It seeds the active profile when the server is built, so it applies on startup and on every configuration reload. The runtime selection is still not persisted, and "None" remains selectable to deactivate. - validate defaultProfile against the configured profiles at load time - seed Server.activeProfile from the config in New() - document the setting in the schema, example config, and configuration docs Omitting the setting or leaving it empty keeps the current behaviour, so existing configurations are unaffected. fix: mostlygeek#992
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
| Filename | Overview |
|---|---|
| internal/config/config.go | Adds the YAML-backed DefaultProfile configuration field. |
| internal/config/load.go | Rejects nonempty default-profile values that do not identify a configured profile. |
| internal/server/server.go | Initializes each newly constructed server with the validated default profile, including servers created during reload. |
| internal/config/profile_test.go | Covers parsing a default profile and rejecting an unknown profile name. |
| internal/server/server_test.go | Verifies that server construction seeds the active profile. |
| config-schema.json | Documents the new optional string setting and its empty default. |
| config.example.yaml | Adds a valid default-profile example and describes reload behavior. |
| docs/configuration.md | Documents default-profile startup and reload semantics. |
Reviews (1): Last reviewed commit: "config,server: add defaultProfile to sel..." | Re-trigger Greptile
|
This would be better as |
Closes #992
Profiles can only be activated at runtime through the UI or the API, so a restart or a configuration reload always lands on "no profile". Deployments that run unattended have no way to express which profile they want.
This adds an optional top-level
defaultProfilenaming a key underprofiles:. It seeds the active profile when the server is built, so it applies on startup and on every configuration reload.Changes:
defaultProfileagainst the configured profiles at load time, as the last step ofvalidateProfilesServer.activeProfilefrom the config inNew(), so the profile is active for the very first request and/v1/modelsreflects its pinsconfig-schema.json,config.example.yaml, anddocs/configuration.mdBehaviour notes:
defaultProfile references unknown profile "..."The diff in
server.gois one added struct field plus gofmt realignment.AI disclosure: implemented by Opus.