Fix duplicate failed_step interventions on mission run failure#357
Closed
cursor[bot] wants to merge 1 commit into
Closed
Fix duplicate failed_step interventions on mission run failure#357cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
When a worker exhausts retries and the orchestrator run later fails, ensureTerminalFailedRunIntervention (#355) could open a second failed_step intervention for the same step. Worker paths store the orchestrator step id in metadata.stepId while terminal sync stores the mission step id, so dedup never matched. Unify matching across worker, terminal sync, and manual step-failure paths via failedStepInterventionsMatch, and route updateStep failures through the same dedup logic. Co-authored-by: Arul Sharma <arul28@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Owner
|
Closing: superseded by #359 (ade/missions removal), which deleted the entire missions/orchestrator subsystem this PR patches (missionService.ts, aiOrchestratorService.ts, missionInterventionRouting.ts). The duplicate failed_step bug is moot and merging would resurrect a deliberately removed feature. — 2026-05-29 ADE board cleanup |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug and impact
When a mission worker exhausted retries, the orchestrator opened a
failed_stepintervention. After the run transitioned tofailed, the newensureTerminalFailedRunInterventionpath from #355 could open a second intervention for the same step. Operators could resolve one card while the mission stayed blocked on the other.Root cause
Failed-step identity was inconsistent across creation paths:
metadata.stepIdmetadata.stepIdinsertInterventiondirectlyDedup only compared
metadata.stepIdliterally, so worker and terminal-sync interventions never matched. The fallback matcher also omittedstepKeywhen checking mission-only failures.Fix
failedStepInterventionsMatch()that matches by mission step id, orchestrator step id, or step key (scoped to run when available)missionService.addIntervention,updateStepfailure handling, andensureTerminalFailedRunInterventionmetadata.orchestratorStepIdwhenstepIdis a mission idValidation
npx vitest run src/main/services/missions/failedStepInterventionMatching.test.tsnpx vitest run src/main/services/orchestrator/aiOrchestratorService.test.ts -t "duplicate worker failed-step|opens terminal failed-step"