mirror of
https://github.com/outbackdingo/optimclaw.git
synced 2026-08-26 15:40:18 +00:00
fix: use selected_model setting key to match /model command persistence
The dispatcher was reading "preferred_model" but the /model command (merged from staging) persists to "selected_model". Since set_setting is already per-user scoped, using the same key makes /model work as the per-user model override in multi-tenant mode. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
This commit is contained in:
@@ -347,10 +347,12 @@ impl<'a> LoopDelegate for ChatDelegate<'a> {
|
||||
|
||||
// Apply per-user model override from settings (first iteration only
|
||||
// to avoid repeated DB lookups within the same agentic loop).
|
||||
// Uses "selected_model" — the same key the /model command persists to
|
||||
// via SettingsStore (per-user scoped).
|
||||
if iteration == 0
|
||||
&& let Some(store) = self.agent.store()
|
||||
&& let Ok(Some(value)) = store
|
||||
.get_setting(&self.message.user_id, "preferred_model")
|
||||
.get_setting(&self.message.user_id, "selected_model")
|
||||
.await
|
||||
&& let Some(model) = value.as_str()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user