Fix agent runtime queue races#52
Open
canvascoding wants to merge 2 commits into
Open
Conversation
| // the remaining entries runtime-owned so Steer injects only this entry. | ||
| agent.clearFollowUpQueue(); | ||
| this.attachedFollowUpId = null; | ||
| this.followUpsSuspended = this.followUps.length > 0; |
There was a problem hiding this comment.
Suspended Follow-Ups Stay Stuck
When one follow-up is promoted while others remain queued, this clears agent-core's follow-up queue and leaves followUpsSuspended set to true. The promoted steering message is consumed from the steering queue, so the remaining follow-ups are never re-attached to agent-core; they stay visible in status but do not run unless the user manually removes or clears them.
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
Verification
Notes
Greptile Summary
This PR changes how Pi runtime and WebSocket queues preserve chat action order. The main changes are:
RuntimeMessageQueues.Confidence Score: 4/5
The runtime queue promotion path can leave remaining follow-ups stuck.
app/lib/pi/runtime-queue.ts
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Multiple follow-ups queued] --> B[One follow-up attached to agent-core] A --> C[User promotes a queued follow-up] C --> D[Agent follow-up queue is cleared] D --> E[Remaining follow-ups stay runtime-owned] E --> F[followUpsSuspended remains true] C --> G[Promoted message enters steering] G --> H[Steering message is consumed] H --> I[Remaining follow-ups are not re-attached]%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% flowchart TD A[Multiple follow-ups queued] --> B[One follow-up attached to agent-core] A --> C[User promotes a queued follow-up] C --> D[Agent follow-up queue is cleared] D --> E[Remaining follow-ups stay runtime-owned] E --> F[followUpsSuspended remains true] C --> G[Promoted message enters steering] G --> H[Steering message is consumed] H --> I[Remaining follow-ups are not re-attached]Reviews (1): Last reviewed commit: "Prevent Steer from draining queued follo..." | Re-trigger Greptile
Context used (3)