Document shared configuration and repair defaults

This commit is contained in:
2026-11-21 14:48:19 +00:00
parent 56795bb49a
commit 08d3d0ea3b
15 changed files with 259 additions and 166 deletions

View File

@@ -165,7 +165,8 @@ type engineOptions struct {
}
// WithBundledOpenRouter enables or disables the built-in OpenRouter underlay.
// It is enabled by default; when repeated, the last option wins.
// It is enabled by default for NewEngine; when repeated, the last option wins.
// It has no effect on an already resolved NewFromConfig handoff.
func WithBundledOpenRouter(enabled bool) Option {
return optionFunc(func(options *engineOptions) error {
options.disableBundledOpenRouter = !enabled
@@ -263,13 +264,20 @@ type Configuration interface {
// RuntimeConfig selects runtime-only client and retry settings for NewFromConfig.
// Its fields have the same semantics as the corresponding Config fields.
type RuntimeConfig struct {
Timeout time.Duration
HTTPClient *http.Client
// Timeout is the built-in client's transport timeout fallback.
Timeout time.Duration
// HTTPClient is cloned for the built-in client and ignored by injected clients.
HTTPClient *http.Client
// TransientRetries selects additional built-in attempts; nil defaults to two.
TransientRetries *int
}
// NewFromConfig captures resources from an application-owned completed load.
// The application must register PromptKit rules during that load. Callers must
// The application must register PromptKit rules during that load, using Configure
// or equivalent explicit composition. Missing or nil selected settings contribute
// no resources; Settings and *Settings are accepted, while other nonnil types,
// nil results, and unavailable inspection views fail with ErrInvalidConfig.
// Callers must
// not mutate its selected settings between loading and this handoff. After
// construction, later settings mutations do not alter the engine. This method
// does not load sources, rerun callbacks, or select bundled underlays.