Summary
Priority: P0
Replace the fixed three-second amp top --stream-jsonl restart loop with capped exponential backoff and jitter.
The current loop recovers quickly, but a persistent configuration, authentication, or compatibility failure can cause the plugin to launch and log a new Amp process every three seconds indefinitely.
Proposed behavior
- Keep the initial status launch immediate.
- Increase the retry delay after consecutive failures.
- Apply jitter so multiple plugin instances do not retry in lockstep.
- Cap the maximum delay so recovery remains automatic.
- Reset the failure count only after a valid live snapshot, or after a clearly defined stable period.
- Cancel pending retries when monitoring is paused or the plugin shuts down.
- Preserve the current fail-closed behavior while disconnected or receiving incompatible snapshots.
- Surface retry attempt and next-delay information to diagnostics without making normal logs noisy.
Suggested defaults to validate during implementation:
- initial delay: 3 seconds;
- multiplier: 2;
- maximum delay: 60 seconds; and
- bounded/full jitter.
Acceptance criteria
Summary
Priority: P0
Replace the fixed three-second
amp top --stream-jsonlrestart loop with capped exponential backoff and jitter.The current loop recovers quickly, but a persistent configuration, authentication, or compatibility failure can cause the plugin to launch and log a new Amp process every three seconds indefinitely.
Proposed behavior
Suggested defaults to validate during implementation:
Acceptance criteria
stop()reliably cancels every pending retry.