AT-2: Swap cfg.types[t] consumers to getAgentType() #744

Closed
opened 2026-05-02 17:25:01 +00:00 by claude-desktop · 0 comments
Collaborator

Bundle directive

This story ships in one PR with #751 (SVC-2) — both swap consumers in webhook-config.ts and would conflict heavily as separate PRs. The PR closes both (Closes #744 #751).


As a platform engineer, I want every runtime read of cfg.types[t] in apps/server/src to move to getAgentType(t), so that operator overrides on per-type fields (system prompt, model, identity, routing) take effect without a service restart and without re-reading agents.json at runtime.

Acceptance criteria

Removal

  • Grep across apps/server/src shows zero non-builtin-sync.ts / non-test consumers of cfg.types[…].
  • mergeAgent() in webhook-config.ts reads exclusively from getAgentType() — no cfg.types[t] access remains.

Hot fields covered

  • Identity: git_author, git_email, git_name, branch_prefix, forgejo_user, role.
  • Pool gating: dispatchable.
  • Routing: default_assignee, escalation_target, max_escalations_per_day, routes_labels, default_match_labels, reviews_authors, reviews_labels.
  • Architect-only: label_rules, assignee_rules, example_prompts.
  • MCP gating: penpot_mcp.

Container fields placeholder

  • Container fields (container.enabled, credentials_host_dir, image, env, lifecycle, idle_stop_seconds) are read through the joined container row exposed by getAgentType(). Behaviour swap of the actual reconcile path lives in AT-3; AT-2 only removes the cfg read.

Tests

  • Existing dispatch / pool / event-handler / webhook-routing tests pass unchanged.
  • New: a scope='global' override on dev.git_author flips the value used by the next dispatch without a restart.

Out of scope

  • Container reconcile path swap — covered by AT-3.
  • Architect routing UI affordance — covered by AT-6.

References

  • Spec: specs/config-to-db.md § Story AT-2.
  • Bundled with: #751 (SVC-2). Both swap consumers in webhook-config.ts; ship together to avoid merge conflicts on the same file.
## Bundle directive This story ships in **one PR with #751 (SVC-2)** — both swap consumers in `webhook-config.ts` and would conflict heavily as separate PRs. The PR closes both (`Closes #744 #751`). --- As a platform engineer, I want every runtime read of `cfg.types[t]` in `apps/server/src` to move to `getAgentType(t)`, so that operator overrides on per-type fields (system prompt, model, identity, routing) take effect without a service restart and without re-reading `agents.json` at runtime. ## Acceptance criteria ### Removal - [ ] Grep across `apps/server/src` shows zero non-`builtin-sync.ts` / non-test consumers of `cfg.types[…]`. - [ ] `mergeAgent()` in `webhook-config.ts` reads exclusively from `getAgentType()` — no `cfg.types[t]` access remains. ### Hot fields covered - [ ] Identity: `git_author`, `git_email`, `git_name`, `branch_prefix`, `forgejo_user`, `role`. - [ ] Pool gating: `dispatchable`. - [ ] Routing: `default_assignee`, `escalation_target`, `max_escalations_per_day`, `routes_labels`, `default_match_labels`, `reviews_authors`, `reviews_labels`. - [ ] Architect-only: `label_rules`, `assignee_rules`, `example_prompts`. - [ ] MCP gating: `penpot_mcp`. ### Container fields placeholder - [ ] Container fields (`container.enabled`, `credentials_host_dir`, `image`, `env`, `lifecycle`, `idle_stop_seconds`) are read through the joined container row exposed by `getAgentType()`. Behaviour swap of the actual reconcile path lives in AT-3; AT-2 only removes the `cfg` read. ### Tests - [ ] Existing dispatch / pool / event-handler / webhook-routing tests pass unchanged. - [ ] New: a `scope='global'` override on `dev.git_author` flips the value used by the next dispatch without a restart. ## Out of scope - Container reconcile path swap — covered by AT-3. - Architect routing UI affordance — covered by AT-6. ## References - Spec: `specs/config-to-db.md` § Story AT-2. - Bundled with: #751 (SVC-2). Both swap consumers in `webhook-config.ts`; ship together to avoid merge conflicts on the same file.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/claude-hooks#744
No description provided.