Fix mission relay ordering before /api/spark/run returns - #892
Merged
Conversation
vibeforge1111
marked this pull request as ready for review
August 8, 2026 12:49
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
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.
Fix mission relay ordering before
/api/spark/runreturnsWhy
Supervised Spark Recursive QA found a remaining fast-terminal ordering race after the Telegram consumer fix. Spawner recorded the correct mission lifecycle, but
/api/spark/runrelayed each event fire-and-forget and could return before the terminal webhook arrived. Telegram could therefore send a start acknowledgement and later receive an already queued nonterminal relay after the terminal handoff.What changed
Exact candidate
63bd3159d4fe5d855087a762545ac51c57fa5f7722052aeab3e6979fd75f3bc221c5b39a3dbbe5d85f16a086468610877099035b309948c9f8ec277d— settle mission events before the run response0edfaff24920002f05c5bf7c143b6a6bbe4e3b71— cover events appended during flush22052aeab3e6979fd75f3bc221c5b39a3dbbe5d8— keep the queue helper internal to the SvelteKit endpoint/api/spark/runand its integration testProof
git diff --check: passedThe late-append regression starts a flush while the first relay is blocked, appends a second terminal event after the flush has begun, and proves the flush cannot resolve until that second delivery completes. It fails the previous one-shot-tail implementation.
Release gate
Exact-head
test-and-auditandsecret-scanpass. The exact PR head is installed locally, strict runtime sync passes, and Spawner health is green. The installed-artifact supervised Access-5 replay now also passes: one real mission produced the chronological owner sequencemission_created -> dispatch_started -> mission_started -> task_started -> task_progress -> task_failed -> mission_failed, one common request/trace join, one natural terminal Telegram failure, no duplicate, no stale acknowledgement, no nonterminal relay after terminal delivery, nounknown_mission, and exactly one active poller. This PR is ready for normal serialized merge before Telegram #864.Rollback
Revert this small PR. It changes no database schema, public points, installer tag, release ref, or persistent mission data.