Skip to content

refactor(agents): retire the vestigial agent type taxonomy (#2104) - #2115

Merged
vybe merged 3 commits into
devfrom
feature/2104-retire-agent-type
Aug 12, 2026
Merged

vybe merged 3 commits into
devfrom
feature/2104-retire-agent-type

Conversation

@trinity-ability

Copy link
Copy Markdown
Contributor

Summary

  • Retires the free-text agent type field (default business-assistant) end-to-end — models, all five creation/recreate writers (trinity.agent-type label + AGENT_TYPE env, read by nothing), API/MCP/WS response surfaces, and every display surface. No deprecation window per the issue.
  • The existing fleet cleans up with zero forced recreates: stale baked labels lose their last reader, and public-link titles now fall back to the owner-set display label → slug (never the taxonomy value a template controlled — a small anonymous-visitor spoof surface removed).
  • Permissions rows replace the [type] suffix with the canonical slug whenever a display label hides it; the skill-runner tile keys on the fixed trinity-skill-runner name; the enterprise provisioner's type= kwarg stays inert (Pydantic ignore — pinned by test) until its private-repo follow-up drops it.
  • template.yaml type: remains parseable but ignored (existing templates keep working — proven by the recreate test fixture); the always-null agent_type audit field (typo for type) is dropped.

Changes

  • Backend: models.py (both fields), crud.py (env/label/config-yaml/local-template mutation + the agent_created broadcast — a reader inside the creation try-block that unit tests can't see because ws_manager is nulled), lifecycle.py, deploy.py, system_agent_service.py, cornelius_agent_service.py, docker_service.py, agent_files.py (3 fallbacks + a strip of type from older base images' proxied /info responses), public.py, avatar.py, ops.py (both fleet dicts), agents.py (audit + container-less fallback), permissions.py (the payload feeding the Permissions tab)
  • Frontend: PermissionsPanel.vue (slug-when-label-differs via hasDistinctLabel), InfoPanel.vue, AgentTile.vue, MobileAdmin.vue (+ orphaned CSS), stores/network.js
  • MCP server: create_agent param removed, Agent/AgentConfig/TemplateInfo interfaces, tool descriptions; list/get responses lose the field via passthrough
  • Agent server: info.py stops returning type (belt; the backend strip covers un-rebuilt images)
  • Docs: CLAUDE.md label list, user-docs retirement note (tags are the classification mechanism), 7 feature flows, learnings entry
  • Tests: new tests/unit/test_2104_agent_type_retired.py (Pydantic ignore contract, schema, stale-label tolerance, source-level residue guard over 4 trees) + test_start_agent_skip_inject.py converted to negative assertions; registered in tests/registry.json

Consumer note (no backward compat, per issue)

type leaves /api/agents, /api/agents/{name} (incl. the recovered-agent fallback), /api/agents/{name}/info, the permissions payload, ops fleet-status, the agent_created WS event, and MCP list_agents/get_agent. Cross-repo: grep trinity-ops-agent for readers before release; include in release notes.

Test Plan

  • pytest tests/unit/test_2104_agent_type_retired.py — 5/5 (incl. residue guard that caught two comment stragglers during development)
  • Impacted suites: test_start_agent_skip_inject + test_runtime_label_fast_path + test_1811_recovery_container_parity (env-parity guard) + test_ent89 green; test_1484_create_agent_characterization 40/40
  • MCP server: tsc --noEmit clean, 236/236 tests
  • Frontend production build clean
  • Known pre-existing: 3 test_2006_deploy_residue failures when co-scheduled with test_start_agent_skip_inject in one process — reproduced identically on clean dev (randomized-suite stub-leak class), unrelated to this diff

Fixes #2104

🤖 Generated with Claude Code

The free-text agent `type` (default "business-assistant") predates tags and
carried no behavior — the github: create path never populated it, so nearly
every agent wore the stale default on the Permissions tab, the info chip, and
even public-link titles. Remove it end-to-end, no deprecation window:

- Models: AgentConfig.type and AgentStatus.type deleted; a legacy `type=`
  kwarg (enterprise skill-runner provisioner) is silently ignored by Pydantic.
- Writers: creation, recreate-from-nothing, system-agent, Cornelius and deploy
  paths no longer bake the trinity.agent-type label or AGENT_TYPE env (read by
  nothing); SYSTEM_AGENT_TYPE / CORNELIUS_TYPE constants dropped.
- Readers: /api/agents, /api/agents/{name}/info (incl. a strip of the field
  from older base images' proxied responses), permissions payload, ops fleet
  dicts, the agent_created WS broadcast, and the container-less fallback all
  stop emitting it; avatar existence-map keys on names.
- Public links fall back to the owner-set display label then the slug — the
  stale baked label is never rendered, so the existing fleet cleans up with
  zero forced recreates.
- UI: Permissions rows show the canonical slug when a display label hides it
  (replacing the [type] suffix); InfoPanel chip and MobileAdmin badge removed;
  the skill-runner tile keys on the fixed trinity-skill-runner name.
- MCP: create_agent param, Agent/AgentConfig/TemplateInfo interfaces and tool
  descriptions updated; list/get responses lose the field via passthrough.
- template.yaml `type:` stays parseable but ignored; the always-null
  agent_type audit field (a typo for `type`) is dropped.
- Guard: tests/unit/test_2104_agent_type_retired.py pins the ignore contract,
  the schema, stale-label tolerance, and a source-level residue scan so the
  taxonomy cannot silently re-enter.

Fixes #2104

Co-Authored-By: Claude Fable 5 <[email protected]>
@github-actions

Copy link
Copy Markdown

⚠️ Nightly unit-suite check skipped — merge conflict against dev.

Resolve by running git merge dev locally and pushing the result. The next nightly run will re-test once the conflict is gone.

trinity-ability and others added 2 commits August 12, 2026 09:16
# Conflicts:
#	docs/memory/learnings.md
#	tests/registry.json
test_resolvable_template_still_loads asserted the retired `type` field is
projected onto AgentConfig — the sixth unmapped reader of the taxonomy
(the sweep found five; this one hid in a test the issue never mapped).
The fixture keeps `type: research-agent` deliberately: it now proves a
legacy template carrying `type:` stays loadable with the field inert.

Co-Authored-By: Claude Fable 5 <[email protected]>

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Validated via /validate-pr: churn-file conflicts vs dev resolved (registry.json rebuilt from stages, 175 unique entries; both learnings entries kept). CI's regression diff caught a sixth unmapped reader of the retired field (test_1793 asserting type projection) — fixed to the PR's own inertness contract, full suite green on re-run. Security battery clean; 7 feature-flows + user docs updated; residue-guard test present. 14/14 targeted unit tests pass locally.

@vybe
vybe merged commit 9ebf5c6 into dev Aug 12, 2026
24 checks passed
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.

2 participants