fix(config): add debug logging for agent/command loading (#8868)#8881
Open
shoaibansari5398 wants to merge 1 commit intoanomalyco:devfrom
Open
fix(config): add debug logging for agent/command loading (#8868)#8881shoaibansari5398 wants to merge 1 commit intoanomalyco:devfrom
shoaibansari5398 wants to merge 1 commit intoanomalyco:devfrom
Conversation
Contributor
|
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. |
Contributor
|
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
00637c0 to
71e0ba2
Compare
f1ae801 to
08fa7f7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes #8868
Description
This PR addresses issue #8868 by adding debug logging to the configuration loading process. This helps diagnose environment-specific issues where agents or commands might not be loaded correctly from discovered directories.
Changes
Added debug logs in src/config/config.ts to track:
Configuration directories discovered (including OPENCODE_CONFIG_DIR, .opencode, and home directory).
The number of agents, commands, modes, and plugins loaded from each directory.
Failures during agent or command loading.
Added a regression test (packages/opencode/test/config/issue-8868.test.ts) that reproduces the user's setup with a .opencode/ directory to ensure configurations are loaded as expected.
How did you verify your code works?
Verification
I verified these changes by running the new regression test:
Ran bun test packages/opencode/test/config/issue-8868.test.ts.
Confirmed that the test passes and that the expected debug logs would be generated in a real scenario.