You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
debug: evicting a loaded location recreates its project #51198
DELETE /api/debug/location?location=<dir> ("Evict a loaded location") does not actually evict a loaded location: the location remains in GET /api/debug/location, and the project row for that location is re-created (new time_created) in /api/project.
Plugins
None.
OpenCode version
2.0.16
Steps to reproduce
Have a loaded location that is not in use, e.g. C:\Users\<user>.
Fix in #53066. GET /api/project was still going through the location middleware, so listing projects re-booted the server's default location right after it was evicted.
Also, ?location=<dir> returns 400. The query has to be ?location[directory]=<dir>.
Thanks for the clear report! I reproduced this on 2.0.16, but it no longer happens on the latest dev (9adc42b), so it looks already fixed. The fix should be in the next release (the change was first tagged in v2.2.0).
What I found on 2.0.16:
The eviction itself works: after DELETE /api/debug/location?location[directory]=<dir>, GET /api/debug/location comes back empty.
The next plain GET /api/project loads the location again. On that version the project routes loaded the server's default location (its working folder, which is your home folder in Desktop) whenever a request had no location, and that also looked the project up again.
On the latest dev, GET /api/project no longer loads a location, so an evicted location stays evicted.
The parameter has to be written as ?location[directory]=<dir>. The plain ?location=<dir> form returns 400.
Closing this as completed, since there was no reply in the day since the last update. On 2.0.16, a location evicted with DELETE /api/debug/location?location[directory]=<dir> was loaded again by the next plain GET /api/project. On the latest dev (9adc42b) it stays evicted, so this looks fixed. The change was first tagged in v2.2.0 and should be in the next release.
If it still happens on a newer version, please comment here or open a new issue with the version and the requests you sent. Note that the parameter has to be written as location[directory]; the plain ?location=<dir> form returns 400. If a location comes back in Desktop for another reason, #58795 may be the cause. Thanks for the report!
Activity
ykakade commentedon Sep 27, 2026
I can look into this!
ykakade commentedon Oct 4, 2026
Fix in #53066.
GET /api/projectwas still going through the location middleware, so listing projects re-booted the server's default location right after it was evicted.Also,
?location=<dir>returns 400. The query has to be?location[directory]=<dir>.opencodejr commentedon Oct 28, 2026
Thanks for the clear report! I reproduced this on 2.0.16, but it no longer happens on the latest
dev(9adc42b), so it looks already fixed. The fix should be in the next release (the change was first tagged in v2.2.0).What I found on 2.0.16:
DELETE /api/debug/location?location[directory]=<dir>,GET /api/debug/locationcomes back empty.GET /api/projectloads the location again. On that version the project routes loaded the server's default location (its working folder, which is your home folder in Desktop) whenever a request had no location, and that also looked the project up again.dev,GET /api/projectno longer loads a location, so an evicted location stays evicted.The parameter has to be written as
?location[directory]=<dir>. The plain?location=<dir>form returns 400.Related, ordered by likelihood:
The bot will close this issue in 1 day unless you reply that it still happens, e.g. on v2.2.0 or newer.
opencodejr commentedon Oct 29, 2026
Closing this as completed, since there was no reply in the day since the last update. On 2.0.16, a location evicted with
DELETE /api/debug/location?location[directory]=<dir>was loaded again by the next plainGET /api/project. On the latestdev(9adc42b) it stays evicted, so this looks fixed. The change was first tagged in v2.2.0 and should be in the next release.If it still happens on a newer version, please comment here or open a new issue with the version and the requests you sent. Note that the parameter has to be written as
location[directory]; the plain?location=<dir>form returns 400. If a location comes back in Desktop for another reason, #58795 may be the cause. Thanks for the report!