[PR #8881] fix(config): add debug logging for agent/command loading (#8868) #12898

Open
opened 2026-02-16 18:17:47 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/8881

State: open
Merged: No


What does this PR do?

Fixes https://github.com/anomalyco/opencode/issues/8868
Description
This PR addresses issue https://github.com/anomalyco/opencode/issues/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.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/8881 **State:** open **Merged:** No --- ### What does this PR do? Fixes https://github.com/anomalyco/opencode/issues/8868 Description This PR addresses issue https://github.com/anomalyco/opencode/issues/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.
yindo added the pull-request label 2026-02-16 18:17:47 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12898