Skip to content

revert: PR #2666 ACP retry/reconnect logic#2792

Merged
tanzhenxin merged 1 commit intomainfrom
revert/pr-2666
Apr 1, 2026
Merged

revert: PR #2666 ACP retry/reconnect logic#2792
tanzhenxin merged 1 commit intomainfrom
revert/pr-2666

Conversation

@tanzhenxin
Copy link
Copy Markdown
Collaborator

Summary

The stdout readiness check introduced in #2666 doesn't work with the CLI relaunch wrapper. The CLI spawns a child process via relaunchAppInChildProcess(), and the actual ACP stdout data comes from the grandchild process — the parent never writes to stdout, causing every connection attempt to time out after 10s.

This restores the v0.13.2 behavior (simple 1s delay) which works reliably.

Test plan

  • Install the VSCode extension and verify it connects on startup without timeout errors
  • Verify no SIGTERM errors in the extension output channel

…-logic"

This reverts commit cd47e9b, reversing
changes made to 449a421.
Copy link
Copy Markdown
Collaborator

@pomelo-nwu pomelo-nwu left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

📋 Review Summary

This PR reverts the retry/reconnect logic introduced in #2666, which caused timeout issues when the CLI relaunch wrapper spawns a grandchild process. The revert restores the simpler v0.13.2 behavior with a 1-second delay instead of the complex stdout readiness check. Overall, this is a well-scoped revert that addresses a real architectural mismatch between the readiness check and the process hierarchy.

🔍 General Feedback

  • The revert is clean and properly removes all related retry/reconnect infrastructure across 6 files
  • Good test coverage cleanup - removed tests are specifically for the reverted functionality
  • The simplification from a 10-second stdout readiness check back to a 1-second delay is pragmatic given the grandchild process architecture
  • Positive that the PR includes a clear test plan for verification

🎯 Specific Feedback

🟡 High

  • File: packages/vscode-ide-companion/src/services/acpConnection.ts:184 - The change from a 10-second stdout readiness check to a fixed 1-second delay (setTimeout) trades reliability for compatibility. While this fixes the grandchild process issue, consider adding a comment explaining why the stdout check doesn't work with the relaunch wrapper architecture, so future maintainers understand this isn't just a lazy implementation.

  • File: packages/vscode-ide-companion/src/services/qwenAgentManager.ts - The removal of the onDisconnected handler means there's no automatic reconnection logic at all now. If the ACP process crashes unexpectedly, users will need to manually reconnect. Consider whether a simpler reconnection strategy (without the complex retry logic) might still be valuable.

🟢 Medium

  • File: packages/vscode-ide-companion/src/services/acpConnection.ts:368-383 - The initialize timeout handling was also removed (lines 380-397 in the original). The comment says "Race the SDK initialize against process exit" but the timeout promise that enforced the 15-second limit is now gone. This means the initialize could potentially hang indefinitely. Consider keeping the timeout logic even without the retry infrastructure.

  • File: packages/vscode-ide-companion/src/webview/providers/WebViewProvider.ts:882-884 - The error message was simplified from showing a "Retry Connection" button to just a warning message. This reduces user agency when connection fails. The old flow allowed users to retry directly from the notification.

🔵 Low

  • File: packages/vscode-ide-companion/src/services/acpConnection.ts - Consider adding a TODO or FIXME comment near the 1-second delay noting that a more robust readiness detection mechanism might be desirable in the future, perhaps one that works with the grandchild process architecture.

  • File: packages/vscode-ide-companion/src/services/qwenConnectionHandler.test.ts - Test file could benefit from a comment explaining why the tests were simplified (reverting from connectWithRetry to connect), to help future maintainers understand the evolution.

✅ Highlights

  • Clean revert that removes all traces of the retry/reconnect infrastructure consistently across implementation and test files
  • Good identification of the root cause: the parent process never writes to stdout when using relaunchAppInChildProcess(), making the stdout readiness check fundamentally incompatible
  • The PR body clearly explains the technical reason for the revert and includes a test plan
  • Removing 465 lines while only adding 19 shows good discipline in not over-engineering the solution

@tanzhenxin tanzhenxin merged commit 52282c3 into main Apr 1, 2026
3 of 4 checks passed
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.

2 participants