fix(coding-agent): separate active commands from queued input - #565
Open
snimu wants to merge 4 commits into
Open
fix(coding-agent): separate active commands from queued input#565snimu wants to merge 4 commits into
snimu wants to merge 4 commits into
Conversation
snimu
marked this pull request as ready for review
July 30, 2026 17:33
snimu
marked this pull request as draft
July 30, 2026 17:55
snimu
marked this pull request as ready for review
July 30, 2026 20:25
JeffCarpenter
added a commit
to JeffCarpenter/prime-agent
that referenced
this pull request
Aug 25, 2026
… into local-session-input-active-state # Conflicts: # packages/coding-agent/CHANGELOG.md # packages/coding-agent/src/core/agent-messages.ts # packages/coding-agent/src/core/agent-session.ts # packages/coding-agent/src/core/cron-jobs.ts # packages/coding-agent/src/modes/agent-connection/snapshot.ts # packages/coding-agent/src/modes/agent-connection/types.ts # packages/coding-agent/src/modes/agents-view/agents-view-state.ts # packages/coding-agent/src/modes/daemon/daemon-mode.ts # packages/coding-agent/src/modes/daemon/daemon-session-list.ts # packages/coding-agent/src/modes/daemon/daemon-session-summarizer.ts # packages/coding-agent/src/modes/daemon/daemon-supervisor.ts # packages/coding-agent/src/modes/headless-completion.ts # packages/coding-agent/src/modes/rpc/rpc-mode.ts # packages/coding-agent/src/modes/rpc/rpc-types.ts # packages/coding-agent/test/agent-session-recursion.test.ts # packages/coding-agent/test/agent-session-services.test.ts # packages/coding-agent/test/agents-view-state.test.ts # packages/coding-agent/test/cron-jobs.test.ts # packages/coding-agent/test/daemon-mode.test.ts # packages/coding-agent/test/daemon-session-list.test.ts # packages/coding-agent/test/print-mode.test.ts # packages/coding-agent/test/suite/agent-session-queue.test.ts
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7ec7438. Configure here.
| } else if ( | ||
| sessionEventType === "turn_start" || | ||
| sessionEventType === "turn_end" || | ||
| sessionEventType === "session_action_update" || |
There was a problem hiding this comment.
Overlapping refreshes can stale peer state
Medium Severity
session_action_update now kicks off refreshWorkerSummaries on every queue snapshot change, but those list RPCs are not serialized or coalesced. A slower earlier refresh can overwrite a later one, so remote peer summaries can keep a finished command as unfinished work.
Reviewed by Cursor Bugbot for commit 7ec7438. Configure here.
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
/compact,/refine,/goal, and/autonomouscommands as queued steering or follow-up input/compactfrom treating itself as successor work and unnecessarily deferring compaction-triggered refinementValidation
npm run checkNote
Medium Risk
Touches session input scheduling, headless exit timing, and daemon peer summaries; wrong busy/queue classification could affect admission, heartbeats, and multi-client views, but changes are narrowly scoped to separating active commands from the durable queue.
Overview
Executing slash commands (e.g.
/compact) no longer show up in user-visible queued steering or follow-up previews or emptysession_action_updatequeue projections while they run; tests assertqueuedActionCountstays 0 andunfinishedActionCounttracks the in-flight command until it finishes.The daemon supervisor now triggers
refreshWorkerSummariesonsession_action_updatesession events (alongside turn start/end), so remote Agents View peers pick up active vs queued input changes without waiting for a turn boundary. Headless completion is covered by tests to block until an executing session command completes, not only model idleness.Changelog records the queued-input display fix.
Reviewed by Cursor Bugbot for commit 7ec7438. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Separate executing slash commands from queued input in coding agent
/compact) are tracked viaunfinishedActionCountrather than appearing as queued steering or follow-up messages (queuedActionCount).DaemonSupervisor.handleWorkerFrameto callrefreshWorkerSummariesonsession_action_updateevents, so remote agent peers stay in sync with input activity.waitForHeadlessCompletionnow waits for an executing session command to finish before settling.Macroscope summarized 7ec7438.