20 Commits

Author SHA1 Message Date
can1357 02cd22dc9b feat: added live tracking and stale status warnings for agent activity snapshots
- Added live tracking and stale status warnings for agent activity snapshots.
- Fixed text wrapping with ANSI escape sequences to defer style open sequences after whitespace.
- Added VirtualRenderScheduler for deterministic virtual-clock rendering tests.
2026-08-16 10:18:56 +03:00
can1357 c162a82169 fix(vibe): deferred IRC wakes during mode exit 2026-08-16 02:49:32 +02:00
can1357 5420b29364 Merge PR #8327: fix(vibe): cancel active turn on mode exit (@roboomp)
# Conflicts:
#	packages/coding-agent/test/interactive-mode-vibe-toggle.test.ts
2026-08-16 02:49:32 +02:00
can1357 c7ecc3ef66 Merge PR #8598: fix(session): repair torn JSONL appends (@roboomp)
# Conflicts:
#	packages/coding-agent/src/session/session-loader.ts
#	packages/coding-agent/src/session/session-manager.ts
#	packages/coding-agent/test/session-loader-stream.test.ts
2026-08-16 02:48:12 +02:00
can1357 b279db1790 test: refactored test suites to eliminate time-based sleeps and polling loops
- Replaced time-based sleeps and polling loops with event-driven promise resolvers and fake timers across agent and tool tests.
- Migrated test suites to share in-memory auth storage and fixtures using lifecycle hooks.
- Updated catalog model definitions, metadata, and configurations.
2026-08-13 19:32:22 +02:00
roboomp 7255ffd596 fix(vibe): isolated mode-exit drain suppression
Replace the resettable queued-message block with a nested mode-exit suppression depth that steer and follow-up queueing cannot clear.

Cover a steer arriving after abort settles but before Vibe teardown releases.

Fixes #8326
2026-08-12 08:56:05 +00:00
roboomp 8edab1af80 fix(vibe): suppress queued-turn drain during mode exit
abort()'s stranded-queue drain could restart a queued user turn on the still-live Vibe tools before teardown removed them. Run the exit teardown with the queued-message drain suppressed, then re-arm it so the queued turn resumes as a clean non-Vibe turn.

Fixes #8326
2026-08-12 08:37:47 +00:00
roboomp d1680450d2 fix(vibe): canceled active turn on mode exit
Abort an in-flight model turn before unregistering Vibe tools so it cannot emit stale worker calls after cancellation.

Add a regression test covering the live streaming transition.

Fixes #8326
2026-08-12 08:26:41 +00:00
can1357 b6dc98eb63 test(coding-agent): updated test suites and assertions for coding agent
- Updated eager compaction and plan reference tests to track call indices and task delegation markers instead of text strings.
- Removed obsolete context message marker checks, vibe mode assertions, and prompt gating test cases.
- Simplified prewalk, workflow, and Gemini instruction test expectations across agent modules.
- Removed the system prompt personality test suite entirely.
2026-08-12 03:12:15 +02:00
Josh Mini bb5bfb2c04 fix(vibe): only override the vibe snapshot when teardown lost the live toolset
The persisted pre-vibe snapshot was applied on every reconciliation that
re-entered vibe mode, including cold resumes and switches in from a non-vibe
session. Those paths build their toolset from the current CLI flags and
settings, so replacing it with a historical snapshot silently drops tools the
session was started with: resuming a session that entered vibe under
--tools read with --tools read,bash restored only read on exit.

Gate the override on the one case the snapshot exists for: the vibe -> vibe
switch, where #clearTransientModeState kept the already-reduced live set.
2026-08-09 11:23:07 +08:00
Josh Mini 1e142aace9 fix(vibe): restore the pre-vibe toolset when switching between vibe sessions
Entering /vibe snapshotted the live toolset into an in-memory field only.
When a session already in vibe mode switches into another session that is also
in vibe mode, #clearTransientModeState takes the removeVibeToolsPreservingActive
path, which deliberately keeps the live active set instead of applying the
source snapshot. #reconcileModeFromSession then re-enters vibe mode, and the
live toolset is by then the reduced vibe set, so the new snapshot was that
reduced set and exiting restored it instead of the target's real pre-vibe
toolset. bash, edit, write, grep, glob, task, and hub were silently gone for
the rest of the session.

Neither a cold start nor switching in from a non-vibe session is affected: the
teardown path does not run, so the live toolset is still the full one when the
snapshot is taken.

Record the snapshot on the vibe mode_change entry and read it back from
sessionContext.modeData on the re-entry path, mirroring how plan mode persists
planFilePath. Sessions written by older versions carry no snapshot and fall
back to the previous behaviour.
2026-08-08 13:39:01 +08:00
can1357 bc39ffa265 feat: introduced omptype validation package and migrated workspace dependencies
- Introduce `@oh-my-pi/omptype` as a new ArkType-compatible schema validation package featuring a lazy JIT runtime, JSON Schema emission, and compatibility adapters.
- Replace `arktype` across workspace packages and test utilities with `@oh-my-pi/omptype`.
- Add benchmark suites, tests, and documentation for the new validation engine and adapters.
- Update workspace build, test runner, and release configurations to include the new package.
2026-08-03 21:56:48 +02:00
can1357 a872d77068 chore: cleanup dumb tests 2026-08-02 20:39:23 +02:00
Hesham Salman 7f7e742db6 fix(coding-agent): preserve parent todos in vibe mode 2026-07-27 13:52:25 -04:00
roboomp c8ef3cc8ff fix(coding-agent): handled vibe session commands safely
Blocked interactive session transitions before they reach the AgentSession vibe guard, preserving the active session and rendering the existing exit-vibe warning instead of rejecting the input callback.

Added regression coverage for new, drop, fork, and move transitions.

Fixes #6607
2026-07-25 11:57:53 +00:00
roboomp 122ab2a4ef fix(coding-agent): resolve restored vibe workers against session model
#vibeParentSession() omitted getActiveModelString, so on resume/switch
#reconcileModeFromSession -> VibeSessionRegistry.rehydrate() ->
#resolveWorker() fell back to the settings default model. A reopened or
switched-to session whose active model came from the journal or a
non-default launch therefore resolved the good (pi/task) worker on the
wrong model. Wire getActiveModelString from the session's active model,
matching the spawn-path ToolSession and sdk's dispose-path helper.

Fixes #5303
2026-07-15 00:19:36 +00:00
roboomp 709066b7a1 fix(coding-agent): preserve target tools when switching out of vibe
#clearTransientModeState's vibe branch runs only from
#reconcileModeFromSession, after switchSession has already loaded and
restored the target session's active tools. It called
deactivateVibeTools(#vibeModePreviousTools), which SETS the active tool
set to that snapshot — but the snapshot belongs to the SOURCE session,
so switching to a non-vibe (or different vibe) target clobbered the
target's tools. Add AgentSession.removeVibeToolsPreservingActive(), which
strips only the transient vibe tools and keeps the current active set,
and use it on the switch path. The live-exit path (#exitVibeMode) still
restores its own snapshot.

Fixes #5303
2026-07-14 23:58:30 +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 46fd8c5575 feat(coding-agent): improved vibe mode tool lifecycle management
- Transitioned vibe tools to an ephemeral registration model where they are installed only when entering `/vibe` mode and removed upon exit.
- Added `activateVibeTools` and `deactivateVibeTools` methods to `AgentSession` to manage these transient tool registrations.
- Removed vibe tools from the default global tool registry, preventing unnecessary background exposure.
2026-07-11 07:33:20 +02: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