summaryrefslogtreecommitdiff
path: root/internal/appconfig
diff options
context:
space:
mode:
authorPaul Buetow <pbuetow@mimecast.com>2026-01-30 12:16:31 +0200
committerPaul Buetow <pbuetow@mimecast.com>2026-01-30 12:16:31 +0200
commit3f1ab18cbc996c9467dae6d8deb2c26798aff30e (patch)
treec1a6cdaad61a37bbdd70ddbe161c05aaf13d09ab /internal/appconfig
parentd3e0edbe16459f07506f70611b639d0a0a7f054e (diff)
feat: add completion_wait_all config and fix Anthropic system messages
- Add completion_wait_all config option (default true) to wait for all backends before returning results, or return first result immediately - Fix Anthropic API: extract system messages to top-level system field as required by Messages API (was causing 400 errors) - Add anthropic case to server.go clientFor() for model overrides
Diffstat (limited to 'internal/appconfig')
-rw-r--r--internal/appconfig/config.go18
1 files changed, 14 insertions, 4 deletions
diff --git a/internal/appconfig/config.go b/internal/appconfig/config.go
index f41d4d9..78237be 100644
--- a/internal/appconfig/config.go
+++ b/internal/appconfig/config.go
@@ -40,6 +40,10 @@ type App struct {
// Completion throttle in milliseconds. When > 0, caps the minimum spacing
// between LLM requests (both chat and code-completer paths).
CompletionThrottleMs int `json:"completion_throttle_ms" toml:"completion_throttle_ms"`
+ // CompletionWaitAll controls whether to wait for all configured completion
+ // backends before returning results. When true (default), waits for all
+ // backends. When false, returns the first result immediately.
+ CompletionWaitAll *bool `json:"completion_wait_all" toml:"completion_wait_all"`
TriggerCharacters []string `json:"trigger_characters" toml:"trigger_characters"`
Provider string `json:"provider" toml:"provider"`
@@ -259,9 +263,10 @@ type sectionLogging struct {
}
type sectionCompletion struct {
- CompletionDebounceMs int `toml:"completion_debounce_ms"`
- CompletionThrottleMs int `toml:"completion_throttle_ms"`
- ManualInvokeMinPrefix int `toml:"manual_invoke_min_prefix"`
+ CompletionDebounceMs int `toml:"completion_debounce_ms"`
+ CompletionThrottleMs int `toml:"completion_throttle_ms"`
+ ManualInvokeMinPrefix int `toml:"manual_invoke_min_prefix"`
+ CompletionWaitAll *bool `toml:"completion_wait_all"`
}
type sectionTriggers struct {
@@ -425,11 +430,13 @@ func (fc *fileConfig) toApp() App {
}
// completion
- if (fc.Completion != sectionCompletion{}) {
+ if fc.Completion.CompletionDebounceMs != 0 || fc.Completion.CompletionThrottleMs != 0 ||
+ fc.Completion.ManualInvokeMinPrefix != 0 || fc.Completion.CompletionWaitAll != nil {
tmp := App{
CompletionDebounceMs: fc.Completion.CompletionDebounceMs,
CompletionThrottleMs: fc.Completion.CompletionThrottleMs,
ManualInvokeMinPrefix: fc.Completion.ManualInvokeMinPrefix,
+ CompletionWaitAll: fc.Completion.CompletionWaitAll,
}
out.mergeBasics(&tmp)
}
@@ -888,6 +895,9 @@ func (a *App) mergeBasics(other *App) {
if other.CompletionThrottleMs > 0 {
a.CompletionThrottleMs = other.CompletionThrottleMs
}
+ if other.CompletionWaitAll != nil {
+ a.CompletionWaitAll = other.CompletionWaitAll
+ }
if len(other.TriggerCharacters) > 0 {
a.TriggerCharacters = slices.Clone(other.TriggerCharacters)
}