fix(coding-agent): show progress during /refine - #1035
Conversation
/refine
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3f747ebbe1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review All previous findings have been addressed:
Local gates pass:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0401ba71dc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| void this.agentConnection.abortBash(); | ||
| } | ||
| if (this.hasActiveRefineCommand()) { | ||
| void this.agentConnection.abort(); |
There was a problem hiding this comment.
Resume the preserved queue after cancelling refine
When /refine has a queued follow-up, this calls the generic AgentConnection.abort(), which maps to AgentSession.requestAbort() and sets _sessionInputPumpSuspended = true (agent-session.ts:6506-6509). Because this path deliberately neither clears/restores the queued prompts nor sends resume_queue, the refinement finishes but the preserved prompts remain suspended indefinitely until the user submits another prompt. Use a refinement-specific cancellation path or explicitly resume preserved queued work after cancellation.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Valid. Fixed in 9aca6ba2.
When canceling /refine via Ctrl+C, interruptOrClearInput() now calls restoreQueuedMessagesToEditor({ abort: true }) in addition to abort(). This ensures queued follow-up prompts are restored to the editor instead of remaining suspended indefinitely.
The condition for queue restoration is expanded from isAgentStreaming() to isAgentStreaming() || hasActiveRefineCommand(), sharing the same queue-restoration path that already worked for streaming cancellation.
Test updated in 6f0b233d to verify the new behavior: restoreQueuedMessagesToEditor is now expected to be called when canceling refine with queued prompts.
|
@codex review All findings from round 2 addressed:
Local gates pass:
|
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Refiningloader while an explicit/refinesession command is active/refinewithout clearing queued prompts or the editor draftCompatibility
This is a TUI-only change that consumes the existing optional
sessionActions.activesnapshot. It adds no daemon command, event, response field, capability, or schema revision; clients attached to older daemons continue to degrade to the existing no-loader behavior.Scope and prior work
This fixes the explicit interactive
/refinepath that can otherwise appear frozen during a long model-backed refinement. It deliberately does not add generic lifecycle state for automatic/background refinement.#447 overlaps with the broader goal, but is currently conflicting and predates the session-action snapshot now on
main. This PR is the minimal current-main alternative for the interactive slash-command path and does not revive #447's queue/core/protocol changes.Validation
npx tsx ../../node_modules/vitest/dist/cli.js --run test/interactive-mode-status.test.ts test/interactive-mode-ctrl-c.test.ts(174 passed)npx tsx ../../node_modules/vitest/dist/cli.js --run test/suite/agent-session-queue.test.ts -t "defers steer heartbeats while a non-streaming session command is running"(1 passed)npm run checkNote
Show elapsed progress and allow cancellation during
/refinein interactive mode/refinesession commands (not just agent streaming), showingRefining · <elapsed> (Ctrl+C to cancel)in the status area.workingLoaderKindfield tracks whether the loader is owned by streaming or/refine, and the loader restarts when ownership changes./refinecommand now callsagentConnection.abort()and restores any queued prompts to the editor.syncWorkingLoader()is called onsession_action_updateevents and during initial snapshot rendering to keep loader state current.Macroscope summarized 6f0b233.