Skip to content

fix(coding-agent): honor cross-project fork confirmations - #1098

Open
realsigridjin wants to merge 2 commits into
code-yeongyu:mainfrom
realsigridjin:fix/cross-project-session-confirmation-race
Open

fix(coding-agent): honor cross-project fork confirmations#1098
realsigridjin wants to merge 2 commits into
code-yeongyu:mainfrom
realsigridjin:fix/cross-project-session-confirmation-race

Conversation

@realsigridjin

@realsigridjin realsigridjin commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • settle an answered cross-project session confirmation before closing readline, so y and yes reach the fork path
  • extend the issue fix(coding-agent): fail fast on cross-project --session with non-interactive stdin #756 regression through the real createSessionManager() interactive branch and verify the fork gets a new ID and the current-project cwd
  • document the fork-specific core change in packages/coding-agent/src/changes.md and the user-facing fix in the coding-agent changelog

Regression

#756 added a close fallback for unanswered confirmations. Node's readline emits close synchronously, so the previous rl.close()-then-resolve(answer) order let the fallback settle the promise as false first. An affirmative response therefore printed Aborted. instead of forking.

The production fix is the minimal ordering change: settle the parsed answer, then close readline. Cancel, empty-input, EOF, non-interactive, local-session, and explicit --fork behavior remain unchanged.

Prior work

Supersedes #1042, opened by @beengineer500, which identified the readline close-ordering race and proposed settling the confirmation before closing readline. This adaptation rebases that fix onto current main and covers it through the existing #756 cross-project session regression using the real session-fork path, without exporting the confirmation helper.

Validation

  • RED on current main: the new affirmative regression printed Aborted. and never emitted SESSION_FORKED
  • GREEN with this patch: focused issue fix(coding-agent): fail fast on cross-project --session with non-interactive stdin #756 regression, 3/3
  • related session-manager plus regression tests, 6/6
  • npm run check
  • npm run build
  • Biome on the changed TypeScript files
  • git diff --check
  • isolated zero-token senpi-qa gates:
    • common self-check, 9/9
    • RPC self-test, 4/4
    • mock-loop self-test, 48/48
    • TUI smoke, 5/5
    • CLI smoke, 8/8
  • built-CLI manual QA:
    • y created one fork with a new ID and target-project cwd
    • n and an empty answer aborted without a fork
    • an unknown session ID exited 1
    • --help exposed the session and fork options

realsigridjin and others added 2 commits August 24, 2026 09:35
Resolve affirmative answers before closing readline so the close fallback cannot abort the fork.

Ultraworked with [omo](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
Record the user-facing cross-project confirmation fix for the changelog gate.

Ultraworked with [omo](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.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.

1 participant