fix(weave): preserve typed message fields during PII redaction - #7699
Draft
ash0ts wants to merge 1 commit into
Draft
fix(weave): preserve typed message fields during PII redaction#7699ash0ts wants to merge 1 commit into
ash0ts wants to merge 1 commit into
Conversation
ash0ts
force-pushed
the
codex/hivemind-review-uri-pii
branch
from
August 6, 2026 15:45
0b58f67 to
769456d
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This was referenced Aug 6, 2026
Contributor
Author
Post-rebase validationI cleaned this draft onto current The HiveMind review mirror consumes the same fix on its combined pinned companion commit because it also needs the separate no-create initialization capability. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
I hit this while testing a private HiveMind chat review mirror with
redact_pii=True.The Conversation SDK currently serializes each typed
Message, recursively sends every string through Presidio, and then validates the result back into the typed model. That means a false positive on a protocol value can corrupt the payload before any span is emitted. In the concrete failure, Presidio classified the literal"uri"discriminator fromUriPart.typeas a person name, changed it to"<PERSON>", and Pydantic rejected the message union.This makes URI-backed conversation content impossible to log with PII redaction enabled, even when the URI itself contains no sensitive text.
What changed
"uri"as PII while also redacting an email in adjacent text. The resulting span must retain a validUriPartand contain the redacted email.Validation
23 passedintests/conversation/test_conversation_settings.pygit diff --checkpassedThis is a small companion fix for the review-mirror work in wandb/hivemind#8. It is independent of the proposed atomic historical-turn API and does not change OTLP delivery or idempotency semantics.