Repository navigation
fix(agents): list agents in .agentignore'd folders as disabled - #987
Merged
Merged
Conversation
An agent disabled by a file rule in .agentignore shows in list and the dashboard as disabled, but agent discovery skipped every ignored folder, so an agent under a folder rule such as `archive/` vanished. Users could not see, enable, open or remove it, and the agentignore stats missed it. Discovery keeps skipping ignored folders by default, so sync, diff, check, audit, status and bulk update see exactly what they saw before. Agents have no marker file, so walking those folders everywhere would turn excluded docs into agents. A new DiscoverAll walks them and marks their agents disabled, like DiscoverSourceSkillsAll for skills. List, the dashboard, toggles, the ignore stats, and commands that name an agent use it. Name lookup moves to resource.FindAgent. An exact flat name or path wins. Otherwise a plain name prefers an active agent, so `uninstall agents reviewer` no longer removes a disabled archive copy first. `uninstall agents --all` now skips disabled agents, as skills already do.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 23, 2026
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.
Type
proposals/only — see CONTRIBUTING.md)approvedlabel)Linked Issue
No issue. Found while reviewing #980; listed under "Not in this PR" in #985.
What was wrong
.agentignorerules disable agents. A file rule such assolo.mdkeeps the agent visible as disabled. A folder rule such asarchive/made agent discovery skip the folder, so every agent inside it disappeared:list agentsdid not showarchive/reviewer.md, anduninstall agents archive/reviewersaid the agent was not found. Users could not see, enable, open or remove those agents, and the dashboard's.agentignorestats left them out. Skills already list agents in ignored folders as disabled.Fix
AgentKind.Discoverstill skips ignored folders. Sync, diff, check, audit, status, doctor, bulk update and the dashboard counts behave exactly as onmain. Agents have no marker file likeSKILL.md. Walking ignored folders everywhere would turn excluded docs folders into agents and audit them.AgentKind.DiscoverAllalso walks ignored folders and marks their agents disabled, likeDiscoverSourceSkillsAllfor skills. It is used where users see or name an agent:list agents, including the TUI and--json, and the dashboard agent list;uninstall agents <name>,--groupandupdate agents <name>;.agentignorestats and the sync ignore report.resource.FindAgent:.md) wins, even when the agent is disabled;main.uninstall agents --allskips disabled agents, as skills'--alldoes.mainremoved agents disabled by a file rule.Behavior changes
listand the dashboard now show every.mdfile inside an ignored folder as a disabled agent, docs included. Nothing else picks them up.uninstall agents reviewerwith an activeteam/reviewer.mdand a disabledarchive/reviewer.mdremoves the active one. Onmain, the walk order decided which one went.uninstall agents --allkeeps agents disabled by a file rule.update agents <name>also reaches agents in ignored folders. A plain name still updates every agent with that file name, as before, soupdate agents reviewercan now update a trackedarchive/reviewer.mdtoo.Tests
Each fails on
mainand passes with the fix. The exception is the file-rule cases of the server get and list tests, which keep the existing behavior covered:internal/resource:TestAgentKind_Discover_RespectsAgentignorecoversDiscoverandDiscoverAll.TestFindAgentis a table of exact path, flat name and name matches.internal/server:internal/sync:TestIgnoreReport_ListsAgentsInIgnoredFolders.tests/integration:list agents --jsonmarks an agent in an ignored folder as disabled;uninstall --allleaves disabled agents;--groupreach ignored folders;update agents <path>resolves an agent in an ignored folder.Checks
make checkpasses in the devcontainer.mainwith this branch (.agentignorewithdemo/,docs/andsolo.md):list agentsaddsdemo/reviewer.mdanddocs/doc.mdas disabled.audit agents,check,sync --dry-runandupdate agents --allprint the same output.uninstall agents demo/reviewerworks; onmainit says not found.update agents demo/reviewer.mdno longer says "no matching agents found".Not in this PR
listTUI, enabling an agent disabled by a folder rule flips the row to enabled while the rule still matches.skillshare enablereports "not disabled" in the same case. The same already happens with glob rules and for skills. A follow-up PR fixes the TUI andenable/disablefor all of these cases.Checklist
make check) — for code changes