Skip to content

Boot-time legacy-config auto-migrate doesn't persist — gateway silent crash loop until manual 'argent doctor --fix' #446

Description

@webdevtodayjason

What happened (live on Jason's main install, 2026-06-11)

Gateway (installed 2026.6.10-dev.1, LaunchAgent ai.argent.gateway) was down all morning. Operator-visible symptom: "I started Argent and it looked like the gateway was down" — Argent.app + dashboard servers up, nothing listening on the configured gateway port (18789), launchd last exit code = 1.

~/.argentos/logs/gateway.log shows the same sequence repeating every boot attempt:

◇ Legacy config keys detected
│  - alwaysOnLoop: alwaysOnLoop was removed; health checks now run directly in the gateway (auto-migrated on load).
◇ Argent repairs
│  Removed deprecated config key: alwaysOnLoop.
◇ Argent doctor
│  Run "argent doctor --fix" to apply legacy migrations.

…while ~/.argentos/argent.json still contained alwaysOnLoop — the boot-time auto-migrate (src/config/legacy.migrations.part-3.ts remove-alwaysOnLoop, ~line 191) mutates the in-memory config and reports "Removed", but the result is never written back to disk, and the process exits 1. Next launch repeats identically. The loop also bloated gateway.log to 755MB.

Manual argent doctor --fix persisted the removal (verified key gone, backup written) and the gateway came up clean immediately after.

Why this is worse than a config nit

  1. The log says the repair happened. "Removed deprecated config key" is a lie at the persistence layer — operator (and any agent reading logs) concludes the key can't be the problem.
  2. Exit 1 with zero operator surfacing. Argent.app gave no indication the gateway was crash-looping; the advice to run doctor --fix lives only in a 755MB log file. This is exactly the Argent runtime stability sweep — subagent dispatch, worker lifecycle, model routing #423 class C gap (runtime degradation surfacing).

Wanted (either is fine, both is better)

  • Boot-time auto-migrate persists what it migrated (atomic write + .bak, same as doctor --fix), so "auto-migrated on load" is true; OR boot treats legacy keys as non-fatal and proceeds with the in-memory migrated config instead of exiting 1.
  • If boot still refuses to start for any config reason: surface it to the operator (app banner / argent CLI status / dashboard), not just the log.

Repro

Add "alwaysOnLoop": {} to ~/.argentos/argent.json, start the gateway via LaunchAgent, observe crash loop + log claiming removal.

Related: #423 (degradation surfacing class).

🤖 Filed from a live diagnosis with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions