Skip to content
Merged
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
7 changes: 2 additions & 5 deletions packages/opencode/src/cli/cmd/tui/routes/session/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,17 +241,14 @@ export function Sidebar(props: { sessionID: string }) {
const isError = () => part.state.status === "error"
const input = part.state.input as Record<string, unknown>
const description = (input?.description as string) ?? ""
const stateMetadata = (part.state as { metadata?: Record<string, unknown> }).metadata
const sessionId = (part.metadata?.sessionId ?? stateMetadata?.sessionId) as
| string
| undefined
const sessionId = part.sessionID
return (
<box
flexDirection="row"
gap={1}
paddingLeft={2}
onMouseDown={() => {
if (sessionId) route.navigate({ type: "session", sessionID: sessionId })
route.navigate({ type: "session", sessionID: sessionId })
Comment on lines 247 to +251

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use subagent metadata sessionId for navigation

Clicking a subagent entry now calls route.navigate with sessionId sourced from part.sessionID, but every task tool part in this list belongs to the current session so that value just reloads the session you are already viewing. The Task tool writes the subagent’s target session into state.metadata.sessionId when it creates or updates the subagent task (packages/opencode/src/tool/task.ts lines 57-62, 79-84, 135-139), so this change makes subagent sessions unreachable from the sidebar.

Useful? React with 👍 / 👎.

}}
>
<text flexShrink={0} fg={isActive() ? theme.success : theme.textMuted}>
Expand Down
Loading