Skip to content

Add masked log export and desktop folder actions - #9714

Closed
Imagineer99 wants to merge 37 commits into
unslothai:mainfrom
Imagineer99:feat/logging-export-zip
Closed

Imagineer99 wants to merge 37 commits into
unslothai:mainfrom
Imagineer99:feat/logging-export-zip

Conversation

@Imagineer99

@Imagineer99 Imagineer99 commented Aug 25, 2026 •

Copy link
Copy Markdown
Member

Summary

  • add an authenticated endpoint that exports every Studio log as a ZIP
  • redact credentials with bounded-memory streaming, including values continued onto the next line
  • redesign Settings > Logs with a clearer preview, location, all-log actions, and refresh hierarchy
  • use the themed Studio select instead of the native light dropdown in dark mode
  • let the desktop app open the folder containing the selected backend-resolved log

Privacy and reliability

  • archive member names are relative and never expose the host path
  • ZIP creation uses bounded reads and spills beyond 8 MiB instead of retaining large logs in memory
  • desktop ZIP downloads stream from the authenticated loopback endpoint directly to the selected file instead of crossing the webview/IPC boundary as one large blob
  • desktop exports request an access-only credential and do not leave an unused refresh-token row behind
  • oversized newline-free records are omitted whole so secrets cannot cross redaction boundaries
  • multiline credential values are masked without retaining the credential as streaming context
  • files that rotate during export are reported by safe error type/errno in EXPORT_WARNINGS.txt, without absolute host paths
  • the normal viewer remains capped while explicit export includes older runner attempts

New design

Playwright capture of the redesigned Logs settings

Playwright before / after

Playwright comparison of main and PR #9714

Same deterministic 1440×900 dark-theme fixture on both sides:

  • BEFORE — main 0998656891: log viewer only; 0 log-management actions
  • AFTER — PR 5bb3ce68d: the selected file is explicitly the “Log to preview”; 2 neutral utility actions are grouped under “All logs”
  • aligned source/location controls, export privacy note, and a clearer refresh hierarchy
  • no browser errors on either side

Verification

  • 363 passed across the debug-log backend suites
  • 117 passed across the sandbox/bypass permission suite after sharing its credential-variable classifier with log export
  • frontend npm run typecheck
  • locale parity check across every translated settings catalog
  • Windows Tauri tests: 4 desktop-auth and 25 native-file-dialog tests, including authenticated streaming and opening the selected log's containing folder
  • Playwright main-vs-PR capture with pinned commits, isolated Vite processes/ports, a mocked log API, and recorded facts in meta.json
  • manual Windows desktop test: exported through the native save dialog, opened and checked the resulting valid 32-entry ZIP, and opened the logs location in Explorer

The desktop flow was manually tested on Windows. The folder-opening and native-save behavior should still be validated on macOS and Linux before treating desktop coverage as cross-platform.

UI result

The log controls now read as one flat workflow instead of nested windows. The selected source is explicitly scoped to the preview, while export and folder actions are grouped as neutral utilities for all logs. Desktop-only actions remain hidden on the web build.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 25, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 25, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 25, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 25, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 25, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 25, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 25, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 25, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 25, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 25, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 25, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 25, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 25, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@Imagineer99

Copy link
Copy Markdown
Member Author

Fixed the review-level generic session-token finding in ec55211. Structured session_token, session-token, and sessionToken fields are now classified as secrets, with regression coverage for all three aliases. The complete debug-log suite now passes 352 tests.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: ec55211a97

ℹ️ 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".

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 6d734af3b2

ℹ️ 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".

@Imagineer99

Copy link
Copy Markdown
Member Author

CI classification for the current head (6d734af3b): pre-commit.ci fails because its synthetic merge with current upstream rewrites 944 repository files. I reproduced the exact ruff-format-with-kwargs --all-files hook in a clean detached worktree at this PR head; it passes with zero changes. The PR-specific formatter delta is clean, so applying the service output would introduce unrelated upstream-wide churn.

@Imagineer99

Copy link
Copy Markdown
Member Author

Runner-infrastructure note for 6d734af3b: Core, Kaggle T4, and studiobench terminated as GitHub startup_failure runs with zero jobs/logs and are not retryable. Desktop clean-machine also ended before Build PR AppImage acquired a runner; I requested one retry and it is queued. The remaining workflows are queued as well. These runs executed no PR test step and do not indicate a code failure.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@Imagineer99

Copy link
Copy Markdown
Member Author

@codex review

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

Copy link
Copy Markdown

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: 7dc189d37d

ℹ️ 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".

Comment thread studio/backend/utils/log_redaction.py Outdated
r"(?i)" + _KEY_START + r"(?P<key>" + _SECRET_KEYS + r")\b"
r"(?P<sep>[\"']?\s*[:=]\s*)(?!<redacted>)"
r"(?!" + _PYTHON_BYTES_PREFIX + r"[\"'])"
r"(?P<val>[^\"'\s|>,;}\]][^\"'\r\n,;}\]]*)"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Redact semicolons inside unquoted credential values

When an unquoted credential itself contains a semicolon, such as password=abc;def, this pattern stops at the semicolon and both the log viewer and exported archive emit password=<redacted>;def, exposing the credential suffix. The previous matcher included semicolons in unquoted values; preserve that behavior unless the semicolon can be proven to begin a separate structured field.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in ed7b7fe: unquoted credential values now consume semicolons unless one provably starts an adjacent key/value field; regression coverage verifies both masking and field preservation.

@Imagineer99

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@Imagineer99

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: ed7b7fec93

ℹ️ 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".

@danielhanchen

Copy link
Copy Markdown
Member

The export endpoint and the redaction hardening in studio/backend/utils/log_redaction.py look like the useful core here, but the same branch also carries the Settings Logs redesign, the themed select swap and the Tauri open-folder command. Could you split it so the export path lands on its own and the desktop and UI changes follow separately?

@LeoBorcherding

Copy link
Copy Markdown
Collaborator

Closing this now that #10271 has it, with your commit on that branch as 4e7c7cd and you kept as the author. Nice work on this one, Lee. Thanks for pushing it through.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants