Skip to content

fix(app): scope web sessions by project#31492

Open
00xObi wants to merge 1 commit into
anomalyco:devfrom
00xObi:fix/project-scoped-web-sessions
Open

fix(app): scope web sessions by project#31492
00xObi wants to merge 1 commit into
anomalyco:devfrom
00xObi:fix/project-scoped-web-sessions

Conversation

@00xObi

@00xObi 00xObi commented Jun 9, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #31493

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The web app can list known projects, but root session loading was still tied to the startup/current instance unless callers routed by directory. This made selecting another project in Web show stale/startup-context sessions in some setups.

This PR adds projectID to the legacy /session list endpoint, passes it through Session.list, and makes web root project session loading call session.list with projectID and scope=project. Directory-scoped workspace/sandbox loading is left unchanged.

How did you verify your code works?

  • bun test test/server/session-list.test.ts
  • bun test src/context/server-sync.test.ts
  • bun --cwd packages/opencode typecheck
  • bun --cwd packages/app typecheck
  • bun --cwd packages/sdk/js typecheck
  • pre-push bun turbo typecheck

I also manually started the fixed web server from one project and queried another project with /session?projectID=...&scope=project&roots=true; it returned the selected project sessions.

Screenshots / recordings

No screenshot. The visible UI is unchanged; this changes which sessions are loaded for the selected project.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@00xObi 00xObi requested review from Brendonovich and Hona as code owners June 9, 2026 10:08
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Jun 9, 2026
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

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

Potential related PRs found:

  1. fix(app): load sidebar sessions after project restore (fix(app): load sidebar sessions after project restore #29387)

    • Related to project-scoped session loading in the web app
  2. fix(tui): show home sessions in global project (fix(tui): show home sessions in global project #29582)

    • Related to session visibility across different project contexts
  3. fix(opencode): preserve orphan sessions on project id drift (fix(opencode): preserve orphan sessions on project id drift #30682)

    • Related to handling sessions when project IDs change

These PRs address similar concerns about sessions and project scoping, but they appear to focus on different aspects (sidebar loading, TUI display, orphan preservation vs. endpoint scoping). PR #31492 appears to be the first to explicitly scope the /session endpoint by projectID.

@github-actions github-actions Bot removed needs:issue needs:compliance This means the issue will auto-close after 2 hours. labels Jun 9, 2026
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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 project picker does not load sessions for selected project

1 participant