fix(templates): curate the agent template catalog — hide fixtures, order starters first (#1513)#1514
Merged
Merged
Conversation
…er starters first) GET /api/templates returned every directory under config/agent-templates/, so internal test/canary fixtures, demo agents, and the auto-deployed system agent surfaced as real, deployable user templates — undermining onboarding. - Add an explicit `hidden: true` template.yaml flag (not fragile name-matching) on the 7 test/canary fixtures, 2 demo agents, and trinity-system. Filter it in get_local_templates() (the LIST) only — get_local_template() and creation-by-id still resolve hidden templates, so the canary/test harness (canary-fleet.yaml, test_817) is unaffected. - Surface a coerced-int `priority` in both template builders so the router's (priority, display_name) sort actually orders real starters (scout/sage/ scribe, priority 20) ahead of the rest. _coerce_priority() guards against a present-but-null / string / bool value that would otherwise TypeError-500 the endpoint (a GitHub template.yaml is untrusted). - Fix scribe/template.yaml: an unquoted `usage:` value containing `format:` made the whole file invalid YAML, so scribe (a core starter) was silently dropped from the catalog. Quote it. - Remove the broken config/agent-templates/cornelius/ stub (only gitignored .trinity/ hooks, no template.yaml — untracked, already skipped by the scanner). - Templates.vue: render a Starter (local) section so the Templates tab shows the same curated set as CreateAgentModal (was GitHub-only). - Reconcile config/agent-templates/README.md with the hidden set + document the flag; note the catalog behavior in the template-processing feature flow. - Tests: exclusion, single-id survival, priority coercion, router-sort regression, and a real-catalog convention guard (a future unflagged fixture fails CI). Fixes #1513 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Review: ✅ Approve Clean fix for #1513. Highlights:
Verified the live template dir is repo-root Interaction with #1515: cornelius is added there without |
4 tasks
dolho
approved these changes
Jul 8, 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.
Summary
GET /api/templatesno longer surfaces internal test/canary fixtures, demo agents, or the auto-deployed trinity-system agent as real user templates — they're excluded via an explicithidden: truetemplate.yamlflag (not fragile name-matching), while staying creatable-by-id so the canary/test harness is untouched.priority, so the router's(priority, display_name)sort ordersscout/sage/scribe(priority 20) ahead of thedd-*suite.Acceptance criteria (all met)
hidden: true), not name matchingconfig/agent-templates/cornelius/stub removedChanges
src/backend/services/template_service.py—_coerce_priority()helper; surfacepriority+hiddenin_build_local_template,priorityin_build_template; filterhiddeninget_local_templates()(LIST only — single-id + creation-by-id preserved).config/agent-templates/*/template.yaml—hidden: trueon the 7 test/canary fixtures, 2 demo agents, andtrinity-system.config/agent-templates/scribe/template.yaml— quote theusage:value (an unquotedformat:colon made the file invalid YAML, so this core starter was silently dropped from the catalog).src/frontend/src/views/Templates.vue— add a Starter (local) Templates section.config/agent-templates/README.md+docs/memory/feature-flows/template-processing.md— reconcile docs with the hidden set and document the flag.tests/unit/test_local_templates_listing.py— exclusion, single-id survival, priority coercion, router-sort regression, real-catalog convention guard.Notable finds during review
scribewas already absent from the catalog because itstemplate.yamlfailed to parse — fixed.priority: null/"high"wouldTypeErrorthe router sort;_coerce_priorityguards it (with a regression test).cornelius/carried no git-tracked files (its only contents are globally gitignored.trinity/hooks) and never appeared in the catalog (notemplate.yaml) — removed the local artifact; produces no diff.Test plan
pytest tests/unit/test_local_templates_listing.py— 19 passed (11 existing + 8 new)test_data_paths_template_surface,test_deploy_writable_templates(5),test_templates(5 passed / 3 skipped)config/agent-templates/: fixtures excluded,scout/sage/scribepresent and ahead ofdd-*, hidden fixtures still resolve by idFollow-up (deferred, out of scope)
<TemplateCard>component — the new local card markup mirrors the GitHub card; deferred to avoid pullingCreateAgentModalinto a P1 bug fix.Fixes #1513
🤖 Generated with Claude Code