feat(agent-env-sync): SC-5 renderForInstance is the only writer (#627) #643

Merged
code-lead merged 1 commit from boss/627 into main 2026-05-01 13:30:40 +00:00
Collaborator

Closes #627. renderForInstance is now the sole writer of settings.json::enabledPlugins + extraKnownMarketplaces and .claude.json::mcpServers; the legacy per-dispatch writeInstanceSettings rewrite + rtk-hook helpers are gone, so DB-scope plugin overrides survive. container-reconcile re-renders after every created action; just containers-rebuild shells the new render-agent-env script after each docker run.

Test plan

  • bun x turbo run typecheck clean
  • bun x turbo run test — 4/4 packages green
  • Biome check + format clean (2 pre-existing infos in unrelated files)
  • New unit: instance-scope plugin_binding enabling a plugin not on the type lands in enabledPlugins
  • New unit: instance-scope enabled=false shadows a type-enable
  • New unit: container-reconcile renders after fresh provision + drift recreate, skips on unchanged, and tolerates render failures
Closes #627. `renderForInstance` is now the sole writer of `settings.json::enabledPlugins` + `extraKnownMarketplaces` and `.claude.json::mcpServers`; the legacy per-dispatch `writeInstanceSettings` rewrite + rtk-hook helpers are gone, so DB-scope plugin overrides survive. `container-reconcile` re-renders after every `created` action; `just containers-rebuild` shells the new `render-agent-env` script after each `docker run`. ## Test plan - [x] `bun x turbo run typecheck` clean - [x] `bun x turbo run test` — 4/4 packages green - [x] Biome `check` + `format` clean (2 pre-existing infos in unrelated files) - [x] New unit: instance-scope `plugin_binding` enabling a plugin not on the type lands in `enabledPlugins` - [x] New unit: instance-scope `enabled=false` shadows a type-enable - [x] New unit: container-reconcile renders after fresh provision + drift recreate, skips on unchanged, and tolerates render failures
feat(agent-env-sync): SC-5 renderForInstance is the only writer (#627)
All checks were successful
qa / dockerfile (pull_request) Successful in 4s
qa / qa (pull_request) Successful in 1m34s
7177c7b8d3
Make `renderForInstance` the sole writer of `settings.json::enabledPlugins`
+ `extraKnownMarketplaces` and `.claude.json::mcpServers`. Removes the
legacy per-dispatch `writeInstanceSettings` rewrite (and its rtk-hook
helpers) from `container.ts`, `agent-runner.ts`, and
`docker-container-lifecycle.ts` so DB-scope plugin overrides survive.

`container-reconcile.reconcileOne` now calls `renderForInstance` after
every `created` action (fresh provision or drift recreate) so the new
container boots against the resolved env files. Added a
`render-agent-env [NAME]` CLI + `just` recipe; `just containers-rebuild`
fires it after each `docker run` per AC.

Tests: instance-scope plugin row enabling a plugin not on the type lands
in `enabledPlugins`; instance-scope `enabled=false` shadows a type
enable; container-reconcile renders post-create / post-recreate, skips
on unchanged, and tolerates render failures without aborting the sweep.
reviewer approved these changes 2026-05-01 13:27:48 +00:00
Dismissed
reviewer left a comment

CI green. All SC-5 ACs met:

  • writeInstanceSettings removed from all callers (agent-runner, docker-container-lifecycle, container.ts)
  • renderAfterProvision wired into reconcileOne for both fresh provision and drift recovery
  • render-agent-env.ts background script added and wired into just containers-rebuild (justfile line 548)
  • render-agent-env justfile recipe added
  • Instance-scope plugin shadowing tests added (both directions)
  • Secret resolution test already in file (unchanged section, lines 315-357)
  • Reconcile render-wiring tests cover all four cases (created, recreate, unchanged, failure-tolerant)
CI green. All SC-5 ACs met: - `writeInstanceSettings` removed from all callers (`agent-runner`, `docker-container-lifecycle`, `container.ts`) - `renderAfterProvision` wired into `reconcileOne` for both fresh provision and drift recovery - `render-agent-env.ts` background script added and wired into `just containers-rebuild` (justfile line 548) - `render-agent-env` justfile recipe added - Instance-scope plugin shadowing tests added (both directions) - Secret resolution test already in file (unchanged section, lines 315-357) - Reconcile render-wiring tests cover all four cases (created, recreate, unchanged, failure-tolerant)
reviewer approved these changes 2026-05-01 13:27:54 +00:00
reviewer left a comment

CI green. All SC-5 ACs met: writeInstanceSettings removed from all callers; renderAfterProvision wired into reconcileOne for provision+drift; render-agent-env.ts added and wired into just containers-rebuild; instance-scope plugin shadowing tests added; secret resolution test in unchanged section; reconcile render-wiring tests cover all four cases (created/recreate/unchanged/failure-tolerant).

CI green. All SC-5 ACs met: writeInstanceSettings removed from all callers; renderAfterProvision wired into reconcileOne for provision+drift; render-agent-env.ts added and wired into just containers-rebuild; instance-scope plugin shadowing tests added; secret resolution test in unchanged section; reconcile render-wiring tests cover all four cases (created/recreate/unchanged/failure-tolerant).
code-lead force-pushed boss/627 from 7177c7b8d3
All checks were successful
qa / dockerfile (pull_request) Successful in 4s
qa / qa (pull_request) Successful in 1m34s
to 5e438ec5c4
All checks were successful
qa / dockerfile (pull_request) Successful in 5s
qa / qa (pull_request) Successful in 2m12s
2026-05-01 13:28:20 +00:00
Compare
code-lead deleted branch boss/627 2026-05-01 13:30:40 +00:00
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!643
No description provided.