Repository navigation
fix: session previews alter identifiers and examples inside inline code - #196554
liugedragon wants to merge 1 commit into
Conversation
|
Codex review: needs real behavior proof before merge. What this changesPreserve literal inline-code contents while flattening surrounding Markdown in session previews and excerpts. Example: A message contains: Use
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this PR addresses a current preview bug with a focused shared-owner fix; the overlapping PR does not yet establish safe supersession. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe shared normalizer receives Markdown message text and produces plain text for Gateway previews, sidebar narration, headlines, and excerpts before callers apply length limits. flowchart TD
A[Message Markdown] --> B[Shared plain text normalizer]
B --> C[Gateway session projection]
B --> D[Sidebar narration]
B --> E[Headlines and excerpts]
C --> F[Session list clients]
Technical reviewBest possible solution: Preserve literals in the existing shared normalizer while retaining link parsing, completed-fence handling, preview limits, and the exported link-stripper contract. Do we have a high-confidence way to reproduce the issue? Current-main transformation order and the production projection caller establish the failure path; the linked report supplies exact source-level inputs and outputs, but this read-only review executed no target code. Is this the best way to solve the issue? The patch fixes literal preservation at the existing shared owner, and its private link-parsing mode avoids changing the public behavior used by web_fetch. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2dff6d2107d4. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +26, Tests +22, Other +2. Total +50 across 4 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 Reviewed November 10, 2026, 4:37 AM ET / 09:37 UTC. |
…**/*.ts (#196547) fix: keep inline code literal in session previews Session previews changed literal code names and Markdown examples: `__init__` became init, `**/*.ts` became /*.ts and `**literal**` lost its markers. The shared normalizer that builds the stored preview, flattenMarkdownToPlainText, removed backticks first and then stripped links, line markers and bold or italic markers across the whole text, so code was treated as Markdown. Links are now stripped first with brackets inside code ignored, and each code span is held as a placeholder until stripping is done. Formatting around code still flattens, and no wording is new. Evidence: a built Gateway on node:24.22.1 in secretless Docker with a local stand-in model replying with the issue's examples, previews read through sessions.list, two runs each. Main showed "keep init, match /*.ts, and show **literal as typed"; this change shows "keep __init__, match **/*.ts, and show **literal** as typed", and the Markdown examples case is exact. Ordinary prose, the 240-character cut, emoji and a link whose address contains backticks are identical on both, and chat.history returns the original text in every run. Details: #196547 (comment). Closes #196530. Thanks @liugedragon for the report and for the link-address cases in #196554. Co-authored-by: Ayaan Zaidi <[email protected]>
|
Thanks @liugedragon for reporting #196530 and for this fix. The same change landed in #196547 (802bc3c), which was opened a few minutes earlier; it covers your test cases, including the link-address ones, and credits you. Closing this one as a duplicate. |
…**/*.ts (openclaw#196547) fix: keep inline code literal in session previews Session previews changed literal code names and Markdown examples: `__init__` became init, `**/*.ts` became /*.ts and `**literal**` lost its markers. The shared normalizer that builds the stored preview, flattenMarkdownToPlainText, removed backticks first and then stripped links, line markers and bold or italic markers across the whole text, so code was treated as Markdown. Links are now stripped first with brackets inside code ignored, and each code span is held as a placeholder until stripping is done. Formatting around code still flattens, and no wording is new. Evidence: a built Gateway on node:24.22.1 in secretless Docker with a local stand-in model replying with the issue's examples, previews read through sessions.list, two runs each. Main showed "keep init, match /*.ts, and show **literal as typed"; this change shows "keep __init__, match **/*.ts, and show **literal** as typed", and the Markdown examples case is exact. Ordinary prose, the 240-character cut, emoji and a link whose address contains backticks are identical on both, and chat.history returns the original text in every run. Details: openclaw#196547 (comment). Closes openclaw#196530. Thanks @liugedragon for the report and for the link-address cases in openclaw#196554. Co-authored-by: Ayaan Zaidi <[email protected]>
Closes #196530
Related: #184411
What Problem This Solves
Fixes session previews changing inline-code identifiers such as
__init__toinit, dropping Markdown examples, and altering globs such as**/*.ts.User Impact
Newly computed previews and excerpts retain literal code while still flattening surrounding links and emphasis. Stored messages remain unchanged.
Why This Change Was Made
The preview flattener preserves its existing single-backtick spans until prose formatting finishes. It reads link destinations from the original text first, keeping backticks, spaces, and parentheses in URLs from changing link recognition.
This fixes the lightweight preview path; #184411 fixed
web_fetchextraction. The publicstripInlineLinksbehavior and completed-fence handling stay intact. Importing the full Markdown parser here would create a dependency cycle becausemarkdown-corealready depends onnormalization-core.Evidence
Windows x64, Node.js 24.22.1, base
c96584ab3a4e34af744bbb36534a66b58c1ffe85.web_fetchextraction (62), session branch headlines (5), mention Inbox (31), and sidebar narration (45).EPERMwhen promoting an existing source directory.The local test-line ratchet remains red because of an inherited 293-line overage: base has 6,619,298 test lines against a 6,619,005 ceiling; candidate adds 22 test lines and a 22-line allocation, retaining the same overage. Base reports that overage as a notice with zero delta; candidate exits 1 for positive delta. No extra budget or unrelated test removal is included.
Validation is source-level. A packaged Gateway, browser rendering, and a live model turn were not exercised.