agent-orchestrator/packages/cli/__tests__
Dhruv Sharma f0d4faf2a4
fix: fail ao send when killed session delivery is not confirmed (#1236)
* fix: fail send when killed session delivery is not confirmed

* fix(core): drop requireConfirmation throw that re-introduced duplicate-message bug

The PR's sendWithConfirmation added a throw when confirmation heuristics
did not flip within SEND_CONFIRMATION_ATTEMPTS on a restored session.
But runtimePlugin.sendMessage had already fired, so the throw bubbled up
to the lifecycle manager's catch-all, leaving lastCIFailureDispatchHash
(and its merge-conflict twin) unset. Next poll re-dispatched the same
message — exactly the duplicate-message bug that commit 77685a5 removed.

Real fix for #1074 is preserved: restoreForDelivery still throws when
waitForRestoredSession returns false, which happens before sendMessage
fires. Killed sessions that cannot be revived are still reported as
failures, with no duplicate-send risk.

- sendWithConfirmation no longer takes requireConfirmation; unconfirmed
  delivery always returns (soft success).
- prepareSession returns Session (the tuple only existed to drive the
  removed throw).
- send's retry predicate reverts to prepared.restoredAt === undefined
  && isRestorable(prepared).
- Adds regression test: restored session + sendMessage fires +
  confirmation never flips → send() resolves.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-20 13:56:31 +05:30
..
commands fix: fail ao send when killed session delivery is not confirmed (#1236) 2026-04-20 13:56:31 +05:30
lib refactor(cli): extract shared repo helpers and support GitLab subgroups 2026-04-15 12:30:32 +05:30
options refactor CLI version wiring for diff coverage 2026-04-02 17:34:19 +05:30
scripts chore: rename @composio scope to @aoagents across all packages 2026-04-09 15:59:33 +00:00
index.test.ts feat(cli): install-aware ao update, startup notifier, doctor version check (#1156) 2026-04-13 11:46:26 +05:30
program.test.ts refactor CLI version wiring for diff coverage 2026-04-02 17:34:19 +05:30