[codex] sanitize ACP native event diagnostics#3417
Conversation
Co-authored-by: codex <codex@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Approved This PR sanitizes ACP native event diagnostics to prevent sensitive data from being logged, replacing raw error objects and payloads with structural summaries (type names, sizes, counts). The changes are well-tested and limited to logging output, with the author being the primary maintainer of the affected files. You can customize Macroscope's approvability policy. Learn more. |
Summary
errorTaghelper for untyped failuresValidation
vp test packages/shared/src/observability.test.ts apps/server/src/provider/acp/AcpNativeLogging.test.ts apps/server/src/provider/Layers/EventNdjsonLogger.test.ts(18 tests)vp check(passes with existing warnings)vp run typecheckNote
Medium Risk
Changes what gets persisted in provider observability logs (less detail for debugging) but reduces leakage of session/protocol secrets; write-path interrupt behavior is explicitly preserved.
Overview
Provider observability logs no longer carry raw ACP or filesystem failure details. Native request/protocol records and NDJSON writer warnings are reduced to bounded metadata (payload shape, byte lengths, validated method names,
errorTag,reasonCount) instead of full payloads,Cause.prettyoutput, or nested error objects.ACP native logging adds
summarizePayload/formatProtocolLogPayloadso secrets in prompts, tokens, and wire JSON are not written to thread logs. Write failures are handled withcatchCause: interruptions propagate; other defects log structural tags only.EventNdjsonLoggerapplies the sameerrorTagpattern for serialization and I/O warnings.packages/sharedexportserrorTagwith structural-tag validation (replacing inline tag/name extraction used bycauseErrorTag). Tests assert secrets stay out of serialized log output and interruption semantics are preserved.Reviewed by Cursor Bugbot for commit d3567de. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Sanitize ACP native event diagnostics by replacing raw error objects with bounded structural tags
errorTagto observability.ts that converts arbitrary error values into bounded structural tag strings (1–128 chars,[A-Za-z][A-Za-z0-9._:/-]*), used bycauseErrorTag.errorTag(error)instead of raw error objects on serialization, sink init, flush, and directory creation failures.errorTag/reasonCountinstead of raw payloads orCause.prettyoutput.makeAcpNativeLoggerFactory: interruptions propagate viaEffect.interrupt; non-interrupt failures emit a bounded warning.Macroscope summarized d3567de.