Skip to content

fix: avoid shared rotating logs on Windows#2354

Open
he-yufeng wants to merge 1 commit into
MoonshotAI:mainfrom
he-yufeng:fix/windows-process-log-files
Open

fix: avoid shared rotating logs on Windows#2354
he-yufeng wants to merge 1 commit into
MoonshotAI:mainfrom
he-yufeng:fix/windows-process-log-files

Conversation

@he-yufeng
Copy link
Copy Markdown

@he-yufeng he-yufeng commented May 23, 2026

Summary

  • use per-process log files on Windows (kimi.<pid>.log) so concurrent CLI/web/worker processes do not rotate the same open kimi.log
  • keep the existing shared kimi.log path on non-Windows platforms
  • point fatal-error messages at the effective log path and keep CLI error snapshots stable across Rich box styles

To verify

  • uv run pytest tests\e2e\test_cli_error_output.py tests\utils\test_logging.py -q
  • uv run python -m py_compile src\kimi_cli\app.py src\kimi_cli\cli\__init__.py src\kimi_cli\utils\logging.py tests\utils\test_logging.py tests\e2e\test_cli_error_output.py
  • uv run ruff check src\kimi_cli\app.py src\kimi_cli\cli\__init__.py src\kimi_cli\utils\logging.py tests\utils\test_logging.py tests\e2e\test_cli_error_output.py
  • uv run ruff format --check src\kimi_cli\app.py src\kimi_cli\cli\__init__.py src\kimi_cli\utils\logging.py tests\utils\test_logging.py tests\e2e\test_cli_error_output.py
  • git diff --check

Fixes #2348


Open in Devin Review

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Loguru rotation fails with PermissionError on Windows when multiple kimi processes run

1 participant