Skip to content

refactor(agents): read edition agent names through the one catalog reader - #16448

Merged
bolichen97 merged 1 commit into
mainfrom
refactor/edition-agent-names-one-reader
Oct 3, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
refactor/edition-agent-names-one-reader

Conversation

@bolichen97

@bolichen97 bolichen97 commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: a single function reads the edition's agent catalog.

#16410 added config.loader._edition_agent_names. It repeats agent_discovery._with_edition_agents line for line: the same safe_context_call(... builtin_agents() ...) and the same name filter. If the seam's failure handling or row validation changes, one copy will drift, and the healer and the agent listing will disagree on which agents exist. The First Principles review on #16410 raised this (advisory).

Why it matters

The healer decides whether to rewrite the owner's default_agent. Its view of which agents exist has to stay the listing's view.

Not a goal

  • No behaviour change: the names and the fail-closed fallback are the same.

What changed (motivation → approach → change)

_edition_agent_names now returns {agent.name for agent in _with_edition_agents([])}, through a deferred import (agent_discovery imports this package's paths at load time). The duplicated seam call and filter are removed.

Backwards compatibility

Compatible: same result for every input.

Tests

  • test_config_loader.py (including test_a_removed_file_whose_agent_the_edition_supplies_is_not_reset), test_agent_execution_catalog.py and the test_agent_discovery* files: 735 passed.
  • Mutation: with _edition_agent_names returning nothing, the edition test fails, so the routed reader is what that test exercises.
  • The baselined black and subprocess-encoding gates, isort, flake8, mypy (2079 files), comment-history, agent-SDK boundary and docs-lint gates pass.

Manual verification

N/A: a refactor covered by the tests above.

Related Issues

Part of #16409. Follow-up to #16410.

Pattern harvest

Not generalizable: a single duplicated seam read, removed.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@bolichen97
bolichen97 requested a review from a team as a code owner October 3, 2026 08:58
@bolichen97
bolichen97 requested a review from iamwhatever October 3, 2026 08:58
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 3, 2026
@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 31110605e3b681a5f6728891ffda3682ccd8a03c — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

One thing to check: rows that AgentInfo(...) rejects used to count as existing for the healer, and now they don't, so "same result for every input" isn't strictly true.

Watch

  • Before this change, _edition_agent_names kept any dict row with a non-empty string name. _with_edition_agents also skips rows whose AgentInfo(...) construction raises (except Exception: logger.debug("Skipping malformed edition agent row…")). Now, if an edition row has a valid name but a field that fails construction, the healer treats a default_agent that names it as dangling and resets it. This matches what the listing shows, which is the PR's goal, but the description's "No behaviour change" doesn't say so.
    Clears when: the description admits the malformed-row case as an intended alignment, or a test pins that a construction-failing row's name is excluded from the healer

[DESIGN-REVIEWED] 3111060

Description read

[DESCRIPTION-READ] c6c0710cac9b6c17178b9358f76a67a171654a9dab60ceead964cb7db5081df3

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 31110605e3b681a5f6728891ffda3682ccd8a03c — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: PASS

Check one thing: an edition row that AgentInfo(...) rejects is now dropped from the healer's names. The description still says "same result for every input."

What this change ships

Inventory (2 items) — 2 justified

Intent: keep the default-agent healer's view of which edition agents exist the same as the agent listing's view. This is a FIX for duplicated code, framed as a refactor.

  1. The healer now reads edition agent names through agent_discovery._with_edition_agents and no longer keeps its own copy of the seam call and name filter. After this change, builtin_agents() is called in exactly one place in src/ (grepped builtin_agents\(\); the other hit is a comment in dashboard/handlers/agents.py). — justified
  2. An edition row that names an agent but fails AgentInfo construction (agent_discovery.py:1862) no longer counts as an existing agent for the healer. The PR presents the shared row validation as the purpose, so it is the fix, not a separate addition. — justified

[FIRST-PRINCIPLES-REVIEWED] 3111060

Description read

[DESCRIPTION-READ] 36ef35da6a89347788a3a9fd9387d035f51a1604bc19f7d0c81c9027fed2bafa

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 31110605e3b681a5f6728891ffda3682ccd8a03c — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 3111060

Verdict parsed from the review's SHA-scoped output markers for commit 31110605e3b681a5f6728891ffda3682ccd8a03c.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 31110605e3b681a5f6728891ffda3682ccd8a03c: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 31110605e3b681a5f6728891ffda3682ccd8a03c and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 3111060

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 31110605e3b681a5f6728891ffda3682ccd8a03c: <one-sentence reason>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 3, 2026
…ader

The default-agent healer (#16410) read the edition's agent catalog with its own
copy of the seam call and name filter that agent_discovery._with_edition_agents
already performs. It now takes the names from that function, so a change to
the seam's failure handling or row validation reaches the healer and the agent
listing together.
@bolichen97
bolichen97 force-pushed the refactor/edition-agent-names-one-reader branch from d67e74d to 3111060 Compare October 3, 2026 11:42
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 3, 2026
@bolichen97
bolichen97 merged commit 296969b into main Oct 3, 2026
106 of 107 checks passed
@bolichen97
bolichen97 deleted the refactor/edition-agent-names-one-reader branch October 3, 2026 12:40
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 3, 2026
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