[GH-ISSUE #4398] [TUI] strata launch --stop prints "Nothing is running" right after a failed stop — and always exits 0 #1952

Closed
opened 2026-11-04 01:55:33 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @TheHubUser4860938 on GitHub (Oct 28, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4398

Problem: strata_cli/launch/cmd.py:499-506. stopped counts only SUCCESSFUL stops, so a failed stop lands in elif not stopped: — which prints the SAME sentence as the no-targets branch: the two branches are literally the same statement. A failed stop therefore reads "Could not stop office: ." followed by "Nothing from strata launch is running." And return 0 is unconditional: exit 0 whether something stopped, nothing ran, or a stop FAILED.

Environment:
Strata Version: 0.2.7 (source checkout at tag v0.2.7, commit 5e8a4cca; the file discussed is byte-identical to the tag)
OS: Linux x86-64
Runtime: Python 3.14
Reported from the Strata-Mnemosyne fork's merged tree; the offending code is upstream's own.

Reproduce (measured): with runtime.status → ready and runtime.stop → {ok: False, error: leftover_process_not_ended}, --stop printed:

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

Expected: no contradiction; a failed stop should not read as "nothing is running", and scripts/agents gating on the exit code should not proceed to re-launch onto a port the leftover engine still holds (they then eat the check_port_free refusal). Whether the exit code should turn nonzero on a failed stop is your call — the identical-branch message looks unintended either way.

Reproduction status: measured at function level.

Originally created by @TheHubUser4860938 on GitHub (Oct 28, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4398 Problem: strata_cli/launch/cmd.py:499-506. `stopped` counts only SUCCESSFUL stops, so a failed stop lands in `elif not stopped:` — which prints the SAME sentence as the no-targets branch: the two branches are literally the same statement. A failed stop therefore reads "Could not stop office: <error>." followed by "Nothing from `strata launch` is running." And `return 0` is unconditional: exit 0 whether something stopped, nothing ran, or a stop FAILED. Environment: **Strata Version:** 0.2.7 (source checkout at tag v0.2.7, commit 5e8a4cca; the file discussed is byte-identical to the tag) **OS:** Linux x86-64 **Runtime:** Python 3.14 Reported from the Strata-Mnemosyne fork's merged tree; the offending code is upstream's own. Reproduce (measured): with `runtime.status` → ready and `runtime.stop` → `{ok: False, error: leftover_process_not_ended}`, `--stop` printed: ``` Could not stop office: leftover_process_not_ended. Nothing from `strata launch` is running. return code: 0 ``` Expected: no contradiction; a failed stop should not read as "nothing is running", and scripts/agents gating on the exit code should not proceed to re-launch onto a port the leftover engine still holds (they then eat the check_port_free refusal). Whether the exit code should turn nonzero on a failed stop is your call — the identical-branch message looks unintended either way. Reproduction status: measured at function level.
Author
Owner

@Nyarlathoteppppp commented on GitHub (Oct 29, 2026):

I have a fix with a regression test that fails before and passes after; opening a PR shortly.

<!-- gh-comment-id:6486799498 --> @Nyarlathoteppppp commented on GitHub (Oct 29, 2026): I have a fix with a regression test that fails before and passes after; opening a PR shortly.
Author
Owner

@Niko1221 commented on GitHub (Nov 5, 2026):

Hello TheHubUser4860938,

Thank you. In Strata 0.2.11 strata launch --stop counts a failed stop separately, prints "Nothing from strata launch is running." only when there was nothing to stop, and exits 1 when any stop failed, including a mixed result. We reused the existing wording. If a stop fails and the exit code is still 0 on 0.2.11, please send the lines it printed.

The Strata project

<!-- gh-comment-id:6658435601 --> @Niko1221 commented on GitHub (Nov 5, 2026): Hello TheHubUser4860938, Thank you. In Strata 0.2.11 `strata launch --stop` counts a failed stop separately, prints "Nothing from strata launch is running." only when there was nothing to stop, and exits 1 when any stop failed, including a mixed result. We reused the existing wording. If a stop fails and the exit code is still 0 on 0.2.11, please send the lines it printed. The Strata project
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#1952
No description provided.