Files
qwen-code/integration-tests
易良andQwen-Coder d896c1816a test(managed): align recovery and transcript fixture contracts (#15899)
* test(managed): record which load path produced each post-crash entry

HostedProcessCrashIT fails on main with postFailureLoads.every(Boolean), but
the recorded sequence changes shape between runs (#15898: 9 vs 10 entries,
different true positions, one run with none), so the current message cannot
say which of the connector's load paths sent the offending request.

Record a compact origin discriminator per entry — cancellationTakeover,
passiveManagedRuntimeRecovery, driveRuntimeRecovery, mcpManagementOnly and
whether cancellationPromptId was present — and include it in both assertion
messages. The assertion itself is unchanged: 'no tool replay after a crash'
is the property it protects, and the next red run should name its own origin
instead of being guessed at.

* test(managed): name the load path behind each post-crash entry

Both review findings were correct: the origin string added in fad5d81a
still could not name the culprit it exists to name.

Two load shapes reach POST /session/:id/load carrying markers the origin
string never read, so they rendered byte-identical to a bare re-attach:

- a recovery-cleanup load sets only recoveryCleanupPromptId
  (LoadHarnessSession.forRecoveryCleanup throws when passive/drive/
  takeover/lifecycle/promptId are set at all), and
  QwenHostedHarnessConnector.doRecheckRecoveryCleanup issues one;
- a lifecycle load sets only lifecycleAuthority
  (QwenHostedHarnessConnector.lifecycleAttachment builds it with
  passive=drive=takeover=false).

promptId could not rescue them: withCancellationPromptId throws unless
passiveManagedRuntimeRecovery && cancellationTakeover, so promptId=true
implies takeover=true and the marker is always false on exactly the
entries every(Boolean) rejects.

Recording also happened eleven lines before await fetch(target, ...), so
a load the daemon refused was indistinguishable from an admitted one.
This driver already expects that refusal for a plain attach
(assert.equal(loaded.error, 'hosted_turn_recovery_required'), HTTP 409),
and the connector then performs the takeover load that actually replaces
the runtime. Move the recording after the response and add status, so a
refused probe that changed nothing no longer prints as the forbidden
admitted plain re-attach.

Verified by mutation over the eight load shapes that can reach this
endpoint: the previous marker set collapsed four of them (refused bare
reattach, admitted bare reattach, recovery-cleanup, lifecycle) into one
indistinguishable string; each of the three added markers is
load-bearing, since dropping any one reintroduces a collision. The
assertion itself is unchanged.

Co-authored-by: Qwen-Coder <[email protected]>
Patrol-Run: qwen-pr-closeout/jmvugxtx22a

* test(managed): distinguish cleanup loads and response outcomes

Co-authored-by: Qwen-Coder <[email protected]>

* test(managed): align recovery and transcript fixture contracts

Co-authored-by: Qwen-Coder <[email protected]>

---------

Co-authored-by: Qwen-Coder <[email protected]>
2026-10-30 18:17:02 +08:00
..