Skip to content

fix(logging): preserve UUID token fragments - #128258

Merged
steipete merged 1 commit into
mainfrom
steipete/fix-redaction-uuid-fragments
Aug 23, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/fix-redaction-uuid-fragments

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where a UUID fragment could accidentally match the Firecrawl token redaction pattern. When a managed image artifact ID contained a group ending in fc- followed by its final 12 hexadecimal characters, transcript redaction corrupted the ID and later media resolution returned no artifact.

Why This Change Was Made

The Firecrawl token pattern now uses the existing identifier-safe leading boundary. Real Firecrawl tokens remain redacted, while token-shaped substrings inside UUIDs and other identifiers remain intact.

AI-assisted; the patch was independently reviewed and repeatedly stress-tested.

User Impact

Managed images and other UUID-keyed artifacts no longer disappear nondeterministically because redaction altered their identifiers. Secret redaction behavior for actual Firecrawl credentials remains unchanged.

Evidence

  • Deterministic pre-fix regression transformed a UUID ending in a Firecrawl-shaped fragment into a truncated redacted ID.
  • Pre-fix managed-image integration stress reproduced on iteration 13 of 24.
  • Post-fix focused suites: 171 tests passed.
  • Exact agents-tools CI project/order: 90 files passed, 1 skipped; 2,055 tests passed, 1 skipped.
  • Post-fix stress: 24/24 iterations passed.
  • Core production and relevant logging test typechecks passed.
  • Targeted oxfmt, oxlint, and git diff --check passed.
  • Branch autoreview reported no accepted/actionable findings.
  • Production delta: +1/-1, net zero. Tests: +10/-0.

@clawsweeper

clawsweeper Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review August 23, 2026 15:48
@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Aug 23, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 23, 2026
@clawsweeper

clawsweeper Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 23, 2026, 11:54 AM ET / 15:54 UTC.

ClawSweeper review

What this changes

The PR requires a safe leading boundary before Firecrawl-shaped tokens and adds regression coverage that preserves UUID-like artifact identifiers while masking standalone tokens.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

No blocking correctness finding. Keep this protected maintainer PR open for normal exact-head CI completion; the shared boundary repair is the clean owner-level fix.

Priority: P2
Reviewed head: 9377edbf1708c21495afc63184cf11acebdf7125

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused net-neutral owner-boundary repair with a credible direct regression test.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body also records focused post-fix validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body also records focused post-fix validation.
Evidence reviewed 5 items Current-main behavior: Current main contains an unbounded Firecrawl-shaped token pattern, which can begin matching in the middle of an identifier.
Fix at the owning boundary: The PR reuses the existing identifier-safe boundary at the shared token-pattern list rather than adding media-specific handling.
Caller and masking behavior: Transcript text routes through the shared tool-payload redactor, and the redactor replaces only its selected credential capture, preserving the boundary delimiter.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs src/logging/redact-token-ordering.test.ts

Result: FAIL (partial) — step 2 expect_output redactSensitiveText token ordering: expected terminal output was not visible within 30 seconds: "redactSensitiveText token ordering"

node scripts/run-vitest.mjs src/logging/redact-token-ordering.test.ts
runner@runnervm76f27:/tmp/clawsweeper-live-proof-128258-IlNLRQ/target$ node scripts/run-vitest.mjs src/logging/redact-token-ordering.test.ts
node scripts/run-vitest.mjs src/logging/redact-token-ordering.test.ts
[test] starting test/vitest/vitest.unit-fast.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-128258-IlNLRQ/target

 ✓  unit-fast  src/logging/redact-token-ordering.test.ts (9 tests) 46ms

 Test Files  1 passed (1)
      Tests  9 passed (9)
   Start at  15:55:44
   Duration  755ms (transform 410ms, setup 110ms, import 430ms, tests 46ms, environment 0ms)

[test] passed 1 Vitest shard in 12.38s
runner@runnervm76f27:/tmp/clawsweeper-live-proof-128258-IlNLRQ/target$ node scripts/run-vitest.mjs src/logging/redact-token-ordering.test.ts
[test] starting test/vitest/vitest.unit-fast.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-128258-IlNLRQ/target

 ✓  unit-fast  src/logging/redact-token-ordering.test.ts (9 tests) 46ms

 Test Files  1 passed (1)
      Tests  9 passed (9)
   Start at  15:55:57
   Duration  444ms (transform 116ms, setup 35ms, import 197ms, tests 46ms, environment 0ms)

[test] passed 1 Vitest shard in 12.03s
runner@runnervm76f27:/tmp/clawsweeper-live-proof-128258-IlNLRQ/target$






















Assertions:

  • FAIL expect_output: redactSensitiveText token ordering

How this fits together

OpenClaw’s shared logging redactor sanitizes transcript and diagnostic text before it is retained or displayed. Agent transcript processing calls that redactor on tool-result text, so an overbroad token rule can alter opaque identifiers.

flowchart LR
A[Tool and diagnostic text] --> B[Shared redaction patterns]
B --> C[Identifier-safe boundary]
C --> D[Sanitized transcript text]
D --> E[Replay and artifact references]
Loading

Before merge

  • Complete next step (P2) - This protected maintainer PR needs normal exact-head CI completion, not a repair job.
Agent review details

Security

None.

PR surface

Source 0, Tests +10. Total +10 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 1 10 0 +10
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 11 1 +10

Review metrics

Metric Value Why it matters
Production versus test delta production +1/-1 (net 0); tests +10/-0 The repair changes one shared pattern without production growth and adds focused regression coverage.

Technical review

Best possible solution:

Keep one shared identifier-safe rule for Firecrawl-shaped tokens and retain the direct regression cases rather than adding artifact-specific exceptions.

Do we have a high-confidence way to reproduce the issue?

Yes—current source shows the unbounded pattern can match the UUID fragment, while the proposed boundary excludes it; this read-only review did not execute the regression.

Is this the best way to solve the issue?

Yes—the pattern list is the shared owner, and existing comparable vendor patterns already use the same identifier-safe boundary.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against fd4404d0b618.

Labels

Label changes:

  • add P2: This is a bounded reliability fix for transcript and artifact identifiers, with no evidence of a broad current outage.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body also records focused post-fix validation.

Label justifications:

  • P2: This is a bounded reliability fix for transcript and artifact identifiers, with no evidence of a broad current outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body also records focused post-fix validation.

Evidence

What I checked:

Likely related people:

  • steipete: History shows extensive prior work in the shared logging-redaction implementation, beyond this PR. (role: recent logging contributor; confidence: high; commits: 9377edbf1708, f59392fdf5e6; files: src/logging/redact.ts, src/logging/redact-patterns.ts)
  • pgondhi987: Recent history includes multiple focused redaction-pattern repairs in the same source surface. (role: recent redaction contributor; confidence: medium; commits: 91ea4e03faaa, c38ad6c76f35, dbb8bb47802a; files: src/logging/redact.ts, src/logging/redact-patterns.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 5355a7a into main Aug 23, 2026
297 of 298 checks passed
@steipete
steipete deleted the steipete/fix-redaction-uuid-fragments branch August 23, 2026 16:23
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant