fix(session): preserve custom agent after switching (#1017)
Use setSessionAgent (first-write wins) instead of updateSessionAgent in chat.message handler. This prevents the default agent from overwriting a custom agent that was set via UI switch. Fixes #893 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: justsisyphus <justsisyphus@users.noreply.github.com> Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
+1
-1
@@ -314,7 +314,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
|
||||
|
||||
"chat.message": async (input, output) => {
|
||||
if (input.agent) {
|
||||
updateSessionAgent(input.sessionID, input.agent);
|
||||
setSessionAgent(input.sessionID, input.agent);
|
||||
}
|
||||
|
||||
const message = (output as { message: { variant?: string } }).message
|
||||
|
||||
Reference in New Issue
Block a user