Skip to content

fix(coding-agent): show progress during /refine - #1035

Closed
junhoyeo wants to merge 5 commits into
PrimeIntellect-ai:mainfrom
junhoyeo:fix/refine-progress-status
Closed

fix(coding-agent): show progress during /refine#1035
junhoyeo wants to merge 5 commits into
PrimeIntellect-ai:mainfrom
junhoyeo:fix/refine-progress-status

Conversation

@junhoyeo

@junhoyeo junhoyeo commented Aug 9, 2026

Copy link
Copy Markdown

Summary

  • show an elapsed Refining loader while an explicit /refine session command is active
  • restart the loader timer when ownership changes between a model turn and refinement, including attach/resync reconciliation
  • let the configured interrupt key cancel /refine without clearing queued prompts or the editor draft

Compatibility

This is a TUI-only change that consumes the existing optional sessionActions.active snapshot. 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 /refine path 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 check

Note

Show elapsed progress and allow cancellation during /refine in interactive mode

  • The interactive mode's working loader now activates during active /refine session commands (not just agent streaming), showing Refining · <elapsed> (Ctrl+C to cancel) in the status area.
  • A new workingLoaderKind field tracks whether the loader is owned by streaming or /refine, and the loader restarts when ownership changes.
  • Ctrl+C during an active /refine command now calls agentConnection.abort() and restores any queued prompts to the editor.
  • syncWorkingLoader() is called on session_action_update events and during initial snapshot rendering to keep loader state current.

Macroscope summarized 6f0b233.

@junhoyeo
junhoyeo marked this pull request as ready for review August 9, 2026 02:00
@junhoyeo junhoyeo changed the title fix(coding-agent): show progress during /refine fix(coding-agent): show progress during /refine Aug 9, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/coding-agent/src/modes/interactive/interactive-mode.ts
@junhoyeo

junhoyeo commented Aug 9, 2026

Copy link
Copy Markdown
Author

@codex review

All previous findings have been addressed:

Finding Status
P2: Reconcile loader after applying initial snapshot ✅ Fixed in 0401ba71renderInitialMessages() now calls syncWorkingLoader() immediately after applyConnectionStateSnapshot(state). Regression test verifies invocation order.

Local gates pass:

  • tsgo -p tsconfig.build.json --noEmit: 0 errors
  • vitest --run test/interactive-mode-status.test.ts: 153/153 tests pass

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/coding-agent/src/modes/interactive/interactive-mode.ts
@junhoyeo

junhoyeo commented Aug 9, 2026

Copy link
Copy Markdown
Author

@codex review

All findings from round 2 addressed:

Finding Status
P2: Resume preserved queue after canceling refine ✅ Fixed in 9aca6ba2interruptOrClearInput() now calls restoreQueuedMessagesToEditor({ abort: true }) for both streaming and refine cancellation, ensuring queued prompts are restored to the editor.

Local gates pass:

  • tsgo -p tsconfig.build.json --noEmit: 0 errors
  • vitest --run test/interactive-mode-ctrl-c.test.ts: 21/21 tests pass
  • vitest --run test/interactive-mode-status.test.ts: 153/153 tests pass
  • Biome check: no issues

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 6f0b233ddc

ℹ️ 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".

@junhoyeo

Copy link
Copy Markdown
Author
Screenshot 2026-08-11 at 3 17 32 AM

Preview!

Copy link
Copy Markdown
Member

Hi, thanks for taking the time to contribute to Prime Agent! Since open sourcing the project, we’ve received far more pull requests than we can responsibly review and validate. Prime Agent runs directly on users’ machines, so we need to be deliberate about which changes we accept and how they are reviewed. Rather than leave a large backlog that we cannot meaningfully work through, we’re closing the current PR queue and moving to a discussion-first contribution process.

We have established new contribution guidelines to help us continue iterating on Prime Agent and better manage contributions from the community. Going forward, we won’t review unsolicited pull requests. Instead, please start with a GitHub Discussion. We’ll identify recurring bugs and feature requests, create Issues for work we want to pursue, and invite pull requests from maintainers or vouched contributors when implementation is ready. Please read the full process documented in our contribution guidelines.

While we’re closing this backlog, we’re still reviewing it at a high level to identify recurring bugs, useful ideas, and important problems that we should address ourselves. Thanks again for the time you put into this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants