chat-ui
d81e7f26 - fix(settings): defer to router for model tool/multimodal capability on HuggingChat (#2251)

Commit
156 days ago
fix(settings): defer to router for model tool/multimodal capability on HuggingChat (#2251) * fix(settings): don't snapshot model tools/multimodal capability into user overrides The model settings page was calling settings.initValue() for toolsOverrides and multimodalOverrides on first visit, freezing the model's advertised capability into the user's settings. Once written, the entry persisted even after the upstream registry started reporting the capability as supported, leaving users stuck with a stale `false` (e.g. DeepSeek-V4-Pro showing no tool support after providers added supports_tools: true). All read sites already use the `?? model.supportsTools` / `?? model.multimodal` fallback, so removing the init writes lets capability upgrades flow through automatically while still respecting explicit user toggles. * fix(settings): on HuggingChat, defer to router for tool/multimodal capability The model settings page exposes per-model toggles for tool calling and multimodal support, persisted as multimodalOverrides / toolsOverrides on the user's settings. On HuggingChat the upstream router already advertises these capabilities accurately, and once an override was written it would shadow any later capability change in the router (e.g. DeepSeek-V4-Pro now reporting supports_tools: true on most providers but still appearing tool-less because the user's override had been snapshotted earlier). Make HuggingChat read-only with respect to those capabilities: - Switch component: add a disabled prop so toggles can be visually inert. - Settings page: disable both toggles and rephrase the help text on HuggingChat to make the source of truth obvious. - Settings GET (api/v2/user/settings): hide stored overrides on HuggingChat, so existing entries stop applying without us touching the database. - Settings POST (both /settings and api/v2/user/settings): drop incoming override maps on HuggingChat to prevent new spurious entries. - Conversation endpoint: gate forceMultimodal / forceTools on !config.isHuggingChat so any leftover DB entries can't force capabilities on at runtime either. --------- Co-authored-by: Claude <noreply@anthropic.com>
Author
Parents
Loading