Files
PaperClipAI/packages
Devin FoleyandPaperclip cc2e47f42b fix(codex-local): backfill auth for already-isolated codex_local homes
Phase 1 seeds Paperclip-managed CODEX_HOME at execute time, which fixes
new strandings. Agents already carrying a persisted (but unseeded)
per-agent CODEX_HOME from the #8272 isolation guard (e.g. CTO) only
recover the next time they run. Add a proactive startup backfill so a
stranded agent's auth.json is seeded without waiting to run.

- Add idempotent reconcileManagedCodexHome to the codex-local adapter,
  reusing the Phase 1 managed-home detection (isManagedCodexHomePath) and
  seeding (seedManagedCodexHome). Genuine external/user CODEX_HOME
  overrides are left untouched; a home with valid auth is a no-op.
- Add a server startup reconciliation that enumerates codex_local agents
  and seeds any persisted managed home. Only literal (plain) env values
  are used, so a secret-bound OPENAI_API_KEY is never written verbatim
  into auth.json (falls back to the subscription symlink).
- Wire the reconciliation into server boot alongside the other
  reconcile*OnStartup steps. Safe to re-run on every boot.

Adds unit tests for the reconcile primitive (seed/no-op/external/api-key)
and the server service (status accounting, secret-binding safety).

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-06-20 14:42:57 -07:00
..