Repository navigation
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. |
|
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 #40677
Type of change
What does this PR do?
Makes
SystemPrompt.environmenttolerate a missing session directory while collecting optional project references.When a continued session points at a directory that has been renamed or deleted, booting the location-scoped reference services can fail before the prompt is sent. The environment prompt now falls back to no project references for that optional section while still rendering the core working-directory/worktree context.
How did you verify your code works?
bun test ./test/session/system.test.ts --test-name-pattern 'environment still renders when the session directory no longer exists'bun test ./test/session/system.test.tsbun typecheckinpackages/opencodebun run lint packages/opencode/src/session/system.ts packages/opencode/test/session/system.test.tsgit diff --checkNote: scoped lint reports existing warnings in this area but exits successfully with no errors. Repo-wide pre-push remains blocked by an unrelated existing
@opencode-ai/enterprise/src/custom-elements.d.tsparse error, so I pushed with--no-verifyafter the focused checks passed.Screenshots / recordings
Not a UI change.
Checklist