-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fix #609: Windows coding phase not starting after spec/planning #1347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
5f23e07
4aa30de
77406c3
d33993f
efafdca
18bcb83
309433f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,6 +47,7 @@ | |
| import asyncio | ||
| import io | ||
| import os | ||
| import subprocess | ||
| from pathlib import Path | ||
|
|
||
| # Configure safe encoding on Windows BEFORE any imports that might print | ||
|
|
@@ -104,6 +105,7 @@ | |
|
|
||
| init_sentry(component="spec-runner") | ||
|
|
||
| from core.platform import is_windows | ||
| from debug import debug, debug_error, debug_section, debug_success | ||
| from phase_config import resolve_model_id | ||
| from review import ReviewState | ||
|
|
@@ -369,8 +371,27 @@ def main(): | |
| print(f" {muted('Running:')} {' '.join(run_cmd)}") | ||
| print() | ||
|
|
||
| # Execute run.py - replace current process | ||
| os.execv(sys.executable, run_cmd) | ||
| # Execute run.py - use subprocess on Windows to maintain connection with Electron | ||
| # Fix for issue #609: os.execv() breaks connection on Windows | ||
| if is_windows(): | ||
| try: | ||
| result = subprocess.run(run_cmd) | ||
| sys.exit(result.returncode) | ||
| except FileNotFoundError: | ||
| debug_error("spec_runner", "Could not start coding phase - executable not found") | ||
| print_status("Could not start coding phase - executable not found", "error") | ||
| sys.exit(1) | ||
| except OSError as e: | ||
| debug_error("spec_runner", f"Error starting coding phase: {e}") | ||
| print_status(f"Error starting coding phase: {e}", "error") | ||
| sys.exit(1) | ||
| except KeyboardInterrupt: | ||
| debug_error("spec_runner", "Coding phase interrupted by user") | ||
| print("\n\nCoding phase interrupted.") | ||
| sys.exit(1) | ||
|
Comment on lines
+393
to
+396
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use print_status for KeyboardInterrupt to keep UI formatting consistent. Proposed fix- except KeyboardInterrupt:
- debug_error("spec_runner", "Coding phase interrupted by user")
- print("\n\nCoding phase interrupted.")
- sys.exit(1)
+ except KeyboardInterrupt:
+ debug_error("spec_runner", "Coding phase interrupted by user")
+ print_status("Coding phase interrupted.", "warning")
+ sys.exit(1)🤖 Prompt for AI Agents
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The existing KeyboardInterrupt handler in the same file (line 403-406) also uses except KeyboardInterrupt:
debug_error("spec_runner", "Spec creation interrupted by user")
print("\n\nSpec creation interrupted.")
print(...)The new handler follows the same pattern for consistency with the existing code. Changing this one would create inconsistency - if we want to update to
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
If you'd like to update both KeyboardInterrupt handlers to use Thanks for catching that! 👍 🧠 Learnings used |
||
| else: | ||
| # On Unix/macOS, os.execv() works correctly - replaces current process | ||
| os.execv(sys.executable, run_cmd) | ||
|
Comment on lines
374
to
399
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Please verify Windows/macOS/Linux CI coverage for this platform split. 🧰 Tools🪛 GitHub Actions: Lint[error] 378-385: ruff format check failed. 1 file would be reformatted (apps/backend/). Please run 'ruff format apps/backend/' to fix code style issues. 🤖 Prompt for AI Agents |
||
|
|
||
| sys.exit(0) | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.