fix(dispatcher+watcher): never auto-dispatch into dedicated sessions
Observed: tasks from filesecure/.agent-queue/inbox and SecuScan/ .agent-queue/inbox were being routed into ccl-1-conformvault and ccl-2-scanyze whenever those sessions happened to be idle. Those are the operator's manual interactive Claude sessions, not dispatch targets — the auto-dispatch was (a) hijacking a Claude instance the operator was using and (b) triggering /exit via the watcher's completion path when the side-task finished, kicking the operator out mid-conversation. findFreeSession was iterating Pool.Dedicated before the autonomous pool, so any idle dedicated session was the first candidate. - Dispatcher.findFreeSession: remove the Dedicated loop entirely. Auto-dispatch is now pool-only (ccl-auto-11..20). - Watcher.completeSession: defense-in-depth — even if a dedicated session ever ends up in "working" state, it is no longer /exit'd; just marked idle. Pool /exit behaviour unchanged (context recycle). - Tests: new TestFindFreeSessionSkipsDedicated proves the routing; 3 existing tests rewritten to use the autonomous pool instead of relying on Dedicated as a fake pool. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
6b109ed1bc
commit
4cbdcf143a
4 changed files with 136 additions and 29 deletions
62
VERSION.md
62
VERSION.md
|
|
@ -1,4 +1,64 @@
|
|||
# Version actuelle : 0.3.2
|
||||
# Version actuelle : 0.3.4
|
||||
|
||||
## [0.3.4] - 2026-04-16
|
||||
**Type:** Patch — Dispatcher ne route JAMAIS vers les sessions dédiées
|
||||
|
||||
### Corrigé
|
||||
- **Cause racine** (suite au symptôme v0.3.3) : le dispatcher parcourait
|
||||
`config.Pool.Dedicated` EN PREMIER dans `findFreeSession`, donc les tâches
|
||||
des inboxes `filesecure/` (conformvault) et `SecuScan/` (scanyze) étaient
|
||||
routées vers `ccl-1-conformvault` / `ccl-2-scanyze` quand elles étaient
|
||||
idle — alors que ces sessions sont réservées au travail interactif
|
||||
manuel d'Olivier.
|
||||
- Le watcher envoyait ensuite `/exit` quand la tâche se terminait,
|
||||
éjectant Olivier de sa session Claude en cours.
|
||||
|
||||
### Modifié
|
||||
- `Dispatcher.findFreeSession` : n'itère plus `Pool.Dedicated`. L'auto-dispatch
|
||||
utilise **uniquement** le pool autonome `StartIndex..StartIndex+Max`.
|
||||
- `/exit` sur le pool reste le comportement voulu (recycle Claude avec
|
||||
contexte propre pour le prochain dispatch).
|
||||
- Le garde v0.3.3 dans `watcher.completeSession` (pas de `/exit` sur
|
||||
dédié) reste en place comme défense en profondeur pour tout edge case
|
||||
où un dédié se retrouverait marqué "working".
|
||||
|
||||
### Tests
|
||||
- ✅ `TestFindFreeSessionSkipsDedicated` (nouveau) : vérifie qu'un dédié
|
||||
idle est **ignoré** au profit du pool.
|
||||
- ✅ 3 tests existants réécrits pour utiliser le pool Autonomous (ils
|
||||
utilisaient Dedicated comme un mock de pool par paresse).
|
||||
|
||||
### Fichiers modifiés
|
||||
- `internal/dispatcher/dispatcher.go`
|
||||
- `internal/dispatcher/dispatcher_test.go`
|
||||
|
||||
## [0.3.3] - 2026-04-16
|
||||
**Type:** Patch — Ne pas `/exit` les sessions dédiées quand leur dispatch finit
|
||||
|
||||
### Corrigé
|
||||
- **Bug user-visible** : après qu'une tâche dispatchée à `ccl-1-conformvault`
|
||||
ou `ccl-2-scanyze` se terminait (prompt `❯` sans spinner, ou signal file),
|
||||
le watcher envoyait `/exit` → Claude s'arrêtait → Olivier se retrouvait au
|
||||
bash prompt en plein milieu de son travail interactif (prompt visible contient
|
||||
littéralement `.../exit` à la fin).
|
||||
- Les sessions dédiées sont une surface partagée : dispatcher peut y poser
|
||||
des tâches, mais l'opérateur y travaille aussi en interactif et ne doit
|
||||
jamais être éjecté.
|
||||
|
||||
### Ajouté
|
||||
- `SessionWatcher.isDedicated(name)` : test contre `config.Pool.Dedicated`.
|
||||
- `completeSession` distingue pool vs dédié :
|
||||
- **Pool** : `/exit` envoyé (recycle Claude avec contexte propre pour le
|
||||
prochain dispatch, comportement inchangé).
|
||||
- **Dédié** : log `DONE ... (dedicated — leaving Claude alive)`,
|
||||
session marquée idle, Claude laissé tourner pour l'opérateur.
|
||||
|
||||
### Tests
|
||||
- ✅ `go test ./...` full suite
|
||||
- ✅ Déploiement confirmé (ccl-1 relancée, tient depuis)
|
||||
|
||||
### Fichiers modifiés
|
||||
- `internal/watcher/session_watcher.go`
|
||||
|
||||
## [0.3.2] - 2026-04-15
|
||||
**Type:** Patch — Double-Enter pour soumettre les prompts multi-lignes
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue