Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions helpers/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,25 +648,26 @@ def load_project_subagents(name: str) -> dict[str, SubAgentSettings]:
abs_path = files.get_abs_path(get_project_meta(name), "agents.json")
data = dirty_json.parse(files.read_file(abs_path))
if isinstance(data, dict):
return _normalize_subagents(data) # type: ignore[arg-type,return-value]
return _normalize_subagents(data, name) # type: ignore[arg-type,return-value]
return {}
except Exception:
return {}


def save_project_subagents(name: str, subagents_data: dict[str, SubAgentSettings]):
abs_path = files.get_abs_path(get_project_meta(name), "agents.json")
normalized = _normalize_subagents(subagents_data)
normalized = _normalize_subagents(subagents_data, name)
content = dirty_json.stringify(normalized)
files.write_file(abs_path, content)


def _normalize_subagents(
subagents_data: dict[str, SubAgentSettings]
subagents_data: dict[str, SubAgentSettings],
project_name: str,
) -> dict[str, SubAgentSettings]:
from helpers import subagents

agents_dict = subagents.get_agents_dict()
agents_dict = subagents.get_agents_dict(project_name)

normalized: dict[str, SubAgentSettings] = {}
for key, value in subagents_data.items():
Expand Down
2 changes: 1 addition & 1 deletion helpers/subagents.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def get_available_agents_dict(
project_name: str | None,
) -> dict[str, SubAgentListItem]:
# all available agents
all_agents = get_agents_dict()
all_agents = get_agents_dict(project_name)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

# filter by project settings
from helpers import projects

Expand Down