SC-10 Migrate agents.json runtime consumers off in-memory config #632

Closed
opened 2026-05-01 10:35:42 +00:00 by claude-desktop · 1 comment
Collaborator

User story

As a platform engineer, I want every code path that reads types[t].plugins, default_system_prompt, system_prompt_template, skill_overrides, caveman.labels, match_labels, default_model, reviews_authors, reviews_labels, wip_soft_limit migrated to the resolver, so that agents.json becomes a one-way factory image (read by builtin-sync only) and the AGENT_CONFIG_DB_ENABLED feature flag can be removed.

Acceptance criteria

Sweep

  • Grep across apps/server/src shows zero non-builtin-sync.ts consumers of the listed fields. Migrate each consumer to its corresponding resolve* call:
    • default_modelagent_type_config row read by the dispatcher (already-partial DB path; finish it).
    • match_labels, reviews_authors, reviews_labels, wip_soft_limit, caveman.labelsagent_type_config rows.
  • apps/server/src/shared/config/agents-config-schema.ts annotates each migrated field with // builtin source for the agent-config DB layer; runtime reads go through the resolver.
  • Feature flag AGENT_CONFIG_DB_ENABLED is removed; the resolver path is the only path.

Docs

  • docs/modules.md reflects the new boot flow.
  • docs/agents-architecture.md documents builtin → global → agent_type → instance resolution and the render-to-disk pipeline.
  • docs/plugins.md documents that agents.json::plugins[] is the factory image only; runtime overrides land via the dashboard.

Tests

  • Existing dispatch / pool / event-handler tests pass against the migrated paths.
  • New integration: a fresh DB + a mutated agents.json boot syncs new builtin rows; an existing agent_type-scope override is preserved across restart.

Out of scope

  • Per-instance overrides UI (SC-11).
  • History viewer (SC-12).

References

  • specs/agent-config-customization.md §Story SC-10
  • apps/server/src/domain/dispatch/pool.tsmatch_labels / wip_soft_limit consumers
  • apps/server/src/domain/workflow/review-loop.ts and webhook-routing.tsreviews_authors / reviews_labels
  • apps/server/src/domain/agent/caveman-gate.tscaveman.labels
  • Depends on SC-1, SC-3, SC-4, SC-5.
## User story As a platform engineer, I want every code path that reads `types[t].plugins`, `default_system_prompt`, `system_prompt_template`, `skill_overrides`, `caveman.labels`, `match_labels`, `default_model`, `reviews_authors`, `reviews_labels`, `wip_soft_limit` migrated to the resolver, so that `agents.json` becomes a one-way factory image (read by `builtin-sync` only) and the `AGENT_CONFIG_DB_ENABLED` feature flag can be removed. ## Acceptance criteria ### Sweep - [ ] Grep across `apps/server/src` shows zero non-`builtin-sync.ts` consumers of the listed fields. Migrate each consumer to its corresponding `resolve*` call: - `default_model` → `agent_type_config` row read by the dispatcher (already-partial DB path; finish it). - `match_labels`, `reviews_authors`, `reviews_labels`, `wip_soft_limit`, `caveman.labels` → `agent_type_config` rows. - [ ] `apps/server/src/shared/config/agents-config-schema.ts` annotates each migrated field with `// builtin source for the agent-config DB layer; runtime reads go through the resolver`. - [ ] Feature flag `AGENT_CONFIG_DB_ENABLED` is removed; the resolver path is the only path. ### Docs - [ ] `docs/modules.md` reflects the new boot flow. - [ ] `docs/agents-architecture.md` documents `builtin → global → agent_type → instance` resolution and the render-to-disk pipeline. - [ ] `docs/plugins.md` documents that `agents.json::plugins[]` is the factory image only; runtime overrides land via the dashboard. ### Tests - [ ] Existing dispatch / pool / event-handler tests pass against the migrated paths. - [ ] New integration: a fresh DB + a mutated `agents.json` boot syncs new builtin rows; an existing `agent_type`-scope override is preserved across restart. ## Out of scope - Per-instance overrides UI (SC-11). - History viewer (SC-12). ## References - `specs/agent-config-customization.md` §Story SC-10 - `apps/server/src/domain/dispatch/pool.ts` — `match_labels` / `wip_soft_limit` consumers - `apps/server/src/domain/workflow/review-loop.ts` and `webhook-routing.ts` — `reviews_authors` / `reviews_labels` - `apps/server/src/domain/agent/caveman-gate.ts` — `caveman.labels` - Depends on **SC-1**, **SC-3**, **SC-4**, **SC-5**.
Collaborator

🦵 @charles kicked the queue — re-running implement on @boss.

🦵 @charles kicked the queue — re-running implement on @boss.
Sign in to join this conversation.
No project
No assignees
2 participants
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#632
No description provided.