Repository navigation
perf(agents): remove automatic tool payload secret masking - #169063
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesRemoves automatic secret masking from tool and conversation payloads while retaining masking for logs and diagnostics. Example: A read tool returns API_TOKEN = computeToken().
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it implements an explicit maintainer decision, addresses source corruption and repeated masking work, and has no concrete introduced defect identified in the reviewed paths. The previous merge conflict is resolved; current CI is not green. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherTool execution feeds model context, transcript storage, history, trajectories, and presentation; logging and diagnostic exports retain a separate masking boundary. flowchart LR
A[Tool execution] --> B[Size and media preparation]
B --> C[Model context]
B --> D[SQLite transcripts]
D --> E[History and sharing]
B --> F[UI and channel progress]
A --> G[Masked logs and diagnostics]
Technical reviewBest possible solution: Land the approved cutover with diagnostic masking, live authorization, structural normalization, and the documented SDK transition preserved. Do we have a high-confidence way to reproduce the issue? Current-main source demonstrates automatic masking at read and live-result boundaries, and the supplied before images visibly show corrupted credential-shaped source; no target code was executed during this review. Is this the best way to solve the issue? Removing the masking passes and their preparation machinery coherently implements the approved direction while preserving separate diagnostic masking and existing storage and execution owners. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 08005517c47b. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfacePR surface statistics unavailable: the file list is incomplete. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (25 earlier review cycles; latest 8 shown)
Reviewed October 12, 2026, 8:33 AM ET / 12:33 UTC (Revision 26). |
9ef027a to
628dcbf
Compare
What Problem This Solves
Automatic secret masking changed source code and
.envreads between tool execution, model context, and saved history. The same payload could be scanned three to five times, consuming main-thread CPU while losing source fidelity—for example, changingAPI_TOKEN = computeToken()into an abbreviated token.User Impact
Implements Peter's explicit maintainer decision of October 11: tool arguments, results, and conversation text retain their original text in model context, transcripts, history, UI tool events, summaries, and live trajectories.
.envreads are unmasked. Logs, diagnostic/support exports, telemetry, and config/audit credential output retain masking.Media omission, size limits, empty-result placeholders, provider replay normalization, permissions, and execution authority remain. There is no new setting, dependency, schema change, or deployment.
Release-note context: transcripts and shared conversations can contain credentials. Previously masked text cannot be recovered. A private completion interrupted on an older release may reject retry when only a masked input remains: matching placeholders cannot prove unchanged input. Strict conflict rejection stays; check the prior outcome and submit a fresh request if needed.
Why This Change Was Made
Removes the payload masking passes, preparation snapshots, source exceptions, revision checks, and persistence hooks instead of adding another fast path.
logging.redactPatternsnow describes the logging/diagnostic boundary. Sharing, 1Password, Beam, tool, and SDK documentation describe the new behavior; the removedsanitizeToolArgsSDK export has a dated migration record.The cutover preserves current actor-storage binding, row identity and owner revisions, append admission, first-send/replay source envelopes, question-answer authority, and compaction ownership. The new ChatGPT V2 caller uses the same structural transcript normalizer, retaining replay/media validity and current write-authority checks.
Evidence
Measurement
Seven-round median main-thread CPU per 1,000 realistic results, using the same 33,475,321-character corpus of repository reads, grep output, and git output:
The combined path is 53.76× faster. Both versions ran on Blacksmith Testbox
tbx_01m4mherhqcpnan9jx43q1ak6w, Node 24.19, corpus SHA-2563c95b5406d726071d32f92379f2af274da57fdfd8ebc11e09003872ce836f1ad. This measures tool processing, not overall Gateway CPU.Requested production diff (
git diff --stat origin/main...HEAD -- ':!*.test.ts' ':!*test-support*' ':!docs/*'): +1,503 / −3,796, net −2,293 lines.Behavior and validation
.envand credential-shaped source for Anthropic and OpenAI. Logging tests still mask registered secrets and known token forms; diagnostic masking occurs before truncation.tbx_01m4mqgf99r13p5w6mt5c0s5zr; transcript proof passed 214 tests, and closure/CI-plan proof passed 135 tests on AWScbx_7a4f8dcbd226. Subsequent provider/plugin, worker, session, and source-fidelity groups passed on isolated remote hosts. All leases are released.Current integration and CI
Rebased onto
e358b0e0baf2d31a1260e62bb85dfac63c1b11f6. The full production cutover passed independent review in three completed passes, with no actionable findings. The paired validation used source tree4f229e20a76919a681215d8403eaecd94e12b105; later commits change test fixtures only. Candidate at that stage:678f798722d3cad6f839faa774193deb3192bf4c. A subsequent main conflict was resolved by rebasing onto12a91e0919da5832e003af177959f48d3692ae27. Final candidate:683aabdcf62b2075099f1dd5f56c6dd73226c8d8.At the maintainer's request, each formerly unqualified test file was run serially with
pnpm test <file> --maxWorkers=1on both the untouched merge-base and candidate. Both checkouts used their own dependencies, built CLI, and worker cache. These are local macOS results; normal E2E startup includes its CLI build.test/decision-typesafe-admission.integration.test.tstest/e2e/qa-lab/runtime/required-native-same-session.e2e.test.tsaDonetrue-versus-false assertionsrc/gateway/server.agent-input-authority.test.tssrc/gateway/server.sessions-send-owner-continuation.test.tssrc/gateway/server.sessions-send-resume.test.tstest/e2e/qa-lab/runtime/conversation-route-ownership.e2e.test.tssrc/gateway/server.visible-spawn-fallback.product-proof.test.tsAll 44 cases ran on each revision: 22 passed and the same 22 failed. Case-by-case comparisons checked assertions and error signatures, not only exit status. No failure was explained by a masking assertion or a redaction side effect.
The final CI run 38247900729 tested merge
33199095b3a08c1f66854e09108bf7f4f9b1beb8against main22e89d92d55fe75cb894780cd4f8b9fa27d1b44d: 120 jobs passed, 18 skipped, 19 test jobs failed plus the aggregate gate. This is an inherited-failure landing, not green CI. Build, production/test types, lint, docs, source contracts, and security passed. The automatic report cannot compare the differently named shards; its unknown rows were investigated case by case.The final main-conflict resolution retained main’s async side-effect and mention-inbox interfaces, writer-owned physical preparation, and narrow event/transaction imports. It passed fresh independent review through P2. All four affected local files passed 62/62 cases in 570.92 s, including cold worker preparation: worker transcript 15, session creation 27, append/replay 3, Agents API 17. Targeted lint/format passed.
5ac29c6clocal reproductions and natural main 38243573908; intervening source changes are outside the failing preparation path.22e89d92reproduces the duplicatetranscript-entry-anchor.tsinventory assertion: 1 failed / 16 skipped, 6.98 s. Both copies already exist on main; this lane only removes obsolete masking modules.22e89d92reproduces all four obsolete positive-SQL-count assertions, before mutation starts: 4 failed / 1 passed, 264.75 s including cold worker preparation. Main moved this getter to its prepared in-memory snapshot.5ac29c6creproduces both deletion assertions (2 failed / 65 passed, 35.32 s) and the cleared-selection catalog assertion (1 failed / 19 skipped, 42.02 s). Relevant failing paths remain unchanged.llama-cpp;highversusmedium; and the renamed async-stat guidance. Tests and determining owners match; the thinking materializer’s unrelated read change is accounted for.Session stores for agent main are unavailableerror as main 38232649109; fixture and admission owner unchanged.22e89d92reproduces the same 120000 ms timeout: 1 failed / 6 skipped, 364.32 s including cold worker preparation. Same case and source line as CI.22e89d92file replay: 3 failed / 10 passed, 229.67 s. It reproduces two physical-reader errors, including the exact direct-agent model-pin case seen in CI, and the visible CLI patch error. Other physical scenarios vary; both CLI failures also have exact older paired-main proof. No claim of identical physical-case sets.The previous CLI cancellation and plugin-warmup fixture deadlines were repaired without changing fake-clock defaults; cancellation passed 13/13 locally and full reliability 56/56. The scheduler child uses the existing 120 s E2E budget and reports error/signal on failure. Its real CI scenario passed in 34.909 s (job 114807310048). No production change was needed for these timing fixtures.
All failed job logs were read once, and every failed job has a source-bound attribution. The native version-1 exception evidence pins the exact head, tested merge, all 19 jobs, aggregate, and artifact hashes. Independent review has no actionable findings. No new lease, full local build, or CI rerun was used.
CODEOWNERS has no matching rule. Two Windows-only cases remain skipped. Previously masked history is unrecoverable. No live Gateway was changed.
Synthetic before/after