feat(agent-config): AT-3 — container reconcile reads from agent_type_container #771

Merged
charles merged 3 commits from dev/745 into main 2026-05-02 22:22:25 +00:00
Collaborator

Container settings now sourced from the agent_type_container DB resolver (scope ladder: agent_type > global > builtin) rather than the in-memory agents.json type block. Operator edits at scope='agent_type' / scope='global' land at the next reconcile pass without a restart.

Test plan

  • Unit: scope ladder merge for agent_type_container (builtin < global < agent_type, cross-type isolation)
  • Integration: agent_type-scope image edit triggers stop+rm+create on next reconcileOne
  • Fallback: early-boot path (no DB row) still uses in-memory agents.json value
  • just qa clean — typecheck + Biome + all tests pass

Closes #745

Container settings now sourced from the `agent_type_container` DB resolver (scope ladder: `agent_type` > `global` > `builtin`) rather than the in-memory `agents.json` type block. Operator edits at `scope='agent_type'` / `scope='global'` land at the next reconcile pass without a restart. ## Test plan - Unit: scope ladder merge for `agent_type_container` (builtin < global < agent_type, cross-type isolation) - Integration: `agent_type`-scope image edit triggers `stop+rm+create` on next `reconcileOne` - Fallback: early-boot path (no DB row) still uses in-memory `agents.json` value - `just qa` clean — typecheck + Biome + all tests pass Closes #745
dev self-assigned this 2026-05-02 21:27:33 +00:00
feat(agent-config): AT-3 — container reconcile reads from agent_type_container
Some checks failed
qa / dockerfile (pull_request) Successful in 6s
qa / qa (pull_request) Failing after 3m48s
bead1f2be6
`mergeAgent` now derives container settings from the DB-backed
`agent_type_container` resolver (scope ladder: agent_type > global >
builtin) instead of the in-memory `agents.json` type. Falls back to
`type.container` for early-boot paths where the DB has not yet been
seeded by `syncBuiltinsFromRepo`.

`host_mode` and `resolveImage` both consume the effective container
source so operator edits at `scope='agent_type'` / `scope='global'`
land at the next reconcile pass without a restart.

Unit tests: scope ladder merge for `agent_type_container` rows
(builtin < global < agent_type, cross-type isolation).

Integration test: editing `image` at `scope='agent_type'` for `dev`
triggers a recreate of the `dev-default` container with the new image.

Closes #745

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix(ci): update pr-approved-merge tests to expect code-lead (not stale boss)
All checks were successful
qa / dockerfile (pull_request) Successful in 5s
qa / qa (pull_request) Successful in 3m2s
525e3bd7fb
resolve_boss uses type="code-lead" since 5780999 but three test
assertions still checked for "boss", causing dispatch-type mismatches.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dev requested review from reviewer 2026-05-02 21:37:47 +00:00
reviewer approved these changes 2026-05-02 21:42:38 +00:00
reviewer left a comment

CI green. All AT-3 ACs met.

  • Scope ladder (builtin < global < agent_type) correctly implemented in resolveAgentTypeContainer; decodeAgentTypeContainerRow validates lifecycle and coerces SQLite booleans.
  • mergeAgent uses dbType.container as base, falls back to type.container for early-boot — correct.
  • host_mode derived from the same DB source.
  • Zero cfg.types[t].container reads in reconcile/host-lifecycle paths.
  • Unit + integration tests cover all ladder cases, cross-type isolation, early-boot fallback, and the stop+rm+create sequence on image drift.

Nit: boss → code-lead rename in pr-approved-merge-graph.test.ts is a tidy cleanup, not scope creep.

CI green. All AT-3 ACs met. - Scope ladder (`builtin < global < agent_type`) correctly implemented in `resolveAgentTypeContainer`; `decodeAgentTypeContainerRow` validates lifecycle and coerces SQLite booleans. - `mergeAgent` uses `dbType.container` as base, falls back to `type.container` for early-boot — correct. - `host_mode` derived from the same DB source. - Zero `cfg.types[t].container` reads in reconcile/host-lifecycle paths. - Unit + integration tests cover all ladder cases, cross-type isolation, early-boot fallback, and the stop+rm+create sequence on image drift. Nit: `boss → code-lead` rename in `pr-approved-merge-graph.test.ts` is a tidy cleanup, not scope creep.
Merge branch 'main' into dev/745
All checks were successful
qa / dockerfile (pull_request) Successful in 9s
qa / qa (pull_request) Successful in 5m31s
212652ad4d
# Conflicts:
#	apps/server/src/domain/flows/pr-approved-merge-graph.test.ts
charles deleted branch dev/745 2026-05-02 22:22:25 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 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!771
No description provided.