mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4395] [TUI] running_launches(): prof is read outside the try that binds it — traceback, or the wrong launch's config #1954
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#1954
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @TheHubUser4860938 on GitHub (Oct 28, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4395
Problem: in strata_cli/launch/cmd.py:612-619,
profis bound inside the try and the except sets onlyov = {}— but line 620 readsprof.get("source_config")AFTER the try, unguarded. Ifprofiles.load()raises for a profile whose RUNTIME state is ready/starting (status comes from the runtime state file, independent of the profile file): the first such row raises UnboundLocalError — a NameError, not a ValueError — which escapes bothrun_launch's handlers and_run's (ValueError/BrokenPipeError/OSError/ClientError/KeyboardInterrupt) → raw traceback fromstrata launch --status,--show-key,connect. On a LATER bad row,profstill holds the PREVIOUS profile's dict, so the row reports another launch'ssource_config— and launch_info() reads the API key from that wrong config.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.statusstubbed to ready and exactly one profile present whose overrides are invalid (e.g.overrides.portas a string — profiles are owner-editable by design, and validate_overrides demands int):UnboundLocalError: cannot access local variable 'prof' where it is not associated with a value.Expected: one damaged profile costs at most that row (or a clean one-line error).
Actual: traceback, or another launch's config reported for this row.
Reproduction status: crash measured at function level; the mis-attribution case read from the code. An AST sweep of strata_cli/ + strata_control/ (~34k lines) for this try-binding pattern found this as the only hit in scope.
@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.
@Niko1221 commented on GitHub (Nov 5, 2026):
Hello TheHubUser4860938,
Thank you for tracing this to the line. In Strata 0.2.11 a damaged launch profile gets its own defaults when launches are listed, and never shows the previous row's config or port. We reproduced it on the old code with real temporary profiles in both orders and the new tests pass. If you still see another launch's settings on a damaged profile, please send the output of
strata launch --statuswith the profile names changed if needed.The Strata project