fix(doctor): use autoDetectSkillsDir so OpenClaw workspaces are reachable#684
Closed
brandonlipman wants to merge 1 commit into
Closed
fix(doctor): use autoDetectSkillsDir so OpenClaw workspaces are reachable#684brandonlipman wants to merge 1 commit into
brandonlipman wants to merge 1 commit into
Conversation
…able
`gbrain doctor` was the only consumer of `findRepoRoot` from
`core/repo-root.ts`. Every other consumer (check-resolvable.ts:145,
skillify.ts, etc.) uses `autoDetectSkillsDir`, which has the full
detection chain:
1. \$OPENCLAW_WORKSPACE
2. ~/.openclaw/workspace
3. findRepoRoot() walk from cwd
4. ./skills
`findRepoRoot` only does step 3. Result: when the user runs `gbrain
doctor` from any directory outside the gbrain repo or the OpenClaw
workspace tree (e.g., a project's checkout), `resolver_health` reports
"Could not find skills directory" even though the dispatcher exists at
~/.openclaw/workspace/skills/RESOLVER.md.
Reproduces in any directory other than ~/gbrain or its descendants on
a system with ~/.openclaw/workspace/skills/RESOLVER.md present:
\$ cd ~/Documents
\$ gbrain doctor
[WARN] resolver_health: Could not find skills directory # before
[WARN] resolver_health: 5 issue(s): 0 error(s), 5 warning(s) # after
Switching doctor to `autoDetectSkillsDir` brings it inline with the rest
of the codebase. The detected dir is also passed to
`checkSkillConformance` (step 2 of the resolver_health block), which
previously rebuilt the path from `repoRoot` — now uses the same
detected path for consistency.
All 15 existing tests in test/doctor.test.ts continue to pass.
Owner
|
Closing — your fix landed in master via the v0.30.3 fix-wave PR #776 (merged at Thank you for the contribution — credit is preserved in the v0.30.3 CHANGELOG entry. 🙏 |
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
gbrain doctoris the only consumer offindRepoRoot()fromcore/repo-root.ts. Every other consumer (check-resolvable.ts:145,skillify.ts, etc.) usesautoDetectSkillsDir(), which has the full detection chain:\$OPENCLAW_WORKSPACE~/.openclaw/workspacefindRepoRoot()walk from cwd./skillsfindRepoRootonly does step 3. Result: when the user runsgbrain doctorfrom any directory outside the gbrain repo or the OpenClaw workspace tree (e.g., a project checkout),resolver_healthreportsCould not find skills directoryeven though the dispatcher exists at~/.openclaw/workspace/skills/RESOLVER.md.Repro
In any directory other than
~/gbrainor its descendants, on a system with~/.openclaw/workspace/skills/RESOLVER.mdpresent:```
$ cd ~/Documents
$ gbrain doctor
[WARN] resolver_health: Could not find skills directory # before
```
But:
```
$ gbrain check-resolvable --verbose
Auto-detected skills directory from ~/.openclaw/workspace/skills: /Users/.../.openclaw/workspace/skills
```
Same machine, same setup, two different commands disagree on whether the skills dir exists. The disagreement is the bug.
Fix
Switch doctor to
autoDetectSkillsDir. Brings it inline with the rest of the codebase. The detected dir is now also passed tocheckSkillConformance(step 2 of the resolver_health block), which previously rebuilt the path fromrepoRoot— now uses the same detected path for consistency.Test
All 15 existing tests in
test/doctor.test.tscontinue to pass.```
$ bun test test/doctor.test.ts
15 pass, 0 fail, 39 expect() calls
```
Need help on this PR? Tag
@codesmithwith what you need.