-
Notifications
You must be signed in to change notification settings - Fork 6k
fix(desktop): desktop won't read project scope commands/skills #6963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
- Replace stack-based nested call tracking with simpler local variable - Replace manual release/chained lock with promise queue pattern - Extract getDirectory helper in server.ts to reduce duplication - Use fs.exists() instead of fs.stat().then() pattern in config.ts
Tests cover: - Running functions in specified directory - Directory restoration after execution - Skip optimization when already in target directory - Error handling with proper cleanup - Nested call handling - Concurrent call serialization - Async function support - Deeply nested directory changes
|
The following comment was made by an LLM, it may be inaccurate: Duplicate Search ResultsNo duplicate PRs found. The search queries returned only the PR mentioned in your file (PR #6963: "fix(desktop): desktop won't read project scope commands/skills"), which is the current PR being checked. I searched using multiple relevant terms:
All searches confirm there are no other open PRs addressing the same desktop project scope issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a critical issue on desktop where project-scoped commands, skills, and configurations were not being loaded when switching between projects. The root cause was that only a single project instance was created and reused across different directories without rebuilding.
Key changes:
- Added
ProcessCwdutility to safely manageprocess.cwd()changes with proper serialization for concurrent calls and restoration on completion - Wrapped project instance creation and execution with
ProcessCwd.run()to ensure correct working directory context - Wrapped tool execution in server endpoints with
Instance.provide()to guarantee proper project context - Added support for loading commands from
.claude/commands/directories for Claude Desktop compatibility - Enhanced desktop-specific project identification using directory hashing for non-git directories
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/opencode/src/util/process-cwd.ts | New utility to safely manage process.cwd() changes with concurrency control and nested call support |
| packages/opencode/test/util/process-cwd.test.ts | Comprehensive test suite for ProcessCwd utility covering edge cases |
| packages/opencode/src/project/instance.ts | Integrated ProcessCwd.run() to ensure tool execution happens in correct working directory context |
| packages/opencode/src/project/project.ts | Added desktop-specific project identification using directory hashing for non-git directories |
| packages/opencode/src/config/config.ts | Added support for loading commands from .claude/commands/ directories |
| packages/opencode/src/server/server.ts | Extracted getDirectory helper and wrapped prompt endpoints with Instance.provide for proper project context |
| packages/opencode/src/session/prompt.ts | Wrapped tool execution with Instance.provide to ensure commands/skills are loaded from correct project |
| packages/opencode/src/tool/skill.ts | Fixed error message to properly display available skills using map instead of Promise |
| packages/app/src/context/permission.tsx | Refactored directory decoding logic to avoid redundant operations (contains bug) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Directory is now passed directly without base64 encoding, simplifying the permission check logic.
Issue: on desktop, no project setup will read(project scope commands/skills etc.).
Root cause: only one project instance created, won't rebuild when switching project.
Solution: added ProcessCwd utility to safely manages process.cwd() changes. And wrap some process in Instance.provide to make sure use right project instance.