v0.x: chat defaults in the manifest, and the fallback chain is the module's¶
Spec 0196 phase 1. Runtime behaviour changes for a tool that sets the affected keys; nothing changes for one that does not.
What changed¶
ai.model,ai.base_url,ai.api_version,ai.projectandai.locationare runtime keys.chat.SettingsFromPropsfills the matchingchat.Configfields from them when the caller left them empty. Before, onlyai.providerandai.request_timeoutwere read, andai.modelwas a key the generator alone used. A tool whose config already setai.modelfor the generator now also pins its own chat model to that value.- The fallback chain is built by go/chat's
NewWithFallbackSettings. GTB'sfallbackProviderConfigs,perProviderConfigandwarnFallbackPrimaryOverrideare gone. The primary keeps the model and addressing configured for it (GTB's copy cleared them); every other member resolves its own, and GTB hands each its credential throughWithProviderCredentials. - A credential root for Azure OpenAI (
azure.api.*, fallbackAZURE_OPENAI_API_KEY) and Gemini Vertex (sharinggemini.api.*).chat.NeedsCredential(p)replaces call-siteIsLocalCLIchecks that meant "carries no GTB credential", and now also coversbedrock. - The manifest records
chat.default(provider, model, base_url, api_version, project, location) andgtb generate projectgains--chat-default-provider,--chat-default-model,--chat-base-url,--chat-api-version,--chat-project,--chat-location. Several linked providers require a named default; one is its own. - A generated tool ships the default as
cmd/<name>/chat/assets/config.yaml(embedded defaults) andcmd/<name>/chat/assets/init/config.yaml(init template), registered bychat.go. Both are rewritten byregenerate.
What to do¶
- A project that links several providers: on the next
regenerate projectthe run warnsnames no default. Addchat.default.providerto the manifest and regenerate; until then the tool ships without an author default. - A project that links one provider: nothing. Regenerate derives the default and writes the bundle.
- A hand-wired tool that called the removed helpers: call
chat.NewWithFallbackFromProps, or the module'sNewWithFallbackSettingsdirectly.