Skip to content

Commit 01dbf4d

Browse files
wizzomafizzofwang
authored andcommitted
Add isolate subagent model config settings
1 parent fefb71c commit 01dbf4d

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,12 @@ export function Prompt(props: PromptProps) {
145145
if (msg.agent && isPrimaryAgent) {
146146
local.agent.set(msg.agent)
147147
}
148-
if (msg.model) local.model.set(msg.model)
149-
if (msg.variant) local.model.variant.set(msg.variant)
148+
149+
const isolateModel = sync.data.config.isolate_subagent_model
150+
if (!isolateModel) {
151+
if (msg.model) local.model.set(msg.model)
152+
if (msg.variant) local.model.variant.set(msg.variant)
153+
}
150154
}
151155
})
152156

packages/opencode/src/config/config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,10 @@ export namespace Config {
871871
.boolean()
872872
.optional()
873873
.describe("@deprecated Use 'share' field instead. Share newly created sessions automatically"),
874+
isolate_subagent_model: z
875+
.boolean()
876+
.optional()
877+
.describe("Prevent commands and subagents from persisting their model to the parent session"),
874878
autoupdate: z
875879
.union([z.boolean(), z.literal("notify")])
876880
.optional()

packages/sdk/js/src/v2/gen/types.gen.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,6 +1590,10 @@ export type Config = {
15901590
* @deprecated Use 'share' field instead. Share newly created sessions automatically
15911591
*/
15921592
autoshare?: boolean
1593+
/**
1594+
* Prevent commands and subagents from persisting their model to the parent session
1595+
*/
1596+
isolate_subagent_model?: boolean
15931597
/**
15941598
* Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications
15951599
*/

0 commit comments

Comments
 (0)