[PR #12898] fix: use absolute paths for sidebar session navigation #14427

Closed
opened 2026-02-16 18:19:13 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/12898

State: closed
Merged: Yes


Problem

Sidebar session links use relative paths (${slug}/session/${id}) instead of absolute paths (/${slug}/session/${id}). When the SolidJS router resolves these relative paths from certain route contexts (e.g., the root /), it constructs invalid double-slash paths like //session/ses_xxx, causing:

Uncaught (in promise) Error: Path '//session/ses_3bce84db7ffe2FH9YBwWwq0ERS' is not a routable path

This prevents the first message from being sent in newly created sessions.

Root Cause

In sidebar-items.tsx, both SessionItem (line 147) and NewSessionItem (line 288) construct hrefs without a leading /:

// SessionItem
href={`${props.slug}/session/${props.session.id}`}

// NewSessionItem  
href={`${props.slug}/session`}

Every other navigation call in the codebase already uses the correct absolute path pattern:

File Pattern
layout.tsx:358 `/${base64Encode(directory)}/session/${props.sessionID}`
layout.tsx:1105 `/${base64Encode(session.directory)}/session/${session.id}`
notification.tsx:120 `/${base64Encode(directory)}/session/${sessionID}`
submit.ts:200 `/${base64Encode(sessionDirectory)}/session/${session.id}`
dialog-fork.tsx:73 `/${base64Encode(sdk.directory)}/session/${forked.data.id}`

Fix

Add the missing leading / to both href constructions in sidebar-items.tsx.

Verification

  • TypeScript: all 12 workspace packages pass
  • Tests: 902 pass, 1 skip, 1 pre-existing timeout failure (unrelated installs dependencies test)

Fixes #12840

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/12898 **State:** closed **Merged:** Yes --- ## Problem Sidebar session links use relative paths (`${slug}/session/${id}`) instead of absolute paths (`/${slug}/session/${id}`). When the SolidJS router resolves these relative paths from certain route contexts (e.g., the root `/`), it constructs invalid double-slash paths like `//session/ses_xxx`, causing: ``` Uncaught (in promise) Error: Path '//session/ses_3bce84db7ffe2FH9YBwWwq0ERS' is not a routable path ``` This prevents the first message from being sent in newly created sessions. ## Root Cause In `sidebar-items.tsx`, both `SessionItem` (line 147) and `NewSessionItem` (line 288) construct hrefs without a leading `/`: ```tsx // SessionItem href={`${props.slug}/session/${props.session.id}`} // NewSessionItem href={`${props.slug}/session`} ``` Every other navigation call in the codebase already uses the correct absolute path pattern: | File | Pattern | |------|---------| | `layout.tsx:358` | `` `/${base64Encode(directory)}/session/${props.sessionID}` `` | | `layout.tsx:1105` | `` `/${base64Encode(session.directory)}/session/${session.id}` `` | | `notification.tsx:120` | `` `/${base64Encode(directory)}/session/${sessionID}` `` | | `submit.ts:200` | `` `/${base64Encode(sessionDirectory)}/session/${session.id}` `` | | `dialog-fork.tsx:73` | `` `/${base64Encode(sdk.directory)}/session/${forked.data.id}` `` | ## Fix Add the missing leading `/` to both href constructions in `sidebar-items.tsx`. ## Verification - TypeScript: all 12 workspace packages pass - Tests: 902 pass, 1 skip, 1 pre-existing timeout failure (unrelated `installs dependencies` test) Fixes #12840
yindo added the pull-request label 2026-02-16 18:19:13 -05:00
yindo closed this issue 2026-02-16 18:19:13 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14427