mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3663] [CLOSED] [TUI] preserve log config and add indexed log rotation on launch #4739
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#4739
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?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/3663
Author: @TalenMud
Created: 10/21/2026
Status: ❌ Closed
Base:
main← Head:fix/tui-log-rotation📝 Commits (1)
112a88eCreate placeholder-file.md📊 Changes
1 file changed (+1 additions, -0 deletions)
View changed files
➕
placeholder-file.md(+1 -0)📄 Description
Problem and result
Trigger: Repeatedly invoking the TUI launcher unconditionally clobbered the previous run's log file under
%LOCALAPPDATA%and overwrote the user-definedlogpath stored in the persistent configuration.Before: Starting a new session caused immediate diagnostic loss of previous run logs due to an unindexed overwrite, while also resetting custom configuration paths.
After: The launcher preserves existing run logs using an indexed backup scheme (
.log.1,.log.2, up to a 5-file cap) prior to opening a new session log, and leaves user-specifiedlogpaths in the configuration file intact.Related discussion
Issue: Closes #3656
Maintainer agreement on scope: Focused bugfix and CLI harness hygiene; keeps rotation bounded to 5 files to prevent disk sprawl without altering core engine telemetry.
Approach
Inspected the launcher startup sequence where log destinations and config paths are initialized. (TODO)
Added a pre-launch rotation check: if an active log file already exists at the target path, existing indexed copies are shifted up sequentially (e.g.
.log.4->.log.5,.log.1->.log.2), any file exceeding the 5-log cap is pruned, and the current log is moved to.log.1. (TODO)Guarded the configuration serializer to prevent ephemeral launcher arguments from overwriting the explicit persistent
logkey in the user's config file. (TODO)Validation
Passed:
python -m pytest tests/test_tui_launcher.py(or your repo test command): all tests passed, 0 failures. (TODO)Manual reproduction on commit
<YOUR_COMMIT_HASH>(Windows /<YOUR_OS>): (TODO)strata launch3 consecutive times with test prompts. (TODO)%LOCALAPPDATA%/Strata/logs/: confirmed creation ofsession.log,session.log.1, andsession.log.2containing distinct invocation timestamps and process traces. (TODO)config.jsonretained custom"log": "custom/path.log"across invocations. (TODO)Failed:
none observed (TODO: verify during testing)
Not run:
Limits
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.