Repository navigation
Runner: fire-and-forget async event posting with server-side ordering - #42
Merged
Merged
Conversation
Replace synchronous PostEvents in the runner's stdout callback with a fire-and-forget goroutine to prevent blocking the pipe when the API is slow. Add sort.Slice by sequence in EventHub.Publish so out-of-order delivery is corrected server-side. Add tests for both the backend ordering guarantee and frontend gap detection behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4 of 5 tasks
nissessenap
force-pushed
the
async-fire-and-forget
branch
from
March 1, 2026 21:17
824a178 to
867da13
Compare
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.
Summary
PostEventsin the runner's stdout callback with a fire-and-forget goroutine — prevents blocking the pipe when the API is slow or unreachablesort.Sliceby sequence inEventHub.Publishso out-of-order delivery from concurrent goroutines is corrected server-sideTestEventHub_PublishOutOfOrder_SortsBySequence) and frontend tests for gap detection and exhausted-retry acceptanceContext
See
thoughts/plans/2026-03-01-async-event-posting-comparison.mdfor the full analysis of fire-and-forget vs buffered channel. Fire-and-forget was chosen for its simplicity — the server-side sort in EventHub eliminates the ordering concern that was the main argument for the channel approach.Supersedes the buffered channel approach from #37.
Test plan
TestEventHub_PublishOutOfOrder_SortsBySequence— publishes events as [3, 1, 2], asserts history returns [1, 2, 3]TestRunWithEventPosting— updated with thread-safe mock to verify fire-and-forget goroutines completemake lint-fix— 0 issuesmake web-lint-fix,make web-check— clean🤖 Generated with Claude Code