fix(cli): let Claude continue after ExitPlanMode reject with feedback#808
Open
dragonkid wants to merge 3 commits intoslopus:mainfrom
Open
fix(cli): let Claude continue after ExitPlanMode reject with feedback#808dragonkid wants to merge 3 commits intoslopus:mainfrom
dragonkid wants to merge 3 commits intoslopus:mainfrom
Conversation
added 2 commits
March 3, 2026 21:44
When a permission response includes an `answers` field (Record<string, string>), merge it into the tool's updatedInput so Claude Code receives structured user selections in the AskUserQuestion tool result. This enables remote clients (mobile app, Discord bot) to send selected answers through the existing permission RPC without a separate sendMessage call.
When ExitPlanMode is rejected with a reason (user feedback), don't abort claudeRemote. This allows Claude to continue re-planning based on the feedback instead of stopping and waiting for new user input. Previously, isAborted() returned true for ALL ExitPlanMode tool results, causing claudeRemote to exit regardless of whether the user provided feedback. The new logic: - Reject with reason → don't abort (Claude continues with feedback) - Reject without reason → abort (wait for new user input) - Approve → abort (needs process restart with PLAN_FAKE_RESTART)
3 tasks
Empty reject should send empty string, not a misleading default message that could cause Claude to do unnecessary re-planning work.
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
ExitPlanModeis rejected with feedback (user provides a reason), don't abortclaudeRemote— let Claude continue re-planning based on the feedbackProblem
isAborted()inpermissionHandler.tsreturnedtruefor ALL ExitPlanMode tool results, regardless of approve/reject or whether feedback was provided. This causedclaudeRemoteto exit on reject, leaving the Claude process producing output that nobody consumed. The relay never received Claude's subsequent re-planning output.Root Cause
The "always abort" block was written for the approve case (which needs process restart via
PLAN_FAKE_RESTART), but the first check already catches reject. Both paths returntrue, so reject-with-feedback also aborts.Fix
Check ExitPlanMode first, then branch on approve vs reject-with-feedback vs reject-without-feedback:
reasonisAbortedtrue"use simpler approach"falseundefinedtrueTest plan
Companion PR
undefinedinstead of"Plan rejected"when modal is empty