Repository navigation
refactor(agents): reuse thinking block predicate - #130001
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 4:56 AM ET / 08:56 UTC. ClawSweeper reviewWhat this changesThe PR replaces replay sanitization’s local thinking-block classifier with the shared predicate and updates the assertion-safety baseline. Merge readinessNo blocking correctness or security finding: the patch removes a byte-equivalent duplicate and keeps the shared classifier as the sole owner. This maintainer-labeled PR remains open for normal exact-head CI completion. Priority: P3 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherReplay sanitization prepares stored assistant tool-call turns before provider submission. It uses thinking-block classification to preserve safe signed-thinking turns or remove invalid replay content. flowchart LR
A[Stored assistant messages] --> B[Replay sanitization]
B --> C[Shared thinking classifier]
C --> D{Safe signed replay?}
D --> E[Preserve provider-owned turn]
D --> F[Repair or remove invalid content]
E --> G[Provider stream]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource -7, Other 0. Total -7 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the shared predicate as the single classifier and merge only after the exact-head required checks complete green. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR is an internal behavior-preserving refactor, not a report of a user-facing failure. Is this the best way to solve the issue? Yes: reusing the existing shared classifier is the narrowest maintainable solution and avoids duplicate policy drift. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ff73ba5f566f. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
Co-authored-by: Amp <[email protected]>
What Problem This Solves
Removes a stale private copy of the shared thinking-block classifier from replay sanitization. The duplicate could drift from the canonical definition already used by transcript repair, tool-call ID handling, and embedded turn validation.
Why This Change Was Made
Replay sanitization now calls the existing private
isThinkingLikeBlockowner directly. The recognized block types and both replay decision points are unchanged; the assertion-safety ratchet shrinks by one to reflect the deleted assertion.Alternatives considered: keeping the replay-local alias preserves duplicate policy, while creating another helper would add a third owner. Reusing the existing zero-dependency canonical predicate is the smallest coherent change.
User Impact
No user-visible or agent-behavior change. This reduces private production code and keeps one canonical definition for
thinkingandredacted_thinkingblocks.Production LOC: +3/-10 (net -7)
Tests: +0/-0
Tooling metadata: +1/-1
Base:
3a759c85c5862b4d95c6d873b3e33c544ee14827Reviewed head:
4bd426493554af6faa24d39f9b5b6e0611bd4083Evidence
pnpm check:changed: passed, including formatting, assertion ratchet, dead-export scan, core/core-test typechecks, lint, and import-cycle checks.git diff --check: passed.32949901184completed with 127 successful and 20 skipped jobs; PR rollup recorded 151 successful, 45 skipped, and 1 neutral check.