mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 21:05:40 +07:00
[GH-ISSUE #4396] [TUI] One unreadable profile file blinds kept_key(): strata launch silently mints a NEW API key #1956
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#1956
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/4396
Problem: kept_key() (strata_cli/launch/access.py:342) indexes
row["source_config"]for every launch profile, butprofiles.list_profiles()returns{"id", "error"}rows — without that key — for every profile file that fails to load (strata_cli/profiles.py:178-179). The KeyError is swallowed by the catch-all at access.py:352 (except Exception: return None), so the WHOLE key lookup dies, not just the bad row.apply_defaultsthen doess.api_key = kept or access.new_key()— exactly what the function's own docstring exists to prevent ("the key an earlier launch already made, so a restart does not invalidate the apps set up with it"). Note updater.py:718 reads the same rows defensively with.get("source_config")— this loop does not.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 at function level): three launch profiles, one damaged (
echo 'NOT JSON' > ~/.config/strata/profiles/launch-bad.json), another carryingapi_keyin its run config: kept_key() returned None; after deleting only the damaged file it returned the stored key. End-to-end:strata launch --preset <existing> --access lan --no-tuiwould mint a fresh key (not run here: it would download; the branch is measured).Expected: a damaged or foreign profile costs at most its own row; the existing key is kept.
Actual: the lookup dies, a new key is minted, and every app configured with the old key gets 401 until someone re-runs
strata launch --show-key.Reproduction status: measured at function level; end-to-end untested.
@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. In Strata 0.2.11 an unreadable profile no longer makes
strata launchmint a new API key: that row is skipped when the kept key is looked up, and a launch whose own profile or run config cannot be read stops before anything is written, so the key every app was set up with is not replaced. Reproduced on the old code and checked again on a Linux box with files set to mode 000. If a new key still appears on 0.2.11, tell us whetherstrata launchprinted "A new API key was made".The Strata project