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.
Phase 2, same release¶
- No vendor default.
chat.SettingsFromPropsreturnschat.ErrProviderUnset(with a hint namingai.providerandinit ai) when no provider is set in the caller'sConfig, in config, or inAI_PROVIDER. It used to default to Claude;docs.ResolveProviderused to default to OpenAI and now returns empty. A tool that relied on the silent Claude default setsai.providerin its embedded defaults (the generator'schat.defaultdoes this) or its users runinit ai.gtbitself seedsai.provider: claudefrom its init template. init aioffers every provider the framework knows, fromchat.ProviderDisplays(), and skips the credential forms for a provider that carries none. Its per-provider key switches are gone in favour ofchat.CredentialKeysFor.IsAIConfiguredaccepts any known provider and counts an env-var or keychain reference as configured, not only a literal.- The wizard has an AI page with the default-provider select and model,
plus endpoint and cloud-addressing pages shown only for the providers that
need them. The
--providerhelp ondocsand ongtb generatelists every provider.
Phase 3, same release: only what is linked¶
- go/chat v0.24.0 for
ProviderRegistered,RegisteredProvidersandErrProviderNotRegistered. The adapter's "add this import" hint matches the sentinel witherrors.Isinstead of the message text. - A tool that links exactly one provider needs no
ai.provider: the registry rung fills it. With several linked and nothing set, theErrProviderUnsethint lists them. init aioffers only the providers the binary registers and refuses one it does not, naming the module. A binary registering none is offered the whole table.doctor: new Chat providers check (ai.providerand every fallback member registered, else the module to import); API keys removed. The credential resolution check reports a chat credential only when one of the providers it serves is linked.credentialposture.ReportEnabled(added in the same release) is replaced byReportWhere(ctx, cfg, func(Descriptor) bool), andDescriptorgainsProviders.
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.