-
Notifications
You must be signed in to change notification settings - Fork 6.6k
feat: add OPENCODE_DISABLE_PROJECT_DISCOVERY env var #8093
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
|
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
8fadde1 to
31aff11
Compare
Adds environment variable to disable project-level config discovery for external tooling integration. Closes anomalyco#7559
Static constants are evaluated at module load time, but external tooling needs to set env vars at runtime. Changed to getters that re-evaluate on each access.
f089639 to
9f42f87
Compare
9f42f87 to
2c95d8c
Compare
Remove symlink farm architecture from ghost mode, replacing it with OpenCode's native OPENCODE_DISABLE_PROJECT_DISCOVERY environment variable. Changes: - Delete symlink-farm.ts, pattern-filter.ts, file-sync.ts + tests - Simplify opencode.ts (512 → 304 lines) - Remove exclude/include/maxFiles from ghost schema - Update AGENTS.md documentation BREAKING CHANGE: Profiles with AGENTS.md must add `instructions: ["./AGENTS.md"]` to their opencode.jsonc configuration. Depends on: anomalyco/opencode#8093
Remove symlink farm architecture from ghost mode, replacing it with OpenCode's native OPENCODE_DISABLE_PROJECT_DISCOVERY environment variable. Changes: - Delete symlink-farm.ts, pattern-filter.ts, file-sync.ts + tests - Simplify opencode.ts (512 → 304 lines) - Remove exclude/include/maxFiles from ghost schema - Update AGENTS.md documentation BREAKING CHANGE: Profiles with AGENTS.md must add `instructions: ["./AGENTS.md"]` to their opencode.jsonc configuration. Depends on: anomalyco/opencode#8093
| matches = await Filesystem.globUp(instruction, Instance.directory, Instance.worktree).catch(() => []) | ||
| // Relative path handling | ||
| if (Flag.OPENCODE_DISABLE_PROJECT_DISCOVERY) { | ||
| if (Flag.OPENCODE_CONFIG_DIR) { |
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.
Isnt this specific to the "instructions" field, why do we have to do all these hacks here... this seems messy
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.
The instruction path resolution already happens here so I just added the conditional to handle the new flag. Open to suggestions if there's a preferred pattern, but refactoring the existing architecture felt out of scope for this PR.
Updated warning message for skipping relative instructions.
Closes #7559
Adds environment variable to disable project-level config discovery for external tooling integration.
Changes
.opencode/directoriesUsage
Verification
Automated
bun test --filter "OPENCODE_DISABLE_PROJECT_DISCOVERY"Manual
Setup:
bun dev /tmp/test-proj run "what tools do you have?"OPENCODE_DISABLE_PROJECT_DISCOVERY=true bun dev /tmp/test-proj run "what tools do you have?"bun dev /tmp/test-proj run "say hello"OPENCODE_DISABLE_PROJECT_DISCOVERY=true bun dev /tmp/test-proj run "say hello"OPENCODE_DISABLE_PROJECT_DISCOVERY=true bun dev /tmp/test-proj run "what tools do you have?"Cleanup: