Skip to content

improvement(logs): show Redacting status while PII masking runs#5855

Merged
TheodoreSpeaks merged 2 commits into
stagingfrom
improve/pii-redacting-status
Jul 22, 2026
Merged

improvement(logs): show Redacting status while PII masking runs#5855
TheodoreSpeaks merged 2 commits into
stagingfrom
improve/pii-redacting-status

Conversation

@TheodoreSpeaks

@TheodoreSpeaks TheodoreSpeaks commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Log-stage PII redaction runs at persist time and can take minutes on large payloads; the Logs page showed the run as Running the whole time even though execution had finished
  • The persist path now flips the log row to 'redacting' right before masking starts (only when the logs redaction stage is enabled, guarded on 'running' so a concurrent cancellation is never clobbered); the terminal update overwrites it with the final status
  • Logs UI renders an amber non-filterable Redacting badge (row + details sidebar via the shared STATUS_CONFIG), keeps polling the detail query through the phase, and keeps resolving live progress markers
  • No migration and no contract change: status is a free-text column typed z.string() in the contract

Type of Change

  • Improvement

Testing

Tested manually against a local dev stack: ran a ~25MB function-output workflow with logs-stage redaction enabled and watched the log row sit in Redacting after execution finished, then flip to the final status. 332 lib/logs tests pass. lint and check:api-validation:strict pass.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

🤖 Generated with Claude Code

https://claude.ai/code/session_01A1JYstmLHk9qMGyBDqYRcJ

@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jul 22, 2026 8:29pm

Request Review

@cursor

cursor Bot commented Jul 22, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Changes are mostly UX and a guarded, best-effort status flip before existing PII masking; masking and terminal persistence behavior are unchanged aside from the new callback.

Overview
Adds a transient redacting log status so the Logs UI reflects post-execution PII masking instead of staying on Running while large payloads are masked at persist time.

Backend: applyPiiRedaction accepts an optional onRedactionStart callback invoked right before masking. On workflow completion, that callback sets the log row to redacting only when the current status is still running (so cancellation is not overwritten); the normal terminal update still sets the final status afterward. Failures on that cosmetic update are logged and do not abort masking.

UI / API detail: LogStatus and STATUS_CONFIG gain a non-filterable amber Redacting badge. Live detail polling and Redis progress markers treat redacting like running/pending. No schema or API contract change—the status column remains free-form text.

Reviewed by Cursor Bugbot for commit 84b5766. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread apps/sim/lib/logs/execution/logger.ts Outdated
@greptile-apps

greptile-apps Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR surfaces PII masking as a distinct phase in execution logs. The main changes are:

  • Sets a guarded redacting status before logs-stage masking begins.
  • Displays an amber Redacting badge in log views.
  • Continues detail polling and live progress markers during redaction.
  • Isolates cosmetic status-write failures from masking and finalization.

Confidence Score: 5/5

This looks safe to merge.

  • The display-only status write is isolated from masking and finalization failures.
  • No blocking issue remains in the updated code.

Important Files Changed

Filename Overview
apps/sim/lib/logs/execution/logger.ts Adds a guarded redaction-phase update and prevents failures in that cosmetic write from interrupting finalization.
apps/sim/app/workspace/[workspaceId]/logs/logs.tsx Keeps the active detail query polling while a log is redacting.
apps/sim/app/workspace/[workspaceId]/logs/utils.ts Adds the Redacting display status and its badge configuration.
apps/sim/lib/logs/fetch-log-detail.ts Continues resolving live progress markers during redaction.

Reviews (2): Last reviewed commit: "fix(logs): never let the cosmetic redact..." | Re-trigger Greptile

Comment thread apps/sim/executor/execution/block-executor.ts Outdated
Comment thread apps/sim/lib/logs/execution/logger.ts
…g runs

Log-stage PII redaction happens at persist time and can take minutes on large
payloads, during which the Logs page showed the run as Running long after
execution finished. The persist path now flips the log row to 'redacting'
(guarded on 'running' so a concurrent cancellation is never clobbered) right
before the masking work starts — only when the logs redaction stage is
actually enabled — and the terminal update overwrites it with the final
status. The Logs UI renders an amber non-filterable Redacting badge (row +
details sidebar via the shared STATUS_CONFIG), keeps polling the detail query
during the phase, and keeps resolving live progress markers. No migration:
status is a free-text column, and the contract already types it as string.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A1JYstmLHk9qMGyBDqYRcJ
@TheodoreSpeaks
TheodoreSpeaks force-pushed the improve/pii-redacting-status branch from 26760f0 to 80f0783 Compare July 22, 2026 20:26
Review finding: the status flip was awaited without failure isolation, so a
transient DB error there rejected applyPiiRedaction before masking and the
terminal update never ran. The write is display-only; catch and warn instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A1JYstmLHk9qMGyBDqYRcJ
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor 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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 84b5766. Configure here.

@TheodoreSpeaks
TheodoreSpeaks merged commit b49fe16 into staging Jul 22, 2026
20 checks passed
@TheodoreSpeaks
TheodoreSpeaks deleted the improve/pii-redacting-status branch July 22, 2026 20:43
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.

1 participant