fix(coding-agent): preserve interactive session confirmation - #1042
Open
beengineer500 wants to merge 2 commits into
Open
fix(coding-agent): preserve interactive session confirmation#1042beengineer500 wants to merge 2 commits into
beengineer500 wants to merge 2 commits into
Conversation
Guard the readline close fallback after an answer has settled.\n\nAdd regression coverage for y, yes, n, empty input, and EOF.
beengineer500
force-pushed
the
fix/coding-agent-interactive-session-confirmation
branch
from
August 20, 2026 11:23
1b2e6f5 to
1ffd426
Compare
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
closefallback from overriding an answer already received bypromptConfirm().y/yesapproval andn/empty/EOF rejection.Reproduction
When resuming a session from another project with
--session, answeringyoryesincorrectly aborted the operation:Root cause
rl.close()was called inside the readline question callback before resolving the answer. The emittedcloseevent resolved the promise withfalsebefore they/yesresult could take effect.The fix uses a settled guard so the EOF fallback remains active without overriding an answer that has already been received.
Testing
npm run buildnpm --prefix packages/coding-agent test -- test/suite/regressions/interactive-session-confirmation.test.ts— 5 passednpm --prefix packages/coding-agent test -- test/suite/regressions/756-session-cross-project-resume.test.ts— 2 passednpm run checknode .agents/skills/senpi-qa/scripts/cli-smoke.mjs --self-test— 8/8 passedyreturned a forked session manager with the target session created in the destination project.Related
This is related to #756, but is distinct: #756 covers non-interactive stdin handling, while this PR fixes the interactive readline confirmation race.
Summary by cubic
Preserves interactive confirmation during cross-project session resolution. Previously, y/yes approvals were overridden by a readline close event and aborted; now y/yes approves, while n/empty/EOF rejects.
promptConfirm.promptConfirmand add regression tests for y, yes, n, empty input, and EOF; update thechanges.mdtracker entry.Written for commit 1ffd426. Summary will update on new commits.