Skip to content

fix(coding-agent): preserve interactive session confirmation - #1042

Open
beengineer500 wants to merge 2 commits into
code-yeongyu:mainfrom
beengineer500:fix/coding-agent-interactive-session-confirmation
Open

fix(coding-agent): preserve interactive session confirmation#1042
beengineer500 wants to merge 2 commits into
code-yeongyu:mainfrom
beengineer500:fix/coding-agent-interactive-session-confirmation

Conversation

@beengineer500

@beengineer500 beengineer500 commented Aug 20, 2026

Copy link
Copy Markdown

Summary

  • Prevent the readline close fallback from overriding an answer already received by promptConfirm().
  • Preserve y/yes approval and n/empty/EOF rejection.
  • Add deterministic regression coverage and the required coding-agent change tracker entry.

Reproduction

When resuming a session from another project with --session, answering y or yes incorrectly aborted the operation:

Fork this session into current directory? [y/N] y
Aborted.

Root cause

rl.close() was called inside the readline question callback before resolving the answer. The emitted close event resolved the promise with false before the y/yes result 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 build
  • npm --prefix packages/coding-agent test -- test/suite/regressions/interactive-session-confirmation.test.ts — 5 passed
  • npm --prefix packages/coding-agent test -- test/suite/regressions/756-session-cross-project-resume.test.ts — 2 passed
  • npm run check
  • node .agents/skills/senpi-qa/scripts/cli-smoke.mjs --self-test — 8/8 passed
  • Manual interactive terminal QA: entering y returned 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.

  • Guard the readline close fallback so it rejects only when no answer was received; settle once in promptConfirm.
  • Export promptConfirm and add regression tests for y, yes, n, empty input, and EOF; update the changes.md tracker entry.

Written for commit 1ffd426. Summary will update on new commits.

Review in cubic

Guard the readline close fallback after an answer has settled.\n\nAdd regression coverage for y, yes, n, empty input, and EOF.
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.

1 participant