anomalyco / anomalyco/opencode

Web/new layout: direct /:dir/session creates a draft but does not register the directory as an opened project

Open
#42,265 0 comments 0 reactions 1 assignee View on GitHub

@Brendonovich is already working on this.

Since Aug 13, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

With the new layout enabled, opening a valid direct route such as /:dir/session creates a draft for the correct directory, but does not add that directory to the browser's opened-project state.

The composer works in the requested directory. After returning to Home, however, the directory is missing from Projects and the titlebar + button silently does nothing until the directory is added manually.

Expected: entering through an explicit valid directory route should register the resolved directory as an opened/last project, just like opening it from Home.

Evidence: the draft contains the expected directory, GET /path?directory=... and subsequent directory-scoped requests use that path, but opencode.global.dat:server has no corresponding opened-project entry.

On current dev, SessionRoute in packages/app/src/app.tsx creates the draft with the resolved sdk().directory, but this path does not call projects.open(directory) or projects.touch(directory).

This looks like the new-layout recurrence of #18943 and #26165, both closed by stale cleanup rather than a merged fix.

It shares the final symptom with #37606, but the input is different. #37606 starts from Home with no project and discusses falling back to the server startup directory. Here the user already supplied a valid route directory, which may intentionally differ from the server process cwd (for example, hosted per-user workspaces). The resolved route directory should be remembered rather than replaced with the process cwd.

Plugins

None required. My deployed build contains an unrelated Safari IME patch, but current upstream dev has the same affected code path.

OpenCode version

1.18.15 (web); also present in current dev at cc4b456129 / 1.18.18

Steps to reproduce
  1. Start opencode web and use a fresh browser profile, or clear the site's localStorage so no projects are opened.
  2. Create or choose a valid directory different from the server process cwd.
  3. Open /{base64(directory)}/session directly.
  4. Observe that OpenCode redirects to /new-session?draftId=... and the draft uses the requested directory.
  5. Click the Home button in the titlebar.
  6. Observe that Projects is empty and click the titlebar + button.

Actual: the project is not registered and + has no effect.

Expected: the resolved route directory is registered as an opened/last project, appears on Home, and can be used for later sessions.

Screenshot and/or share link

Not included because the workspace path contains a private username. The behavior is visible as an empty Projects section and an inert titlebar + button after returning from the correctly scoped draft.

Operating System

Linux server; Safari on macOS client

Terminal

N/A (web UI)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.