Files
reverse-engineering-anything/src/browser/ScenarioActionSequence.ts
T
Kaoru0822andClaude Opus 5.5 8e3bf56e11 fix(electron): record actions skipped after a failed action (#6023)
An Electron scenario stopped at the first failed or cancelled action and
returned no record for the remaining declared actions, so
normalized_result.actions could not account for the whole scenario.

Record every remaining action as cancelled with a not-executed error, the
representation browser scenarios already use. Both runners now share one
helper for that error, which also distinguishes a stop caused by request
cancellation from one caused by an action failure.

Fixes #5943

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 08:06:25 -07:00

15 lines
591 B
TypeScript

/** Status of the earlier action that stopped a declared scenario sequence. */
export type ScenarioActionStop = "failed" | "cancelled";
/**
* Explain a declared action recorded as `cancelled` without running because an
* earlier action stopped the sequence. Scenario producers record every
* remaining action so results account for the whole declared sequence.
*/
export const notExecutedActionError = (
stoppedBy: ScenarioActionStop,
): string =>
stoppedBy === "failed"
? "not executed after an earlier action failure"
: "not executed after scenario request cancellation";