Skip to content

fix(ui): remove scope=project from session list requests#572

Open
JDis03 wants to merge 1 commit into
NeuralNomadsAI:devfrom
JDis03:fix/session-list-directory-scope
Open

fix(ui): remove scope=project from session list requests#572
JDis03 wants to merge 1 commit into
NeuralNomadsAI:devfrom
JDis03:fix/session-list-directory-scope

Conversation

@JDis03

@JDis03 JDis03 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Problem

PR #565 (commit e29c3a0) added scope=project to session list requests to avoid pagination limits. With OpenCode 1.17.x, the /session endpoint ignores the directory filter when scope=project is present and returns all sessions from the global SQLite database instead.

This makes the same session appear in every project tab. Deleting a session from one tab deletes it from the shared DB, affecting all of them.

Reproduction

# Pick any opencode workspace port
PORT=4096
curl -s -u "codenomad:$PASSWORD" \
  "http://127.0.0.1:$PORT/session?directory=/home/user/project-a&scope=project" \
  | jq 'length'
# Returns sessions from project-b too — should only return project-a's

curl -s -u "codenomad:$PASSWORD" \
  "http://127.0.0.1:$PORT/session?directory=/home/user/project-a" \
  | jq 'length'
# Correct: only project-a's sessions

Related: anomalyco/opencode#33113

Fix

Drop scope: "project" from buildProjectSessionListOptions(). The directory parameter alone correctly filters sessions to the requested folder on OpenCode 1.17.x. scope: "project" can be reintroduced once the backend respects directory alongside it.

Validation

  • directory=/test → 1 session (correct)
  • directory=/idm → 1 session (correct)
  • Same session no longer appears in multiple project tabs
  • Deleting a session in one project no longer affects others

OpenCode 1.17.10 has a bug in the /session endpoint: when scope=project
is passed, it ignores the directory filter and returns ALL sessions
across every project. This made the same session appear in every
project tab in CodeNomad — deleting a session from one tab deleted
it from all of them.

The scope=project parameter was added in upstream PR NeuralNomadsAI#565
(commit e29c3a0) to avoid pagination limits on the default endpoint.
With the directory filter ignored, that optimization becomes a
correctness bug, so drop scope=project until OpenCode fixes the
backend.

With directory alone, the endpoint correctly returns only the
sessions for the requested folder. Verified via curl on the running
process: directory=/test returns 1 session (Hola greeting),
directory=/idm returns 1 session (up).

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

PR builds are available as GitHub Actions artifacts:

https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/28476660488

Artifacts expire in 7 days.
Artifacts:

  • pr-572-5f90c07932d62d0429e5c37d168a884686021f64-tauri-macos
  • pr-572-5f90c07932d62d0429e5c37d168a884686021f64-tauri-linux
  • pr-572-5f90c07932d62d0429e5c37d168a884686021f64-electron-macos
  • pr-572-5f90c07932d62d0429e5c37d168a884686021f64-tauri-windows
  • pr-572-5f90c07932d62d0429e5c37d168a884686021f64-tauri-macos-arm64
  • pr-572-5f90c07932d62d0429e5c37d168a884686021f64-electron-windows
  • pr-572-5f90c07932d62d0429e5c37d168a884686021f64-electron-linux

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.

1 participant