Skip to content

fix(resource): never skip a hidden-named agents source root - #515

Merged
runkids merged 1 commit into
mainfrom
runkids/fix-hidden-agents-source-root
Oct 10, 2026
Merged

runkids merged 1 commit into
mainfrom
runkids/fix-hidden-agents-source-root

Conversation

@runkids

@runkids runkids commented Oct 10, 2026

Copy link
Copy Markdown
Owner

Summary

Same class of bug as #514 (background: #511). A sources.agents directory whose basename starts with . (e.g. ~/.agents) discovered zero agents.

Root cause

AgentKind.Discover skipped any hidden directory with utils.IsHidden(info.Name()) && info.Name() != ".". The != "." guard never fires because walkRoot is an absolute resolved path, so filepath.Walk's first callback (the root itself) returned SkipDir.

Fix

  • internal/resource/agent.go: guard with path != walkRoot, same as the other walks in the repo (internal/config/reconcile_core.go, cmd/skillshare/update_project.go). Nested hidden dirs are still skipped.
  • internal/server/handler_skills.go: same one-line guard on the skill detail file listing walk, which had no root exemption.

Verification (devcontainer image, worktree mounted in a temporary container)

  • New TestAgentKind_Discover_HiddenSourceRoot: .agents/demo.md is discovered, .agents/.nested/skipped.md is not. Fails without the fix (got []), passes with it.
  • go test ./internal/resource/ ./internal/server/ passes.
  • make check passes (exit 0, all unit and integration tests).

Notes

  • The handler change has no new test: reaching it needs a skill whose resolved root has a hidden basename, which discovery already filters, so it is covered by inspection.
  • Left untouched: install_discovery.go (its first-level rule is intentional) and the no-op info.Name() != "." in the ignore-matcher branch of agent.go, which is harmless (follow-up candidate).

AgentKind.Discover and the skill detail file listing skipped every
hidden directory, including the walk root itself. The `!= "."` guard in
agent.go never fires because walkRoot is an absolute resolved path, so a
sources.agents directory such as ~/.agents discovered zero agents.

Exempt the walk root (`path != walkRoot`), matching the other walks in
the repo. Nested hidden directories are still skipped.

Related to #511 (same class as #514).
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-10T13:49:52.491960Z c6b8f5b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@runkids
runkids merged commit 81974cf into main Oct 10, 2026
8 checks passed
@runkids
runkids deleted the runkids/fix-hidden-agents-source-root branch October 10, 2026 14:03
runkids added a commit that referenced this pull request Oct 10, 2026
…515

Release Please regenerated the entry when #513 landed on main. Restore
the user-facing version and describe the three fixes merged since: the
skills source named like a tool folder (#511, via #514), the hidden
agents source folder (#515) and moved installed skills (#513).
runkids added a commit that referenced this pull request Oct 10, 2026
* chore(main): release 0.25.4

* chore(release): synchronize release metadata

* docs(changelog): restore the curated 0.25.4 entry and add #511, #513, #515

Release Please regenerated the entry when #513 landed on main. Restore
the user-facing version and describe the three fixes merged since: the
skills source named like a tool folder (#511, via #514), the hidden
agents source folder (#515) and moved installed skills (#513).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Willie <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant