Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ export function Prompt(props: PromptProps) {

syncedSessionID = sessionID

const shouldSync = kv.get("sync_prompt_context_on_session_switch", true)
if (!shouldSync) return

// Only set agent if it's a primary agent (not a subagent)
const isPrimaryAgent = local.agent.list().some((x) => x.name === msg.agent)
if (msg.agent && isPrimaryAgent) {
Expand Down
14 changes: 12 additions & 2 deletions packages/opencode/src/cli/cmd/tui/routes/session/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ export function Session() {
const [diffWrapMode] = kv.signal<"word" | "none">("diff_wrap_mode", "word")
const [_animationsEnabled, _setAnimationsEnabled] = kv.signal("animations_enabled", true)
const [showGenericToolOutput, setShowGenericToolOutput] = kv.signal("generic_tool_output_visibility", false)
const [syncPromptContext, setSyncPromptContext] = kv.signal("sync_prompt_context_on_session_switch", true)

const wide = createMemo(() => dimensions().width > 120)
const sidebarVisible = createMemo(() => {
Expand Down Expand Up @@ -682,6 +683,15 @@ export function Session() {
dialog.clear()
},
},
{
title: syncPromptContext() ? "Keep model/agent when switching sessions" : "Restore model/agent per session",
value: "session.toggle.sync_prompt_context",
category: "Session",
onSelect: (dialog) => {
setSyncPromptContext((prev) => !prev)
dialog.clear()
},
},
{
title: "Page up",
value: "session.page.up",
Expand Down Expand Up @@ -1064,8 +1074,8 @@ export function Session() {
paddingLeft: 1,
visible: showScrollbar(),
trackOptions: {
backgroundColor: theme.backgroundElement,
foregroundColor: theme.border,
backgroundColor: theme.background,
foregroundColor: theme.borderActive,
},
}}
stickyScroll={true}
Expand Down
Empty file added packages/sdk/js/openapi.json
Empty file.
Loading