[PR #4568] [TUI] strata launch --stop: a failed stop no longer says nothing is running, and exits 1 #5092

Open
opened 2026-11-07 16:32:38 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4568
Author: @Nyarlathoteppppp
Created: 10/29/2026
Status: 🔄 Open

Base: main ← Head: fix/4398-stop-failed


📝 Commits (1)

  • 11272fd launch: a failed --stop no longer says nothing is running, and exits 1 (#4398)

📊 Changes

2 files changed (+28 additions, -4 deletions)

View changed files

📝 strata_cli/launch/cmd.py (+4 -4)
📝 tests/terminal/test_launch.py (+24 -0)

📄 Description

Problem and result

_stop_all() in strata_cli/launch/cmd.py counts only successful stops, and its elif not stopped: branch prints the same sentence as the no-targets branch. A failed stop therefore reads:

Could not stop office: leftover_process_not_ended.
Nothing from `strata launch` is running.

and strata launch --stop returns 0 whatever happened.

After the change a failed stop prints only the Could not stop … line and --stop exits 1, also when another launch in the same call stopped fine. Nothing running and all stops succeeding keep today's output and exit 0.

Fixes #4398. The issue leaves the exit code to you; I went with 1 so a script that gates a re-launch on --stop does not go on to hit the port the leftover engine still holds. Easy to drop if you prefer 0.

Approach

Count failed stops next to successful ones; print "Nothing … is running" only when nothing was stopped and nothing failed; return 1 when any stop failed.

Validation

Passed:

  • python -m pytest tests/terminal/test_launch.py: two new tests (failed stop with and without --preset, as subtests; one failed plus one successful stop) fail on 46c152a and pass with the fix. The file's other 2 failures (test_the_apps_own_installer_arguments, test_the_access_help_names_the_flags_for_showing_and_setting_a_key) fail on 46c152a too.
  • python -m pytest tests/terminal/test_launch_dsv41.py tests/terminal/test_tui_stress_launch.py tests/terminal/test_dsv41_tui_items.py tests/terminal/test_launch_show_key_setup.py: 59 passed, 2 failed, the same as on 46c152a.
  • Environment: macOS 26 (Darwin 25.5) arm64, Apple M1 Pro, Python 3.14.7 venv with requirements.txt + pytest, base 46c152a.

Failed:
none beyond the pre-existing failures above.

Not run:
full test suite, Windows/Linux, a real engine that refuses to stop.

Limits

--stop now exits 1 on a failed stop; a caller that treated any --stop as success will see that.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/4568 **Author:** [@Nyarlathoteppppp](https://github.com/Nyarlathoteppppp) **Created:** 10/29/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/4398-stop-failed` --- ### 📝 Commits (1) - [`11272fd`](https://github.com/Niko1221/Strata/commit/11272fd3391c158f99062735d2deae8263c5ea33) launch: a failed --stop no longer says nothing is running, and exits 1 (#4398) ### 📊 Changes **2 files changed** (+28 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `strata_cli/launch/cmd.py` (+4 -4) 📝 `tests/terminal/test_launch.py` (+24 -0) </details> ### 📄 Description ## Problem and result `_stop_all()` in `strata_cli/launch/cmd.py` counts only successful stops, and its `elif not stopped:` branch prints the same sentence as the no-targets branch. A failed stop therefore reads: ``` Could not stop office: leftover_process_not_ended. Nothing from `strata launch` is running. ``` and `strata launch --stop` returns 0 whatever happened. After the change a failed stop prints only the `Could not stop …` line and `--stop` exits 1, also when another launch in the same call stopped fine. Nothing running and all stops succeeding keep today's output and exit 0. ## Related discussion Fixes #4398. The issue leaves the exit code to you; I went with 1 so a script that gates a re-launch on `--stop` does not go on to hit the port the leftover engine still holds. Easy to drop if you prefer 0. ## Approach Count failed stops next to successful ones; print "Nothing … is running" only when nothing was stopped and nothing failed; return 1 when any stop failed. ## Validation **Passed:** - `python -m pytest tests/terminal/test_launch.py`: two new tests (failed stop with and without `--preset`, as subtests; one failed plus one successful stop) fail on `46c152a` and pass with the fix. The file's other 2 failures (`test_the_apps_own_installer_arguments`, `test_the_access_help_names_the_flags_for_showing_and_setting_a_key`) fail on `46c152a` too. - `python -m pytest tests/terminal/test_launch_dsv41.py tests/terminal/test_tui_stress_launch.py tests/terminal/test_dsv41_tui_items.py tests/terminal/test_launch_show_key_setup.py`: 59 passed, 2 failed, the same as on `46c152a`. - Environment: macOS 26 (Darwin 25.5) arm64, Apple M1 Pro, Python 3.14.7 venv with requirements.txt + pytest, base `46c152a`. **Failed:** none beyond the pre-existing failures above. **Not run:** full test suite, Windows/Linux, a real engine that refuses to stop. ## Limits `--stop` now exits 1 on a failed stop; a caller that treated any `--stop` as success will see that. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#5092
No description provided.