Skip to content

fix(protocol): stop project routes from booting the default location - #53066

Closed
ykakade wants to merge 1 commit into
anomalyco:devfrom
ykakade:fix-location-evict
Closed

ykakade wants to merge 1 commit into
anomalyco:devfrom
ykakade:fix-location-evict

Conversation

@ykakade

@ykakade ykakade commented Oct 4, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #51198

Type of change

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

What does this PR do?

Project.Service is global, but ProjectGroup was still wrapped in the location middleware, left over from the removed project.current endpoint. So any GET /api/project without a location booted the server's default location (its cwd, i.e. the home dir on Desktop). That undid debug.location.evict for that location and re-resolved its project, which is what the issue describes in step 3.

This drops the middleware from ProjectGroup, the same way CredentialGroup and WorktreeGroup are mounted. The regenerated client loses the 404 on project.list, which only came from the middleware's LocationNotFoundError.

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?

  • Reproduced it against a local server: load a location, evict it (/api/debug/location comes back empty), call GET /api/project, and the location is loaded again.
  • Added packages/server/test/project.test.ts. It fails without the fix and passes with it.
  • bun test in packages/server passes. bun typecheck passes in protocol, server and client, and bun run check passed in the pre-push hook.

Screenshots / recordings

N/A, no UI change.

Checklist

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

🤖 Generated with Claude Code

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]>
@github-actions

github-actions Bot commented Oct 4, 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 Oct 4, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

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:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

debug: evicting a loaded location recreates its project

1 participant