Skip to content

fix: use absolute paths for sidebar session navigation#12898

Merged
adamdotdevin merged 1 commit intoanomalyco:devfrom
riftzen-bit:fix/sidebar-absolute-path-routing
Feb 10, 2026
Merged

fix: use absolute paths for sidebar session navigation#12898
adamdotdevin merged 1 commit intoanomalyco:devfrom
riftzen-bit:fix/sidebar-absolute-path-routing

Conversation

@riftzen-bit
Copy link
Contributor

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

The sidebar href construction in SessionItem and NewSessionItem was
missing a leading slash, producing relative paths like
`${slug}/session/${id}` instead of `/${slug}/session/${id}`.

When the router resolves these relative paths from certain route
contexts, it produces invalid double-slash paths like
`//session/ses_xxx`, causing "not a routable path" errors and
preventing the first message from being sent in new sessions.

Every other navigation call in the codebase (layout.tsx,
notification.tsx, submit.ts, dialog-fork.tsx, dialog-select-file.tsx)
already uses the correct absolute path pattern with a leading slash.

Fixes #12840
Copilot AI review requested due to automatic review settings February 10, 2026 02:05
@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes SolidJS router navigation errors caused by sidebar session links using relative paths instead of absolute paths, which can generate non-routable //session/... URLs and break first-message send flow for new sessions.

Changes:

  • Update SessionItem sidebar link to use an absolute href (/${slug}/session/${id}).
  • Update NewSessionItem sidebar link to use an absolute href (/${slug}/session).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +147 to 148
href={`/${props.slug}/session/${props.session.id}`}
class={`flex items-center justify-between gap-3 min-w-0 text-left w-full focus:outline-none transition-[padding] ${props.mobile ? "pr-7" : ""} group-hover/session:pr-7 group-focus-within/session:pr-7 group-active/session:pr-7 ${props.dense ? "py-0.5" : "py-1"}`}
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

SessionItem's main link was updated to an absolute path, but the onMessageSelect handler in the same component still calls navigate(${props.slug}/session/${props.session.id}) without a leading / (see ~line 234). That relative navigation can hit the same SolidJS router resolution issue and produce non-routable paths; update it to use an absolute path for consistency and correctness.

Copilot uses AI. Check for mistakes.
@adamdotdevin adamdotdevin merged commit 0732ab3 into anomalyco:dev Feb 10, 2026
14 of 15 checks passed
BryceRyan pushed a commit to BryceRyan/opencode that referenced this pull request Feb 10, 2026
sellys-537 pushed a commit to sellys-537/opencode that referenced this pull request Feb 11, 2026
* fix(app): workspace reset issues

* fix(app): new session in workspace choosing wrong workspace

