Skip to content

[codex] Use rolling files for Windows sandbox logs#24117

Merged
iceweasel-oai merged 1 commit into
mainfrom
codex/windows-sandbox-rolling-logs
May 22, 2026
Merged

[codex] Use rolling files for Windows sandbox logs#24117
iceweasel-oai merged 1 commit into
mainfrom
codex/windows-sandbox-rolling-logs

Conversation

@iceweasel-oai
Copy link
Copy Markdown
Collaborator

Why

Windows sandbox diagnostics currently append to a single sandbox.log under CODEX_HOME/.sandbox. That file never rolls over, which makes it hard to safely include sandbox diagnostics in future feedback reports without risking unbounded growth.

What changed

  • Replaced direct append-open sandbox logging with tracing_appender::rolling::RollingFileAppender.
  • Configured sandbox logs to rotate daily using names like sandbox.YYYY-MM-DD.log.
  • Added a conservative MAX_LOG_FILES cap of 90 retained matching log files.
  • Routed the Windows sandbox setup helper through the same rolling writer.
  • Added helpers for resolving the current daily sandbox log path so future feedback upload work can use the same filename logic.
  • Updated tests and test diagnostics to read the dated daily log file.

This intentionally does not include sandbox logs in /feedback yet; scrubbing and attachment behavior can happen in a follow-up.

Testing

  • cargo fmt -p codex-windows-sandbox
  • cargo check -p codex-windows-sandbox
  • cargo test -p codex-windows-sandbox
  • cargo test -p codex-windows-sandbox logging::tests
  • cargo clippy -p codex-windows-sandbox --all-targets -- -D warnings

Copy link
Copy Markdown

@zm-oai zm-oai left a comment

Choose a reason for hiding this comment

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

ship it

@iceweasel-oai iceweasel-oai merged commit 5b1b6a2 into main May 22, 2026
31 checks passed
@iceweasel-oai iceweasel-oai deleted the codex/windows-sandbox-rolling-logs branch May 22, 2026 18:37
@github-actions github-actions Bot locked and limited conversation to collaborators May 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants