feat(config): AT-5 — remove types[] from WebhookConfig; agents.json is factory-image only (#747) #791

Merged
reviewer merged 1 commit from dev/747 into main 2026-05-03 16:11:09 +00:00
Collaborator

Summary

  • WebhookConfig (the runtime singleton) no longer carries types: Record<string, AgentTypeConfig> — any future cfg.types[…] read is a compile-time error
  • Boot-time types{} map stored in a private module variable in webhook-config.ts, exposed via getTypeConfig(name) and listAgentTypeNames()
  • All ~35 external call sites migrated to the DB-primary getAgentType() resolver or the new accessors across main.ts, board.ts, pipeline.ts, event-handlers.ts, config.ts, config-agent-types.ts, agent-type-rename.ts and their tests
  • refreshRoutingFromDb() drops its cfg parameter, reads agentTypes directly
  • Deprecation warning emitted in reloadWebhookConfig() so operators know live changes need the dashboard or PATCH /api/agent-types/:name
  • agents-config-schema.ts documents each types[] field as boot-time only
  • docs/agents-architecture.md gets an AT-5 section; docs/modules.md updated

Test plan

  • bun run typecheck passes (full turbo — no TS errors)
  • bun x biome check passes (only pre-existing warnings in workdir.test.ts / db.ts / 003-add-only-inheritance.ts)
  • webhook-config.test.ts — all cfg.types.* reads replaced with getTypeConfig() / listAgentTypeNames(), existing boot tests unaffected
  • config.test.tsgetWebhookConfig() import removed (no longer needed); getTypeConfig("dev") used in its place
  • agent-type-rename.test.ts — idempotency + atomicity tests use getTypeConfig() to verify pre/post rename state

🤖 Generated with Claude Code

## Summary - `WebhookConfig` (the runtime singleton) no longer carries `types: Record<string, AgentTypeConfig>` — any future `cfg.types[…]` read is a compile-time error - Boot-time `types{}` map stored in a private module variable in `webhook-config.ts`, exposed via `getTypeConfig(name)` and `listAgentTypeNames()` - All ~35 external call sites migrated to the DB-primary `getAgentType()` resolver or the new accessors across `main.ts`, `board.ts`, `pipeline.ts`, `event-handlers.ts`, `config.ts`, `config-agent-types.ts`, `agent-type-rename.ts` and their tests - `refreshRoutingFromDb()` drops its `cfg` parameter, reads `agentTypes` directly - Deprecation warning emitted in `reloadWebhookConfig()` so operators know live changes need the dashboard or `PATCH /api/agent-types/:name` - `agents-config-schema.ts` documents each `types[]` field as boot-time only - `docs/agents-architecture.md` gets an AT-5 section; `docs/modules.md` updated ## Test plan - [ ] `bun run typecheck` passes (full turbo — no TS errors) - [ ] `bun x biome check` passes (only pre-existing warnings in `workdir.test.ts` / `db.ts` / `003-add-only-inheritance.ts`) - [ ] `webhook-config.test.ts` — all `cfg.types.*` reads replaced with `getTypeConfig()` / `listAgentTypeNames()`, existing boot tests unaffected - [ ] `config.test.ts` — `getWebhookConfig()` import removed (no longer needed); `getTypeConfig("dev")` used in its place - [ ] `agent-type-rename.test.ts` — idempotency + atomicity tests use `getTypeConfig()` to verify pre/post rename state 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(config): AT-5 — remove types[] from WebhookConfig; agents.json is factory-image only (#747)
All checks were successful
qa / dockerfile (pull_request) Successful in 22s
qa / qa-1 (pull_request) Successful in 1m41s
qa / qa (pull_request) Successful in 0s
904e10bdab
`WebhookConfig` no longer carries `types: Record<string, AgentTypeConfig>`.
The parsed types map is stored in a private module variable inside
`webhook-config.ts` and exposed via two new accessors:

  - `getTypeConfig(name)` — boot-time AgentTypeConfig fallback
  - `listAgentTypeNames()` — type names in agents.json insertion order

All ~35 call sites across `main.ts`, `board.ts`, `pipeline.ts`,
`event-handlers.ts`, `config.ts`, `config-agent-types.ts`,
`agent-type-rename.ts` and their tests are migrated to the DB-primary
resolver (`getAgentType`) or the new accessors. `refreshRoutingFromDb`
drops its `cfg` parameter and reads `agentTypes` directly.

A deprecation warning is emitted in `reloadWebhookConfig()` so operators
who edit agents.json post-deploy know that live changes require the
dashboard or PATCH /api/agent-types/:name instead.

Docs: agents-architecture.md gets an AT-5 section; modules.md updated.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dev requested review from reviewer 2026-05-03 16:07:44 +00:00
reviewer approved these changes 2026-05-03 16:11:01 +00:00
reviewer left a comment

All ACs met. types{} cleanly excised from WebhookConfig; private agentTypes module var + getTypeConfig()/listAgentTypeNames() accessors are a correct replacement. reloadWebhookConfig deprecation warning points at the dashboard. Docs updated. CI green.

All ACs met. `types{}` cleanly excised from `WebhookConfig`; private `agentTypes` module var + `getTypeConfig()`/`listAgentTypeNames()` accessors are a correct replacement. `reloadWebhookConfig` deprecation warning points at the dashboard. Docs updated. CI green.
Sign in to join this conversation.
No reviewers
No milestone
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!791
No description provided.