feat(switcher): auto-resume dedicated sessions after a swap
When a legitimate quota hit triggered a swap, killAllPoolSessions tore down the dedicated interactive sessions (ccl-1-conformvault, ccl-2-scanyze) along with the pool, then recreatePoolSessions re-opened them at a bare bash prompt. The operator had to manually re-run CLAUDE_CONFIG_DIR=<target> claude --dangerously-skip-permissions --resume <uuid> after every swap, losing whatever conversation was mid-flight. saveAllSessions only iterates sessions tracked as "working" in state; user-driven dedicated sessions are rarely in that state so their resume UUIDs were never saved. - saveDedicatedUUIDs: capture resume UUID for every configured dedicated session regardless of tracked state, before kill. - relaunchDedicatedSessions(targetHome): after recreate, send a resume command on each dedicated session pointing CLAUDE_CONFIG_DIR at the target account's home. Missing UUID → leave at shell, no blind launch. - isValidResumeUUID hardens against a corrupted resume-id.txt. New TestDedicatedRelaunchAfterSwap verifies end-to-end: pane capture → UUID persisted → resume command sent with the correct CLAUDE_CONFIG_DIR. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
5cad53ac7a
commit
8fdb1937fc
4 changed files with 169 additions and 14 deletions
|
|
@ -4,7 +4,7 @@
|
|||
2026-04-15 19:30:00
|
||||
|
||||
## Version Actuelle
|
||||
0.2.3
|
||||
0.3.0
|
||||
|
||||
## Demande Actuelle
|
||||
Aucune — v0.2.3 shippée, service stable.
|
||||
|
|
@ -20,12 +20,8 @@ Aucune — v0.2.3 shippée, service stable.
|
|||
- [x] Push sur Forgejo `origin/main` (commits `7c5f838` et `62e98cb`)
|
||||
|
||||
## Prochaines Étapes
|
||||
- [ ] **Optionnel** : préserver les sessions dédiées (ccl-1-conformvault,
|
||||
ccl-2-scanyze) lors d'un swap légitime — actuellement `killAllPoolSessions`
|
||||
les tue aussi. Interruption désagréable pour le travail interactif.
|
||||
Options : skip dedicated dans le kill, OU auto-relaunch avec
|
||||
`--resume <uuid>` après kill. Non-bloquant tant que les vrais quota hits
|
||||
sont rares.
|
||||
- [x] ~~préserver les sessions dédiées lors d'un swap légitime~~ — fait en v0.3.0
|
||||
via `saveDedicatedUUIDs` + `relaunchDedicatedSessions`.
|
||||
- [ ] **Optionnel** : telegram alert quand `SwapRequested` est émis pour
|
||||
que l'opérateur soit au courant sans lire les logs. Le `notifier.Telegram`
|
||||
existe déjà — il suffit de câbler.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue