Agent registry: table, facade, CRUD + card UI (TIGER-151, steps 1–2) - #275
Merged
Merged
Conversation
…tep 1) TigerAgent was a singleton — one provider/model/key in the tiger.agent.* config tier. This adds the persistence + facade foundation for many agents per org so TigerRoundtable can seat REGISTERED agents rather than minting its own. - migration 0050: `agent` table (org-scoped, is_default marks the resolved one, api_key_enc stored encrypted). No data is copied — see below. - Tiger_Model_Agent: defaultForOrg (org default, then global), allForOrg, findForOrg, setDefault (one default per scope, transactional). - Tiger_Agent: default()/get()/all()/reset(); provider()/model()/apiKey()/ isEnabled() now read through the DEFAULT agent, memoized per request. Back-compat is exact: an EMPTY registry (or a DB not yet booted) falls back to the legacy tiger.agent.* config keys, so an install that never opens the new UI behaves as the old singleton did. The first save in the settings screen (step 2) writes the real Default row. mode_max stays an install-wide governance setting. Bumps core 1.8.3 -> 1.9.0 (new feature). Full suite green (2371 tests). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L8p9pLJ3DFstG3xZuh2QgZ
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L8p9pLJ3DFstG3xZuh2QgZ
The settings screen becomes a registry: a card per agent (name, persona, provider, model, BYO key), Add Agent to append one, per-card Save/Delete, and one default radio across the cards. While the registry is empty the screen shows one seed card prefilled from the legacy default, so the admin's first Save writes the real Default row (the singleton -> registry hand-off from step 1). - Agent_Service_Agents: list/save/delete. Write-only key (encrypted, never returned; blank field keeps the stored secret); one-default-per-org invariant (first create forced default; setting one moves it; deleting the default promotes a survivor; deleting the last returns to the legacy fallback). Admin+. - Agent_Form_Agent (name required; provider validated in the service). - Agent_Service_Settings::mode() — saves ONLY the install-wide auto-mode ceiling, so it no longer clobbers the legacy config keys the registry falls back to. - AdminController + admin/index.phtml + _agent-card.phtml partial (Add Agent, per-card model live-list, connected badge, delete-with-confirm). - ACL: Agent_Service_Agents granted admin+. Strings in all 7 locales. Tests: AgentsServiceTest (6) + updated AdminControllerTest for the registry view model; view smoke-rendered. Full suite green (2377 tests). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L8p9pLJ3DFstG3xZuh2QgZ
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.
What
The multi-agent registry (TIGER-151), steps 1 and 2. TigerAgent was a singleton — one provider/model/key in the
tiger.agent.*config tier. This makes it a registry: an org registers many named agents, each with its own persona, provider, model and BYO key, one marked default — the foundation for TigerRoundtable to seat registered agents (step 3) rather than minting its own.Step 1 — persistence + facade
migrations/0050_create_agent.php— theagenttable: org-scoped,is_defaultmarks the resolved agent,api_key_encencrypted, per-agentpersona/provider/model/enabled.Tiger_Model_Agent—defaultForOrg(org default → global fallback),allForOrg,findForOrg,setDefault(one default per scope, transactional).Tiger_Agent—default()/get()/all()/reset();provider()/model()/apiKey()/isEnabled()read through the default agent, memoized per request.Step 2 — CRUD + UI
Agent_Service_Agents—list/save/delete. Write-only key (encrypted, never returned; blank field keeps the stored secret). One-default-per-org invariant: first create is forced default; setting one moves it; deleting the default promotes a survivor; deleting the last returns to the legacy fallback. Admin+.Agent_Form_Agent;Agent_Service_Settings::mode()saves only the install-wide auto-mode ceiling (so it no longer clobbers the legacy config keys the registry falls back to).Back-compat (exact)
No data is migrated. An empty registry falls back to the legacy
tiger.agent.*config keys, so an install that never opens the new UI behaves as the old singleton. The screen seeds one card from that legacy default, so the admin's first Save writes the real Default row and the fallback stops mattering.mode_maxstays install-wide governance.Tests
AgentRegistryTest(7) +AgentsServiceTest(6) + updatedAdminControllerTest; the card view is smoke-rendered through a realZend_View.IntegrationTestCaseresets the facade memo between tests. Full suite green: 2377 tests. Bumps core 1.8.3 → 1.9.0.Next
🤖 Generated with Claude Code
https://claude.ai/code/session_01L8p9pLJ3DFstG3xZuh2QgZ