fix: project agents not discoverable in get_available_agents_dict#1783
fix: project agents not discoverable in get_available_agents_dict#1783wgnrai wants to merge 1 commit into
Conversation
get_available_agents_dict(project_name) receives the project name but drops it before calling get_agents_dict(), so the project agent scan block (if project_name:) never executes. All project-level agent profiles under .a0proj/agents/ are invisible to call_subordinate. Same bug in _normalize_subagents() in projects.py — project_name not forwarded to get_agents_dict(), and the function signature doesn't accept it. Fix: forward project_name in both call sites. Thread project_name through _normalize_subagents as a new parameter from both callers (load_project_subagents and save_project_subagents).
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f1881540d1
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ) -> dict[str, SubAgentListItem]: | ||
| # all available agents | ||
| all_agents = get_agents_dict() | ||
| all_agents = get_agents_dict(project_name) |
There was a problem hiding this comment.
Update helper DOX for project-scoped discovery
This behavior change makes get_available_agents_dict(project_name) include project-local agents, and the same commit also changes project subagent normalization to resolve through the project name, but the matching helpers/subagents.py.dox.md / helpers/projects.py.dox.md files were not updated. In this repo, helper behavior changes are supposed to keep the same-directory file-level DOX synchronized so future callers can rely on the documented cross-module contract.
AGENTS.md reference: helpers/AGENTS.md:L21-L23
Useful? React with 👍 / 👎.
Bug
get_available_agents_dict(project_name)receives the project name but drops it before callingget_agents_dict(), so the project agent scan block (if project_name:at line 79) never executes. All project-level agent profiles under.a0proj/agents/are invisible tocall_subordinateat runtime.The same bug exists in
_normalize_subagents()inhelpers/projects.py—project_nameis not forwarded toget_agents_dict(), and the function signature does not accept it.Impact
call_subordinateprofile validation cannot find project-scoped agents at runtimeavailable profileslist omits all project agentsagents.jsonhave no effect because_normalize_subagentscannot resolve project agent namesRoot cause
Both functions already accept
project_nameas a parameter (or have it available in their calling scope).get_agents_dict()already has the project scan logic. The argument is simply never forwarded.Fix
Two changes, 6 insertions / 5 deletions:
helpers/subagents.py— forwardproject_name:helpers/projects.py— threadproject_namethrough_normalize_subagents:Both callers (
load_project_subagents(name)andsave_project_subagents(name, ...)) updated to passname:Safety
project_name=None(no project context), behavior is identical to current (project scan skipped, same as now)