Skip to content

Comments

fix: pause queued sends when response is required#429

Merged
Dimillian merged 8 commits intoDimillian:mainfrom
amanthanvi:fix/428-pause-queued-on-response-required
Feb 14, 2026
Merged

fix: pause queued sends when response is required#429
Dimillian merged 8 commits intoDimillian:mainfrom
amanthanvi:fix/428-pause-queued-on-response-required

Conversation

@amanthanvi
Copy link
Contributor

@amanthanvi amanthanvi commented Feb 13, 2026

Fixes #428.

What

  • Add setting pauseQueuedMessagesWhenResponseRequired (default: true) + Settings toggle.
  • Pause queued-message auto-flush when a plan follow-up is waiting (plan ready accept/changes) or a request-user-input prompt is active.
  • Show a small queue hint while paused.

How to test

  • Turn on Steer mode, queue a few messages while a run is active, then end the run in a plan-ready follow-up or required question → queued messages should not auto-send.
  • Toggle the feature off (Settings → Features) → queued messages resume auto-flush behavior.

Checks

  • npm run typecheck
  • npm run lint
  • npm run test
  • cd src-tauri && cargo test

Copilot AI review requested due to automatic review settings February 13, 2026 19:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes queued-message auto-flush advancing a thread while the UI is waiting for a required user response (plan accept/changes follow-up or request-user-input prompt), with a user-facing pause hint and a configurable setting.

Changes:

  • Add pauseQueuedMessagesWhenResponseRequired app setting (default true) with a Settings toggle (frontend + Tauri types/defaults).
  • Gate useQueuedSend’s auto-flush effect behind a queueFlushPaused flag derived from active thread state.
  • Display a “Paused …” hint in the composer queue UI when queued sends are blocked.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/types.ts Adds the new app setting to AppSettings.
src/features/settings/hooks/useAppSettings.ts Sets the default for the new app setting (true).
src/features/settings/components/sections/SettingsFeaturesSection.tsx Adds a Settings toggle to control the new behavior.
src-tauri/src/types.rs Adds/serializes the setting in Tauri-side AppSettings with a default and test assertion.
src/features/threads/hooks/useQueuedSend.ts Introduces queueFlushPaused option and blocks auto-flush when set.
src/features/threads/hooks/useQueuedSend.test.tsx Adds coverage ensuring queued messages don’t flush while paused.
src/App.tsx Computes pause conditions from active items/user-input requests; passes pause flag + pause reason into composer pipeline.
src/features/app/hooks/useComposerController.ts Threads queueFlushPaused through to useQueuedSend.
src/features/layout/hooks/layoutNodes/types.ts Extends layout node options with queuePausedReason.
src/features/layout/hooks/layoutNodes/buildPrimaryNodes.tsx Passes pause reason into Composer.
src/features/composer/components/Composer.tsx Accepts and forwards queuePausedReason to the queue UI.
src/features/composer/components/ComposerQueue.tsx Renders the pause hint text when provided.
src/styles/composer.css Styles the pause hint text.
src/features/settings/components/SettingsView.test.tsx Updates test settings fixture to include the new field.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

src/App.tsx Outdated
Comment on lines 1191 to 1235
const isPlanReadyAwaitingResponse = useMemo(() => {
if (!activeThreadId) {
return false;
}

let planIndex = -1;
for (let index = activeItems.length - 1; index >= 0; index -= 1) {
const item = activeItems[index];
if (item.kind === "tool" && item.toolType === "plan") {
planIndex = index;
break;
}
}

if (planIndex < 0) {
return false;
}

const planItem = activeItems[planIndex];
if (planItem.kind !== "tool" || planItem.toolType !== "plan") {
return false;
}

if (!(planItem.output ?? "").trim()) {
return false;
}

const planTone = toolStatusTone(planItem, false);
if (planTone === "failed") {
return false;
}

if (isProcessing && planTone !== "completed") {
return false;
}

for (let index = planIndex + 1; index < activeItems.length; index += 1) {
const item = activeItems[index];
if (item.kind === "message" && item.role === "user") {
return false;
}
}

return true;
}, [activeItems, activeThreadId, isProcessing]);
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

The logic for determining whether a plan is “ready and awaiting user response” duplicates the plan-followup gating logic already implemented in src/features/messages/components/Messages.tsx (the planFollowup useMemo). Keeping two separate implementations in sync is error-prone and can cause the queue-pause behavior to drift from the UI’s “Plan ready” follow-up behavior. Consider extracting this into a shared helper (e.g., in messageRenderUtils or a threads/messages util) and reusing it in both places (or deriving the queue pause state from the same source used to decide whether the follow-up is shown).

Copilot uses AI. Check for mistakes.
Comment on lines 117 to 120
Pause queued messages when response required
</div>
<div className="settings-toggle-subtitle">
Keep queued messages paused while Codex is waiting for plan approval/changes
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

UI copy: “Pause queued messages when response required” is grammatically incomplete. Consider changing it to “Pause queued messages when a response is required” (and optionally align the subtitle wording similarly) for clarity.

Suggested change
Pause queued messages when response required
</div>
<div className="settings-toggle-subtitle">
Keep queued messages paused while Codex is waiting for plan approval/changes
Pause queued messages when a response is required
</div>
<div className="settings-toggle-subtitle">
Keep queued messages paused while Codex is waiting for plan approval, changes,

Copilot uses AI. Check for mistakes.
@amanthanvi
Copy link
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. You're on a roll.

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

@Dimillian Dimillian merged commit 472a378 into Dimillian:main Feb 14, 2026
6 checks passed
rchybicki pushed a commit to rchybicki/CodexMonitor that referenced this pull request Feb 15, 2026
Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
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.

fix: pause queued sends when plan/user-input response is required

2 participants