Commit c858b6e started writing paired_session_task:<folder> keys into
router_state, but the startup check only allowed last_seq/last_agent_seq.
The first restart after those keys existed (2026-10-03 05:11) exited with
code 78 and crash-looped ejclaw.service for 11 minutes.
- Keep the allowed keys/prefixes in one list in src/db/router-state.ts and
use it for both the startup check and setRouterStateInDatabase, so an
unregistered key fails on its first write and in tests instead of at the
next startup.
- paired-session-binding imports the prefix constant instead of redefining it.
- Regression tests: app-written keys survive a re-init; unregistered keys are
rejected on write.
- Add the incident report (docs/fix-2026-10-03-router-state-startup.md).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>