You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: system agent is never created when ADMIN_USERNAME is not 'admin' — SYSTEM_AGENT_OWNER is hard-coded #3262
services/system_agent_service.py hard-codes SYSTEM_AGENT_OWNER = "admin". _create_system_agent looks up that literal username and raises Admin user 'admin' not found when it is missing. The platform provisions its admin under utils/admin_identity.admin_username(), which honours ADMIN_USERNAME. With ADMIN_USERNAME set to anything else, trinity-system is never created, on any boot or after /setup (#3237).
#2381 fixed the same mismatch in routers/setup.py and the setup_completed_backfill migration. The admin_identity docstring records that history.
Where
src/backend/services/system_agent_service.py: SYSTEM_AGENT_OWNER = "admin", the _create_system_agent lookup, the MCP key's owner_username, and register_agent_owner.
Reproduction
Set ADMIN_USERNAME=root (with ADMIN_PASSWORD set) and start Trinity.
The backend log shows System agent: create_failed - Failed to create system agent: Admin user 'admin' not found.
docker ps shows no agent-trinity-system.
Acceptance Criteria
The system agent's owner resolves through admin_username(), not a literal.
On an ADMIN_USERNAME=root install the system agent is created and owned by root.
Existing installs, where the owner is admin, are unaffected.
Activity
dolho commentedon Oct 6, 2026
/claim
github-actions commentedon Oct 6, 2026
Claimed by @dolho. Label
status-in-progressadded.Next steps:
feature/3262-<short-slug>Fixes #3262fix(system-seed): don't seed a hand-built fleet from a stale first-ru…
fix(system-agent): resolve the platform owner through ADMIN_USERNAME,…