Attach Windows sandbox log to feedback reports (#24623)

## 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`.
This commit is contained in:
iceweasel-oai authored and GitHub committed 2026-05-26 15:59:25 -07:00
1 parent 46391f7efa
commit 9826581e7b
12 files changed
+131 -1

No files matched your search

@@ -1,5 +1,6 @@
---
source: tui/src/chatwidget/tests/popups_and_settings.rs
assertion_line: 2562
expression: popup
---
Upload logs?
@@ -7,6 +8,7 @@ expression: popup
The following files will be sent:
• codex-logs.log
• codex-doctor-report.json
• windows-sandbox.log
• auto-review-rollout-thread-1.jsonl
• codex-connectivity-diagnostics.txt
@@ -2621,6 +2621,7 @@ async fn feedback_upload_consent_popup_snapshot() {
crate::app_event::FeedbackCategory::Bug,
chat.current_rollout_path.clone(),
Some("auto-review-rollout-thread-1.jsonl".to_string()),
/*include_windows_sandbox_log*/ true,
&codex_feedback::FeedbackDiagnostics::new(vec![codex_feedback::FeedbackDiagnostic {
headline: "Proxy environment variables are set and may affect connectivity."
.to_string(),
@@ -2641,6 +2642,7 @@ async fn feedback_good_result_consent_popup_includes_connectivity_diagnostics_fi
crate::app_event::FeedbackCategory::GoodResult,
chat.current_rollout_path.clone(),
Some("auto-review-rollout-thread-1.jsonl".to_string()),
/*include_windows_sandbox_log*/ false,
&codex_feedback::FeedbackDiagnostics::new(vec![codex_feedback::FeedbackDiagnostic {
headline: "Proxy environment variables are set and may affect connectivity."
.to_string(),