* chore: fix some norwegian i18n issues (anomalyco#12935)

* fix: use absolute paths for sidebar session navigation (anomalyco#12898)

* chore: fix typos and GitHub capitalization (anomalyco#12852)

* chore: fix test

* fix(docs): locale translations

* chore: fix e2e tests

* chore: generate

* test(e2e): redo & undo test (anomalyco#12974)

* fix(app): persist defensiveness (anomalyco#12973)

* refactor: clean up dialog-model.tsx per code review (anomalyco#12983)

* fix(app): use agent configured variant (anomalyco#12993)

* fix(app): terminal replay (anomalyco#12991)

* fix(app): regressions

* chore: translator agent

* fix(app): don't dispose instance after reset workspace

* fix(app): memory leak with event fetch

* fix(app): no changes in review pane

* wip: zen

* fix(app): global event default fetch

* zen: retry on 429

* fix(app): include basic auth

* fix(app): back to platform fetch for now

* release: v1.1.54

* fix: show helpful message when free usage limit is exceeded (anomalyco#13005)

* fix(app): disable terminal transparency

* fix(app): memory leak with platform fetch for events

* core: increase test timeout to 30s to prevent failures during package installation

* release: v1.1.55

* fix(docs): locale translations

* fix(app): don't scroll code search input

* chore: generate

* fix(app): don't close sidebar on session change (anomalyco#13013)

* zen: log error

* fix(desktop): open apps with executables on Windows (anomalyco#13022)

* fix(docs): invalid markdown

* fix(app): task tool rendering

* release: v1.1.56

* chore: update website stats

* wip: zen

* fix(docs): locale translations

* wip: zen

* wip: zen

* wip: zen

* wip: zen

* wip: zen

* Update VOUCHED list

anomalyco#12841 (comment)

* fix(tui): improve amazon-bedrock check to include container credentials (anomalyco#13037)

* fix(tui): default session sidebar to auto (anomalyco#13046)

* tweak: /review prompt to look for behavior changes more explicitly (anomalyco#13049)

* fix(core): ensure compaction is more reliable, add reserve token buffer to ensure that input window has enough room to compact (anomalyco#12924)

Co-authored-by: James Lal <james@littlebearlabs.io>

* chore: generate

* docs: remove 'Migrating to 1.0' documentation section (anomalyco#13076)

* wip: zen

* fix: add additional context overflow cases, remove overcorrecting ones (anomalyco#13077)

* feat(desktop): add WSL backend mode (anomalyco#12914)

* fix(desktop): read wayland preference from store (anomalyco#13081)

* fix(desktop): server spawn resilience (anomalyco#13028)

Co-authored-by: Brendan Allan <git@brendonovich.dev>

* fix(docs): avoid footer language selector truncation (anomalyco#13124)

* docs(ko): improve translations for intro, cli, and commands (anomalyco#13094)

* chore: generate

* feat(desktop): enhance Windows app resolution and UI loading states (anomalyco#13084)

* fix: encode non-ASCII directory paths in v1 SDK HTTP headers (anomalyco#13131)

* desktop: use tracing for logging (anomalyco#13135)

* fix(web): prevent language select label truncation (anomalyco#13100)

* fix(app): copy path button styles

* fix(app): terminal copy/paste

* release: v1.1.57

* fix(tui): prevent home wordmark corruption in height-constrained terminals (anomalyco#13069)

* feat(prompt): mode-specific input placeholders (anomalyco#12388)

* fix(tui): keep /share available to copy existing link (anomalyco#12532)

* fix(tui): dismiss dialogs with ctrl+c (anomalyco#12884)

* Initial plan

---------

Co-authored-by: Adam <2363879+adamdotdevin@users.noreply.github.com>
Co-authored-by: Ole-Martin Bratteng <1681525+omBratteng@users.noreply.github.com>
Co-authored-by: Paul <139470135+riftzen-bit@users.noreply.github.com>
Co-authored-by: Peter Dave Hello <3691490+PeterDaveHello@users.noreply.github.com>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: Filip <34747899+neriousy@users.noreply.github.com>
Co-authored-by: Dax <mail@thdxr.com>
Co-authored-by: Frank <frank@anoma.ly>
Co-authored-by: opencode <opencode@sst.dev>
Co-authored-by: Dax Raad <d@ironbay.co>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: OpeOginni <107570612+OpeOginni@users.noreply.github.com>
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
Co-authored-by: James Lal <james@littlebearlabs.io>
Co-authored-by: Ariane Emory <97994360+ariane-emory@users.noreply.github.com>
Co-authored-by: Brendan Allan <brendonovich@outlook.com>
Co-authored-by: Brendan Allan <git@brendonovich.dev>
Co-authored-by: webwww123 <1876948535@qq.com>
Co-authored-by: Jun <87404676+Seungjun0906@users.noreply.github.com>
Co-authored-by: Jack <740172898@qq.com>
Co-authored-by: Shintaro Jokagi <61367823+taroj1205@users.noreply.github.com>
Co-authored-by: Kit Langton <kit.langton@gmail.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
keakon pushed a commit to keakon/opencode that referenced this pull request Feb 11, 2026
avion23 pushed a commit to avion23/opencode that referenced this pull request Feb 13, 2026
relaxkeren pushed a commit to relaxkeren/opencode that referenced this pull request Feb 15, 2026
schneiderlo pushed a commit to schneiderlo/opencode that referenced this pull request Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Web: New session created but first message cannot be sent (Path '//session/...' is not a routable path)

2 participants