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: [AI-7743] keep Bus mirror off the question Deferred critical path
Address review feedback (flagged by all reviewers): the `Bus.publish` mirrors
added for /event (webview) clients sat on the Deferred critical path. Since
`Effect.promise` converts a promise rejection into an unrecoverable fiber
defect, a `Bus.publish` rejection could abort the fiber before
`Deferred.succeed`/`Deferred.fail` ran — leaving the awaiting `Question.ask()`
hung on "Thinking…", the exact failure this PR fixes.
- Add a best-effort `mirror()` helper: `Effect.promise(() => Bus.publish(...))`
recovered with `Effect.catchCause` to a logged warning, so a publish failure
can never abort core question settlement.
- Settle the Deferred FIRST, then mirror, in `reply()` and `reject()`.
- `ask()` uses `mirror()` too, so a publish failure can't abort it before the
cleanup finalizer is registered.
- Replace `z.any()` with `z.unknown()` in the `question.asked` Bus schema.
- Log (not silently swallow) failures in the instance-dispose cleanup.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments