Repository navigation
Conversation
Project.Service is global, but ProjectGroup still ran the location middleware left over from the removed project.current endpoint. Every GET /api/project without a location therefore booted the server's default (cwd) location, undoing debug.location.evict and re-resolving that directory's project. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
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: |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #51198
Type of change
What does this PR do?
Project.Serviceis global, butProjectGroupwas still wrapped in the location middleware, left over from the removedproject.currentendpoint. So anyGET /api/projectwithout a location booted the server's default location (its cwd, i.e. the home dir on Desktop). That undiddebug.location.evictfor that location and re-resolved its project, which is what the issue describes in step 3.This drops the middleware from
ProjectGroup, the same wayCredentialGroupandWorktreeGroupare mounted. The regenerated client loses the 404 onproject.list, which only came from the middleware'sLocationNotFoundError.Side note: the issue's
?location=<dir>form returns 400. The query is a deepObject, so it has to be?location[directory]=<dir>.How did you verify your code works?
/api/debug/locationcomes back empty), callGET /api/project, and the location is loaded again.packages/server/test/project.test.ts. It fails without the fix and passes with it.bun testinpackages/serverpasses.bun typecheckpasses in protocol, server and client, andbun run checkpassed in the pre-push hook.Screenshots / recordings
N/A, no UI change.
Checklist
🤖 Generated with Claude Code