fix(frontend): persist model selection per thread#1553
fix(frontend): persist model selection per thread#1553LittleChenLiya wants to merge 4 commits intobytedance:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Persists the selected model on a per-thread basis in the frontend so switching between chat threads/agents restores each thread’s own model choice instead of sharing a single global selection.
Changes:
- Add per-thread localStorage keys for
model_nameand load them when athreadIdis provided. - Update
useLocalSettingsto accept an optionalthreadIdand persist per-thread model changes. - Wire thread-aware settings into both the generic chat page and agent chat page.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
frontend/src/core/settings/local.ts |
Introduces per-thread model storage and extends getLocalSettings/saveLocalSettings to optionally scope model selection by thread. |
frontend/src/core/settings/hooks.ts |
Updates useLocalSettings to accept threadId and persist/load settings accordingly. |
frontend/src/app/workspace/chats/[thread_id]/page.tsx |
Uses thread-aware local settings in the main chat page. |
frontend/src/app/workspace/agents/[agent_name]/chats/[thread_id]/page.tsx |
Uses thread-aware local settings in the agent chat page. |
|
I think this would be cleaner as a separate |
|
已按建议拆分,新增了 useThreadSettings 来承载 thread-specific 的 model override,useLocalSettings 现在只保留全局设置语义,这样职责会更清晰一些。 |
Summary
Fixes #1541