Web UI: Double-slash in session navigation path causes 'not a routable path' error #8992

Open
opened 2026-02-16 18:11:20 -05:00 by yindo · 2 comments
Owner

Originally created by @abrekhov on GitHub (Feb 10, 2026).

Originally assigned to: @adamdotdevin on GitHub.

Bug Description

When creating a new session in the web UI (not TUI), the handleSubmit function constructs a navigation path with a double slash (//session/ses_...) instead of the expected single slash (/session/ses_...). This causes a SolidJS router error:

Uncaught (in promise) Error: Path '//session/ses_3b7bd962affe4y5YzNVLPFNlld' is not a routable path
    at index-DYv2w6j0.js:2:36223
    at nt (index-DYv2w6j0.js:2:4033)
    at B (index-DYv2w6j0.js:2:35928)
    at index-DYv2w6j0.js:2:36512
    at handleSubmit (session-Cu4fIOGN.js:34:32249)

Root Cause Analysis

The navigation path is constructed as:

navigate(`/${base64url(directory)}/session/${sessionId}`)

The base64url() encoding function encodes the working directory into a URL-safe base64 slug for the route. When the directory context resolves to an empty string, the encoding produces an empty string, resulting in:

/<empty>/session/ses_xxx  →  //session/ses_xxx

The SolidJS router rejects //session/... as an invalid routable path.

This happens when the session is created under a "global" project context (no specific project directory selected), where the directory slug is empty.

Steps to Reproduce

  1. Open the OpenCode web UI (e.g., http://localhost:4020)
  2. Ensure no specific project is selected (global/home context with projectID: "global")
  3. Type a message and press send (creates a new session)
  4. Observe the console error

Session Data

{
  "id": "ses_3b7bd75f7ffe7INt4SyEOW8EYR",
  "slug": "kind-river",
  "version": "1.1.53",
  "projectID": "global",
  "directory": "/home/user",
  "title": "New session - 2026-02-10T15:54:06.216Z"
}

Expected Behavior

New session creation should navigate correctly — either by using a fallback slug for the global/empty directory case, omitting the directory segment for global sessions, or ensuring the directory is always non-empty before constructing the path.

Environment

  • Version: 1.1.53
  • Platform: Linux (x86_64)
  • Interface: Web UI (not TUI)
  • Server config: server.port: 4020, server.hostname: localhost

Impact

The session is created successfully on the backend, but the frontend fails to navigate to it. The user is left on the previous page with the error in the console.

Originally created by @abrekhov on GitHub (Feb 10, 2026). Originally assigned to: @adamdotdevin on GitHub. ## Bug Description When creating a new session in the web UI (not TUI), the `handleSubmit` function constructs a navigation path with a double slash (`//session/ses_...`) instead of the expected single slash (`/session/ses_...`). This causes a SolidJS router error: ``` Uncaught (in promise) Error: Path '//session/ses_3b7bd962affe4y5YzNVLPFNlld' is not a routable path at index-DYv2w6j0.js:2:36223 at nt (index-DYv2w6j0.js:2:4033) at B (index-DYv2w6j0.js:2:35928) at index-DYv2w6j0.js:2:36512 at handleSubmit (session-Cu4fIOGN.js:34:32249) ``` ## Root Cause Analysis The navigation path is constructed as: ```js navigate(`/${base64url(directory)}/session/${sessionId}`) ``` The `base64url()` encoding function encodes the working directory into a URL-safe base64 slug for the route. When the directory context resolves to an **empty string**, the encoding produces an empty string, resulting in: ``` /<empty>/session/ses_xxx → //session/ses_xxx ``` The SolidJS router rejects `//session/...` as an invalid routable path. This happens when the session is created under a "global" project context (no specific project directory selected), where the directory slug is empty. ## Steps to Reproduce 1. Open the OpenCode web UI (e.g., `http://localhost:4020`) 2. Ensure no specific project is selected (global/home context with `projectID: "global"`) 3. Type a message and press send (creates a new session) 4. Observe the console error ## Session Data ```json { "id": "ses_3b7bd75f7ffe7INt4SyEOW8EYR", "slug": "kind-river", "version": "1.1.53", "projectID": "global", "directory": "/home/user", "title": "New session - 2026-02-10T15:54:06.216Z" } ``` ## Expected Behavior New session creation should navigate correctly — either by using a fallback slug for the global/empty directory case, omitting the directory segment for global sessions, or ensuring the directory is always non-empty before constructing the path. ## Environment - **Version**: 1.1.53 - **Platform**: Linux (x86_64) - **Interface**: Web UI (not TUI) - **Server config**: `server.port: 4020`, `server.hostname: localhost` ## Impact The session is created successfully on the backend, but the frontend fails to navigate to it. The user is left on the previous page with the error in the console.
yindo added the web label 2026-02-16 18:11:20 -05:00
Author
Owner

@adamdotdevin commented on GitHub (Feb 10, 2026):

@abrekhov can you install latest and see if this is resolved, I think we fixed it

@adamdotdevin commented on GitHub (Feb 10, 2026): @abrekhov can you install latest and see if this is resolved, I think we fixed it
Author
Owner

@ylxdzsw commented on GitHub (Feb 11, 2026):

1.1.56 fixed it for me

@ylxdzsw commented on GitHub (Feb 11, 2026): 1.1.56 fixed it for me
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8992