Skip to content

Commit 97559c2

Browse files
committed
Add isolate subagent model config settings
1 parent bded900 commit 97559c2

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
@@ -817,6 +817,10 @@ export namespace Config {
817817
.boolean()
818818
.optional()
819819
.describe("@deprecated Use 'share' field instead. Share newly created sessions automatically"),
820+
isolate_subagent_model: z
821+
.boolean()
822+
.optional()
823+
.describe("Prevent commands and subagents from persisting their model to the parent session"),
820824
autoupdate: z
821825
.union([z.boolean(), z.literal("notify")])
822826
.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)