fix(app): scope web sessions by project#31492
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: Potential related PRs found:
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 |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Issue for this PR
Closes #31493
Type of change
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
projectIDto the legacy/sessionlist endpoint, passes it throughSession.list, and makes web root project session loading callsession.listwithprojectIDandscope=project. Directory-scoped workspace/sandbox loading is left unchanged.How did you verify your code works?
bun test test/server/session-list.test.tsbun test src/context/server-sync.test.tsbun --cwd packages/opencode typecheckbun --cwd packages/app typecheckbun --cwd packages/sdk/js typecheckbun turbo typecheckI 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