Repository navigation
Conversation
|
Codex review: needs changes before merge. Reviewed June 30, 2026, 1:14 PM ET / 17:14 UTC. Summary PR surface: Source +42, Tests +149. Total +191 across 5 files. Reproducibility: yes. source-reproducible: current main still projects chat.history through directive-only stripping and truncation without the shared history reasoning sanitizer. I did not run the original Windows WebChat plus Gemini heartbeat sequence in this read-only review. Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof path suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Port or rebase the bounded gateway/shared sanitizer onto current main, preserve exact tool payloads and current sanitizer improvements, then validate chat.history projection before merge. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main still projects chat.history through directive-only stripping and truncation without the shared history reasoning sanitizer. I did not run the original Windows WebChat plus Gemini heartbeat sequence in this read-only review. Is this the best way to solve the issue? Yes, as a fix shape: gateway history projection is the right layer because it owns bounded transcript history returned to WebChat. The branch still needs rebase or porting before the implementation can be considered merge-ready. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f284ce3b4df7. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +42, Tests +149. Total +191 across 5 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
Review history (1 earlier review cycle)
|
39ff6ee to
6888ec4
Compare
|
@clawsweeper re-review |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
6888ec4 to
2176a75
Compare
2176a75 to
cb1f220
Compare
|
Great work on this PR! The changes look clean and well-structured. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing due to inactivity. |
Summary
What problem does this PR solve?
historysanitizer before applying the chat-history text cap.<final>and<final/>as visible-answer boundaries for strict unclosed reasoning recovery, while recursively sanitizing any later reasoning tags.Why does this matter now?
<thinking>content and...(truncated)...after a history reload/heartbeat.What is the intended outcome?
What is intentionally out of scope?
What does success look like?
chat.historyno longer returns raw thinking/final tags or private reasoning text for the reported malformed transcript shape.What should reviewers focus on?
src/gateway/chat-display-projection.tsassistant display text path vs. exact tool payload path.src/shared/text/reasoning-tags.tsstrict-mode recovery for unclosed reasoning followed by final tags.Linked context
Which issue does this close?
Closes #90692
Which issues, PRs, or discussions are related?
Related #90692
Was this requested by a maintainer or owner?
Maintainer follow-up from the ClawSweeper source-repro review on #90692.
Real behavior proof (required for external PRs)
chat.historyreload/projection sanitizes assistant reasoning/final scaffolding before truncating history text, preventing raw<thinking>tags or private reasoning text from appearing after reload.tsxand run against a transcript-shaped assistant message.node --import tsx - <<'EOF' ... import { projectChatDisplayMessages } from './src/gateway/chat-display-projection.ts'; ... EOF{ "projectedText": "\nVisible answer after reasoning. Visible answer after reasoning. Visible answer after reasoning.\n...(truncated)...", "hasThinkingTag": false, "hasFinalTag": false, "hasPrivateReasoning": false, "hasTruncationMarker": true }hasThinkingTag,hasFinalTag, andhasPrivateReasoningare allfalse.crabboxbinary was available in PATH or at../crabbox/bin/crabbox; focused local gateway/shared/UI checks, oxlint, tsgo, and autoreview were run instead.chat-display-projection, which can expose malformed reasoning tags on history reload.Tests and validation
Which commands did you run?
node --import tsx - <<'EOF' ... projectChatDisplayMessages(...) ... EOFnode scripts/run-vitest.mjs src/shared/text/assistant-visible-text.test.tsnode --no-maglev node_modules/vitest/vitest.mjs run --config test/vitest/vitest.gateway-methods.config.ts src/gateway/server-methods/server-methods.test.ts -t "sanitizeChatHistoryMessages" --reporter=dotnode --no-maglev node_modules/vitest/vitest.mjs run --config test/vitest/vitest.gateway-server.config.ts src/gateway/server.chat.gateway-server-chat-b.test.ts -t "chat.history" --reporter=dotnode --no-maglev node_modules/vitest/vitest.mjs run --config test/vitest/vitest.ui.config.ts ui/src/ui/format.test.ts --reporter=dotgit diff --check upstream/main...HEADnode_modules/.bin/oxlint src/gateway/chat-display-projection.ts src/gateway/server-methods/server-methods.test.ts src/gateway/server.chat.gateway-server-chat-b.test.ts src/shared/text/assistant-visible-text.test.ts src/shared/text/reasoning-tags.tsnode scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfonode scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core-test.tsbuildinfo.agents/skills/autoreview/scripts/autoreview --mode branch --base upstream/mainWhat regression coverage was added or updated?
<final>and<final/>, including later nested reasoning tags after the recovered final boundary.text, assistant text content blocks, truncation after sanitization, and exact tool payload preservation.chat.historyRPC test for transcript-backed reload projection withmaxChars.What failed before this fix, if known?
If no test was added, why not?
Risk checklist
Did user-visible behavior change? (
Yes/No)Yes. Assistant history display hides reasoning/final scaffolding before truncation.
Did config, environment, or migration behavior change? (
Yes/No)No.
Did security, auth, secrets, network, or tool execution behavior change? (
Yes/No)Yes, security-relevant display sanitization changed to reduce reasoning leakage in history projection. No auth/secrets/network/tool execution behavior changed.
What is the highest-risk area?
Over-sanitizing non-assistant or tool payload text that should remain exact.
How is that risk mitigated?
The new sanitizer is only applied to assistant display text paths and mixed assistant text projection; exact tool payload branches continue to use the previous directive-only path and have regression coverage.
Current review state
What is the next action?
Ready for maintainer and ClawSweeper review.
What review or CI state should maintainers know about?
Local focused checks, oxlint, core tsgo, and autoreview are clean. Crabbox/Testbox changed gate is not available in this environment because the Crabbox binary is missing.