You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(swarm): write runtime.json on stop + sync roster model on start (#238)
Closes#235 — workers stuck after stop because runtime.json was never
updated. `POST /api/swarm-tmux-stop` killed the tmux session but left
`lifecycle.state` / `phase` / `currentTask` at whatever the last
in-process update wrote. The Swarm UI rendered the worker as 'stuck':
no tmux session, but lifecycle still says running/blocked.
Adds `patchSwarmRuntimeFile` in swarm-foundation, atomic-write into
`runtime.json` so unrelated fields survive. Stop handler now patches:
state: idle, phase: stopped, currentTask: null, blockedReason: null,
checkpointStatus: none, lastDispatchResult: 'Stopped via UI',
lastOutputAt: now
Best-effort: a runtime-write failure does NOT fail the kill request
(the tmux session is already gone — caller deserves to know that).
Closes#236 — roster `model:` field was display-only. The wrapper at
`~/.local/bin/swarm<N>` invokes `hermes chat --continue` with no
`--model` flag, so the per-profile config.yaml wins. Profiles all
defaulted to `gpt-5.5`, so the roster value never made it to the model.
Adds:
- `swarm-model-resolver.ts` — maps roster display labels (e.g. 'Opus 4.7',
'PC1 Coder (97 TPS)', 'GPT-5.5', 'minimax M2.7') to canonical
provider+model id pairs. Tolerant: unknown labels return null so the
worker is left alone instead of getting wedged.
- `swarm-profile-config.ts` — atomic YAML patch for
`profiles/<id>/config.yaml` that updates only `model.provider` and
`model.default`, preserving sibling fields (toolsets, providers,
agent settings).
- swarm-tmux-start now resolves the roster model and syncs the profile
config before (re)attaching the tmux session. Returns a `modelSync`
block in the response so the UI can surface 'now using …' or quietly
ignore unknown labels.
Tests:
- 10 new tests for `patchSwarmRuntimeFile` (4) + resolver (7) + config sync (7)
- All 24 pass; pre-existing failing tests on main are unrelated and untouched.
Co-authored-by: Aurora release bot <release@outsourc-e.com>
0 commit comments