fix(app): confirm before applying project from terminal#256
fix(app): confirm before applying project from terminal#256konard wants to merge 4 commits intoProverCoderAI:mainfrom
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: ProverCoderAI#255
Apply restarts the container, which kills active SSH sessions and any in-container browser (e.g. MCP Playwright). The Apply button on the terminal screen used to trigger this restart with no warning, leaving users surprised when their browser connection dropped. Match the confirmation pattern already used by Down, Delete, Down All, and Apply All: prompt the user with a message that names the project and explicitly calls out that SSH sessions and in-container browsers will end. If the user declines, no state is changed. Fixes ProverCoderAI#255
Working session summaryCI is running in the background. PR #256 is updated, marked ready, and the fix is in: #256 Summary of what shipped:
This summary was automatically extracted from the AI working session output. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost: $7.966522📊 Context and tokens usage:Claude Opus 4.7: (3 sub-sessions)
Total: (24.1K new + 269.8K cache writes + 10.3M cache reads) input tokens, 39.9K output tokens, $7.966522 cost 🤖 Models used:
📎 Log file uploaded as Gist (3591KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
🔄 Auto-restart 1/5Detected uncommitted changes from previous run. Starting new session to review and commit or discard them. Uncommitted files: Auto-restart will stop after changes are committed or discarded, or after 4 more iterations. Please wait until working session will end and give your feedback. |
🔄 Auto-restart 1/5 LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost: $0.304874📊 Context and tokens usage:
Total: (21 new + 29.2K cache writes + 178.8K cache reads) input tokens, 1.3K output tokens, $0.304874 cost 🤖 Models used:
📎 Log file uploaded as Gist (4013KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
|
CI status: 14 of 15 checks passed. The one failure — E2E (Local package CLI) — is an infrastructure flake in the
Could a maintainer re-run the failed job? I lack rerun permission on this repo. Job log: https://github.com/ProverCoderAI/docker-git/actions/runs/25594786549/job/75138761442 |
🔄 Auto-restart triggered (iteration 1)Reason: Uncommitted changes detected Starting new session to address the issues. Auto-restart-until-mergeable mode is active. This run will stop after 5 restart iterations. |
Working session summaryDone. Summary of this session:
The fix itself is unchanged: This summary was automatically extracted from the AI working session output. |
🔄 Auto-restart-until-mergeable Log (iteration 1)This log file contains the complete execution trace of the AI solution draft process. 💰 Cost: $0.941975📊 Context and tokens usage:
Total: (25 new + 63.2K cache writes + 826.1K cache reads) input tokens, 5.4K output tokens, $0.941975 cost 🤖 Models used:
📎 Log file uploaded as Gist (4668KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
This reverts commit 6b331b6.
Summary
Pressing Apply on the terminal screen used to silently restart the project container, which terminated active SSH sessions and the in-container browser (MCP Playwright). The user reported that their browser connection broke immediately after they pressed Apply, with no chance to cancel.
This PR adds a confirmation prompt to
applyProjectById, mirroring the pattern already used by Down, Delete, Down All, and Apply All. The message names the project and explicitly states that the action ends active SSH sessions and in-container browsers, so the user can knowingly opt in or back out.Fixes #255
Root cause
applyProjectByIdinpackages/app/src/web/actions-projects.tsimmediately invokedapplyProject(projectId)without any guard. Apply runsdocker compose up --force-recreate, which tears down the running container along with every process inside it (sshd, the MCP Playwright browser, etc.). Other destructive actions (runDownProject,runDeleteProject,runDownAllProjects,runApplyAllProjects) already gate themselves behindconfirmAction; Apply was the outlier.Fix
packages/app/src/web/actions-projects.tsapplyProjectConfirmMessage(label)that renders:Apply docker-git config to <label>? This restarts the container and ends active SSH sessions and in-container browsers.applyProjectByIdnow resolves the project label (usingprojectActionLabelwhen the action targets the currently-selected project, otherwise the project id) and short-circuits ifconfirmAction(...)returns false. The rest of the flow is unchanged.Tests
packages/app/tests/docker-git/actions-projects.test.tsglobalThis.confirmreturningtrueand assert the dialog was shown with the new message.confirmreturnsfalse).Full suite:
vitest runinpackages/appreports 249 passing tests;tsc --noEmitpasses.Test plan
bunx vitest run tests/docker-git/actions-projects.test.ts(5 passed)bun run typecheck