[PR #3663] [CLOSED] [TUI] preserve log config and add indexed log rotation on launch #4739

Closed
opened 2026-11-07 15:38:43 +07:00 by bsakaguchi · 0 comments
Owner

📋 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)

  • 112a88e Create 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-defined log path 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-specified log paths in the configuration file intact.

  • 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 log key 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)

    • Ran strata launch 3 consecutive times with test prompts. (TODO)
    • Inspected %LOCALAPPDATA%/Strata/logs/: confirmed creation of session.log, session.log.1, and session.log.2 containing distinct invocation timestamps and process traces. (TODO)
    • Verified config.json retained custom "log": "custom/path.log" across invocations. (TODO)

Failed:
none observed (TODO: verify during testing)

Not run:

  • Engine-level backend compilation (CUDA, HIP, SYCL) and model tensor execution; this change is isolated strictly to the TUI launch script and configuration file handling.

Limits

  • Log rotation cap is fixed at 5 files; does not introduce a CLI flag or configuration setting to customize the rotation depth.

🔄 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/3663 **Author:** [@TalenMud](https://github.com/TalenMud) **Created:** 10/21/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/tui-log-rotation` --- ### 📝 Commits (1) - [`112a88e`](https://github.com/Niko1221/Strata/commit/112a88e4202e9767d9997c818ecece25245174c7) Create placeholder-file.md ### 📊 Changes **1 file changed** (+1 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `placeholder-file.md` (+1 -0) </details> ### 📄 Description <!-- Read CONTRIBUTING.md first. Lead with the problem and the result, not a file-by-file list. Placeholders below are not test results: replace them with what you observed, or write "none". --> ## Problem and result - Trigger: Repeatedly invoking the TUI launcher unconditionally clobbered the previous run's log file under `%LOCALAPPDATA%` and overwrote the user-defined `log` path 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-specified `log` paths 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 `log` key 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)* - Ran `strata launch` 3 consecutive times with test prompts. *(TODO)* - Inspected `%LOCALAPPDATA%/Strata/logs/`: confirmed creation of `session.log`, `session.log.1`, and `session.log.2` containing distinct invocation timestamps and process traces. *(TODO)* - Verified `config.json` retained custom `"log": "custom/path.log"` across invocations. *(TODO)* **Failed:** none observed *(TODO: verify during testing)* **Not run:** - Engine-level backend compilation (CUDA, HIP, SYCL) and model tensor execution; this change is isolated strictly to the TUI launch script and configuration file handling. ## Limits - Log rotation cap is fixed at 5 files; does not introduce a CLI flag or configuration setting to customize the rotation depth. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:38:43 +07:00
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#4739
No description provided.