fix: flush pending responses before runtime maintenance - #173
Open
hheei wants to merge 1 commit into
Open
Conversation
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
Flush ready deferred responses before runtime maintenance and again afterward. This prevents a terminal foreground Bash task from waiting behind a synchronous runtime drain before its NDJSON response can be emitted.
The second flush preserves delivery for responses that become ready during maintenance. Runtime maintenance and task execution behavior are otherwise unchanged.
Fixes #172.
Regression coverage
Validation
cargo +nightly-2026-04-29 test -p agent-file-tools pending_response_tests -- --nocapturecargo +nightly-2026-04-29 test -p agent-file-tools decide_bash_step -- --nocapturecargo +nightly-2026-04-29 build -p agent-file-tools --release --bin aft@cortexkit/aft-bridgesmoke against the built binary: configure, Bash launch, terminal status, and output retrieval succeeded.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Flush ready pending responses before and after runtime maintenance so NDJSON from foreground Bash tasks is not blocked by the drain. No change to maintenance or task behavior.
drain_runtime_events, then flush again after.Written for commit f957d38. Summary will update on new commits.
Greptile Summary
Flushes ready deferred responses before runtime maintenance and polls again afterward, with regression coverage for response ordering and the updated polling cadence.
Confidence Score: 5/5
The PR appears safe to merge, with the new ordering preserving both prompt delivery of already-ready responses and delivery of responses made ready during maintenance.
The runtime registry retains one stable application context, and current pending-response polling remains compatible with the intentional before-and-after maintenance cadence; no concrete changed-code failure remains.
Important Files Changed
Reviews (1): Last reviewed commit: "fix: flush pending responses before runt..." | Re-trigger Greptile