Fix sessionID navigation by using guaranteed ToolPart.sessionID field#98
Fix sessionID navigation by using guaranteed ToolPart.sessionID field#98shuv1337 merged 2 commits intosidebar-fixfrom
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
Co-authored-by: kcrommett <523952+kcrommett@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| flexDirection="row" | ||
| gap={1} | ||
| paddingLeft={2} | ||
| onMouseDown={() => { | ||
| if (sessionId) route.navigate({ type: "session", sessionID: sessionId }) | ||
| route.navigate({ type: "session", sessionID: sessionId }) |
There was a problem hiding this comment.
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 👍 / 👎.
The sidebar's subagent navigation was broken due to checking non-existent metadata fields instead of using the guaranteed
sessionIDfield fromToolPart.Changes
part.metadata?.sessionId ?? stateMetadata?.sessionIdwith directpart.sessionIDaccessstring | undefinedtype cast (field is guaranteed by Zod schema)sessionIDis always presentThe
ToolParttype inheritssessionID: stringfrom its base schema, making it always available.💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.