The open source coding agent.
TypeScript
ignore: fix bug from variants pr, prevent createEffect issue
Aiden Clinec82ab649e230
diff --git a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsxindex 6eec5d1d622..70eba3ef8c4 100644--- a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx+++ b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx@@ -191,23 +191,20 @@ export function Prompt(props: PromptProps) {interrupt: 0,})+ // Initialize agent/model/variant from last user message when session changes+ let syncedSessionID: string | undefinedcreateEffect(() => {+ const sessionID = props.sessionIDconst msg = lastUserMessage()- if (!msg) return- // Set agent from last message- if (msg.agent) {- local.agent.set(msg.agent)- }+ if (sessionID !== syncedSessionID) {+ if (!sessionID || !msg) return- // Set model from last message- if (msg.model) {- local.model.set(msg.model)- }+ syncedSessionID = sessionID- // Set variant from last message- if (msg.variant) {- local.model.variant.set(msg.variant)+ if (msg.agent) local.agent.set(msg.agent)+ if (msg.model) local.model.set(msg.model)+ if (msg.variant) local.model.variant.set(msg.variant)}})