12 Commits

Author SHA1 Message Date
CAPSLOCKB 1f0c2366d0 fix(vibe): distinguish wait abort from timeout 2026-08-14 14:06:49 +02:00
enieuwy 2b7d403d90 test(vibe): cover the worker spawn path's model-role forwarding
The vibe half of the role-chain fix is a chain of field forwarding —
`#resolveWorker` derives the role, spawn and rehydrate copy it onto the
`VibeRecord`, and `#buildSpawnOptions` hands it to the executor. Any
dropped link silently reverts vibe children to the `default` chain, and
only the `task` spawn path had a regression test.

Drive a real `VibeSessionRegistry.spawn()` for both bundled workers
(`good` -> `task` -> `@task`, `fast` -> `sonic` -> `@smol`) with
`runSubprocess` spied, and assert the captured `ExecutorOptions` pair the
expanded patterns with the role behind them. A third case covers
`task.agentModelOverrides` replacing the alias with an explicit selector,
which must carry no role so the child keeps inheriting `default`.

Breaking either link — the derivation in `#resolveWorker` or the forward
in `#buildSpawnOptions` — fails both role assertions.
2026-08-07 21:30:26 +08:00
can1357 b361bbde20 chore(changelog): normalized unreleased entries 2026-08-05 02:56:52 +02:00
can1357 c457037816 test(coding-agent): cover bounded Vibe suspension
(cherry picked from commit 30fd0cc7bbcb427c9ae7a8ef6b801545c6aa1c5b)
2026-08-05 02:32:36 +02:00
Slava Zavadsky 556830a215 test(vibe): use deferred() for the worker-ready gate; changelog
Review (PR 7340):
- replace the manual resolver-capture promise with the repo-standard deferred()
  helper already used elsewhere in the file
- changelog: vibe pre-init-kill race fix under [Unreleased] Fixed
2026-08-01 22:06:03 -04:00
Slava Zavadsky 6e143bf567 test(vibe): fix kill-before-init race with a worker-ready handshake
The pre-init-kill test issued registry.kill() immediately after spawn()
returned; the mock worker only registers its AgentRef after the abort signal
lands, so on a loaded runner the job body may not have dispatched yet and
kill observed no registration at all (AgentRegistry.get() undefined), failing
the aborted-ref assertion. The mock now signals readiness once it is inside
the abort-wait, and the test awaits that before killing — deterministically
exercising the late-registration terminalization path the test names.

Flaked once on CI singleton (vibe session registry); 32/32 pass locally.
2026-08-01 21:11:52 -04:00
can1357 d16a251777 chore: reorg tests 2026-07-27 16:43:53 +02:00
roboomp febf3eb73d fix(coding-agent): bounded cancelled vibe teardown
vibe_kill and Vibe-mode exit / session-switch suspension awaited every
cancelled turn's job promise unconditionally. When a provider or tool
ignores the abort signal the promise never settles, so teardown hung
indefinitely. Give cancelled jobs a 250ms unref'd settlement grace, then
log and detach any still-pending job while preserving cancelled state.

Ported from @RensTillmann's fix (65446c4).

Fixes #5303
2026-07-14 23:42:18 +00:00
roboomp 4bc68b45e2 fix(coding-agent): persisted vibe sessions across restarts
Vibe worker roster lived only in a process-local Map, so a resumed parent
session started with an empty registry and vibe_send failed with
"Unknown vibe session". Persist a versioned, parent-scoped lifecycle
journal (spawn/turn/tombstone events), rehydrate validated idle workers
through the persisted-subagent reviver on resume, and gate the flow with
generation/CAS protection so stale finalizers cannot clobber a
replacement worker. Killed transcripts stay readable but non-revivable;
mode-exit commits tombstones atomically with the mode change and rolls
back cleanly on storage failure.

Ported from @mastertyko's fork branch fix/vibe-session-persistence.

Fixes #5303
2026-07-14 17:58:14 +00:00
can1357 aa2c580b22 feat(coding-agent): implemented dynamic rendering and state syncing
- Improved real-time screen rendering by implementing dynamic builder functions for vibe mode components.
- Optimized cursor and spinner rendering to re-derive state from shared mutable options on every paint.
- Added session snapshotting and improved wait logic to accurately detect settled turns and running sessions.
- Ensured reliable toolset restoration during mode transitions through updated logic and new contract tests.
2026-07-11 05:47:56 +02:00
can1357 acd893536d feat(coding-agent): introduced vibe mode for persistent background agents
- Implemented /vibe mode providing persistent background worker sessions and five new specialized management tools.
- Developed a multi-view UI featuring a mini-composer for tool calls and a TV wall for real-time worker status, traces, and output monitoring.
- Integrated shimmering effects and stable screen ordering to enhance worker state visibility and session management.
- Added comprehensive unit tests for Vibe tool renderers and updated runtime registry logic to support rich screen snapshots.
2026-07-11 05:47:56 +02:00
can1357 b60cbb83b7 test(vibe): validated vibe runtime session lifecycle and concurrency behavior
- Implemented test suite for VibeSessionRegistry covering lifecycle state management, session spawning, and turn execution.
- Added verification for session steering, turn queuing, and subagent follow-up behavior within active sessions.
- Validated concurrency handling in the registry including multi-session wait mechanics and result suppression.
- Incorporated session cleanup logic verification for both individual kill operations and mass termination via killAll.
2026-07-11 05:47:56 +02:00