Disable editing pending steering messages - #336895
Joaquín Ruales (jruales) wants to merge 5 commits into
Conversation
Fixes #325884 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unresolved queue and abort races can still send superseded or cancelled work.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 2
Open (4)
What changed in this PR
Synchronizes pending Copilot steering edits with the SDK queue.
Changes:
- Serializes queue mutations and retracts superseded steering.
- Handles consumption, cancellation, and unrelated queued work.
- Adds regression coverage for editing and lifecycle races.
| File | Description |
|---|---|
| src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts | Adds steering queue regression tests. |
| src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts | Implements steering queue reconciliation and serialization. |
| src/vs/platform/agentHost/node/copilot/copilotAgent.ts | Routes pending steering state to the session. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Replace SDK queue reconciliation with shared UI editing guards. Preserve queued and sent request editing and restore the provider's existing send, cancel, and model-switch behavior. Fixes #325884 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Include the pending kind in request rendering identity so queued-to-steering transitions refresh edit controls and listeners. Cover both transition directions through the real chat list. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
An active queued edit can survive a transition to steering and submit using stale queue state.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Resolved since last review (1)
Check the live pending request state before preparing an edit and again before replacing the queued request. Reject stale edits with a warning while retaining the user's input. Refs #325884 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve both pending-steering accessibility coverage and the upstream draft-handoff accessibility tests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The editing restriction and state-transition safeguards have focused regression coverage, with only minor wording feedback remaining.
Review effort: Balanced
Findings: None


Fixes #325884.
Disable editing of pending steering messages to prevent multiple revisions from being sent to the agent. Queued and sent messages remain editable; provider send, cancellation, and model-switch behavior is unchanged.
Apply the restriction to toolbar, mouse, keyboard, and programmatic edit entry points. Add regression coverage and update accessibility help.