Skip to content

Attach Windows sandbox log to feedback reports#24623

Merged
iceweasel-oai merged 1 commit into
mainfrom
codex/windows-sandbox-feedback-log
May 26, 2026
Merged

Attach Windows sandbox log to feedback reports#24623
iceweasel-oai merged 1 commit into
mainfrom
codex/windows-sandbox-feedback-log

Conversation

@iceweasel-oai
Copy link
Copy Markdown
Collaborator

Why

Windows sandbox diagnostics are currently hard to recover from /feedback even though they are often the most useful artifact when debugging sandbox behavior. Now that sandbox logging uses daily rolling files, feedback can safely include the current day's sandbox log without uploading the old ever-growing legacy sandbox.log.

What changed

  • Add a codex-windows-sandbox helper that resolves the current daily sandbox log from codex_home.
  • When feedback is submitted with logs enabled on Windows, app-server attaches today's sandbox log if it exists.
  • Upload the attachment under the stable filename windows-sandbox.log, independent of the dated on-disk filename.
  • Keep existing raw extra_log_files behavior unchanged for rollout and desktop log attachments.

Verification

  • cargo fmt -p codex-app-server -p codex-windows-sandbox
  • cargo test -p codex-windows-sandbox current_log_file_path_for_codex_home_uses_sandbox_dir
  • cargo test -p codex-app-server windows_sandbox_log_attachment_uses_current_log
  • Manual CLI/TUI /feedback test confirmed Sentry received windows-sandbox.log.

@iceweasel-oai iceweasel-oai force-pushed the codex/windows-sandbox-feedback-log branch 2 times, most recently from 719f929 to e40c947 Compare May 26, 2026 17:42
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4ebbb28945

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@@ -93,6 +93,9 @@ tracing = { workspace = true, features = ["log"] }
tracing-subscriber = { workspace = true, features = ["env-filter", "fmt", "json"] }
uuid = { workspace = true, features = ["serde", "v7"] }

[target.'cfg(windows)'.dependencies]
codex-windows-sandbox = { workspace = true }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Badge Update the Bazel lockfile for the new dependency

This adds a new Cargo dependency, but MODULE.bazel.lock is not updated in the commit. The repo’s dependency-change instructions require just bazel-lock-update, and just bazel-lock-check runs bazel mod deps --lockfile_mode=error, so CI will fail on this lockfile drift until the regenerated MODULE.bazel.lock is committed with this Cargo.toml/Cargo.lock change.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I checked this with Bazelisk from the repo root:

  • bazel mod deps --lockfile_mode=update
  • bazel mod deps --lockfile_mode=error

No MODULE.bazel.lock diff was produced, and the error-mode check passes. This dependency edge is a first-party workspace crate dependency, so there does not appear to be lockfile drift to commit here.

Comment on lines +189 to +190
if let Some(sandbox_log_attachment) =
windows_sandbox_log_attachment(&self.config.codex_home)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Badge Disclose the sandbox log before uploading it

On Windows, consenting to upload logs now also sends windows-sandbox.log, but the TUI consent dialog still says “The following files will be sent” and only lists codex-logs.log, the doctor report, rollouts, and diagnostics (codex-rs/tui/src/bottom_pane/feedback_view.rs lines 500-528). In the /feedback flow, users who choose “Yes” therefore upload an extra daily sandbox log without seeing it in the consent file list, so this attachment should be surfaced in that consent UI before being added here.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Addressed in eee9b2add9: the TUI consent copy now says the listed files “may be sent” and includes windows-sandbox.log (Windows only, if present). I also updated the affected TUI snapshots.

Comment on lines +189 to +190
if let Some(sandbox_log_attachment) =
windows_sandbox_log_attachment(&self.config.codex_home)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Badge Avoid uploading unrelated sandbox sessions

When a Windows user has run sandboxed commands in another Codex thread or process earlier the same UTC day, this attaches the shared daily $codex_home/.sandbox/sandbox.YYYY-MM-DD.log resolved only from codex_home; the sandbox logger writes command previews from all launches into that one file, with no thread/session partition. A feedback upload for one conversation can therefore include commands and paths from unrelated sessions, so the attachment should be scoped or filtered to the session being reported before adding it automatically.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is a real limitation, but it matches the existing privacy/scope model for other feedback logs such as desktop app logs: they are app-wide diagnostics, not conversation-scoped artifacts. The sandbox log currently has no thread/session identifier to filter on, so truly scoping this would require adding new correlation data to the sandbox log writer and then filtering during feedback assembly.

For this PR, I’m treating the sandbox log as another app-wide diagnostic attachment and relying on the now-updated consent UI disclosure. We can do session-scoped sandbox logs as a separate follow-up if we decide that is required.

@iceweasel-oai iceweasel-oai force-pushed the codex/windows-sandbox-feedback-log branch 3 times, most recently from 693a515 to d978e74 Compare May 26, 2026 18:47
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.

lgtm

@iceweasel-oai iceweasel-oai force-pushed the codex/windows-sandbox-feedback-log branch from d978e74 to 8e9d82a Compare May 26, 2026 20:57
@iceweasel-oai iceweasel-oai force-pushed the codex/windows-sandbox-feedback-log branch from 8e9d82a to 9a30e47 Compare May 26, 2026 21:22
@iceweasel-oai iceweasel-oai merged commit 9826581 into main May 26, 2026
31 checks passed
@iceweasel-oai iceweasel-oai deleted the codex/windows-sandbox-feedback-log branch May 26, 2026 22:59
@github-actions github-actions Bot locked and limited conversation to collaborators May 26, 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