Files
fusion/packages/engine
Timoteo 23b152f494 fix: normalize subscribe for callback-only runtime sessions (#3504)
## Summary

- normalize callback-only plugin sessions at the shared runtime boundary
- preserve runtime-native subscriptions and isolate subscriber failures
- strengthen ACP multi-delta, unsubscribe, and callback-delivery
coverage
- correct the task environment and unsubscribe contracts

## Why

PR #3501 fixed the generic ACP adapter, but workflow steps still call
`session.subscribe()` unconditionally. Bundled callback-only runtimes
such as Hermes and the vendored Grok/Claude/OMP ACP clients can still
return sessions without that method. Handling the compatibility once in
`createResolvedAgentSession` closes every current runtime surface
without copying the bridge into each adapter.

## Testing

- `packages/engine`: `agent-session-helpers.test.ts` — 61 passed
- `fusion-plugin-acp-runtime`: `runtime-adapter.test.ts` — 14 passed
- `fusion-plugin-acp-runtime`: `process-manager.test.ts` — 15 passed
- engine typecheck passed
- ACP runtime typecheck passed
- changeset format, FNXC date check, ESLint, and `git diff --check`
passed


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Bug Fixes**
  - Improved compatibility with callback-based runtime sessions.
- Added reliable subscriptions for text, thinking, and tool activity
updates.
  - Preserved native subscription behavior where available.
  - Prevented subscriber errors from interrupting event delivery.
  - Improved unsubscribe behavior for removed handlers.
  - Improved event delivery during deferred runtime fallback.
  - Corrected task environment values passed to runtime subprocesses.

- **Tests**
- Expanded coverage for streaming updates, fallback handling, cleanup,
and subscriber isolation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-23 19:00:06 -07:00
..
2026-07-31 18:03:13 -07:00
2026-08-23 14:49:26 -07:00
2026-08-23 14:49:26 -07:00