Repository navigation
fix(line): preserve semantic indentation in fenced code - #117996
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 2, 2026, 9:54 AM ET / 13:54 UTC. ClawSweeper reviewWhat this changesThe PR changes LINE fenced-code cards to retain leading indentation while still removing trailing whitespace, with regression coverage for spaces, tabs, Unicode, and terminal newlines. Merge readinessKeep this PR open for normal maintainer landing. Current Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s LINE plugin parses outbound Markdown into an intermediate representation, turns fenced blocks into Flex code cards, and sends those cards through normal reply and outbound delivery. The changed extraction boundary determines the exact code text recipients see. flowchart LR
A[Assistant Markdown reply] --> B[LINE Markdown parser]
B --> C[Fenced code span]
C --> D[LINE code-card conversion]
D --> E[Flex code card]
E --> F[LINE delivery]
Before merge
Agent review detailsSecurityNone. PR surfaceSource 0, Tests +26. Total +26 across 2 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the owner-boundary Do we have a high-confidence way to reproduce the issue? Yes. Passing a fenced block containing leading spaces or tabs through Is this the best way to solve the issue? Yes. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0ac3368c8f44. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
@clawsweeper re-review — exact-head parent-red/233-test-green, real LINE SDK, loopback delivery, extension production+test types, and clean P0–P3 review evidence are already in the PR body. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
* origin/main: fix(ui): label Gateway connection settings for accessibility (#118000) ci(qa): extend profile evidence timeout (#117999) fix(googlechat): report a blocked account instead of a webhook path that was never bound (#117986) fix(line): preserve semantic indentation in fenced code (#117996) fix(plugins): contain rejected synchronous hook results (#117988) fix(cli): preserve shell profiles when completion install fails (#117987) fix(tui): preserve legitimate consecutive backspaces (#117989) fix: preserve queued messages during /compact (#117840) fix(talk): enforce relay lifecycle bounds fix(talk): enforce relay terminal precedence test(talk): cover relay tool-call retention overflow fix(talk): bound relay tool-call lifecycle state
) Co-authored-by: Peter Steinberger <[email protected]>
* origin/main: fix(ui): label Gateway connection settings for accessibility (openclaw#118000) ci(qa): extend profile evidence timeout (openclaw#117999) fix(googlechat): report a blocked account instead of a webhook path that was never bound (openclaw#117986) fix(line): preserve semantic indentation in fenced code (openclaw#117996) fix(plugins): contain rejected synchronous hook results (openclaw#117988) fix(cli): preserve shell profiles when completion install fails (openclaw#117987) fix(tui): preserve legitimate consecutive backspaces (openclaw#117989) fix: preserve queued messages during /compact (openclaw#117840) fix(talk): enforce relay lifecycle bounds fix(talk): enforce relay terminal precedence test(talk): cover relay tool-call retention overflow fix(talk): bound relay tool-call lifecycle state
What Problem This Solves
LINE code cards silently removed leading spaces and tabs from fenced source code, changing Python indentation and other whitespace-sensitive examples before delivery.
Why This Change Was Made
The existing Markdown/LINE code-card owner used a full
trim()even though Markdown parsing already preserved the code content. Replacing it withtrimEnd()keeps meaningful leading whitespace while preserving the established trailing-newline behavior; there is no new abstraction or product configuration.User Impact
Code examples sent through both normal LINE outbound delivery and automated replies retain their original indentation, tabs, and Unicode characters.
Exact-Head Proof
aeaaaad4d045755f870e048fe697a113bb69af6c.2c0c9f012f5192d0fd9ab56077fa7f90ad5c97cd.pnpm tsgo:extensionsandpnpm tsgo:extensions:testboth pass; scoped type-aware lint and formatting pass. The single dedicated Testbox lease was explicitly stopped and independently verified completed.openclaw/ci-gatepassed; latest ClawSweeper independently rates the real parent/head evidenceproof: sufficient.gpt-5.6-solhigh-reasoning review explicitly included--max-priority P3; real TruffleHog is clean.Maintainer Decision
Explicit repository-owner authorization covers this independently proved, low-risk, one-owner correction.
Agent Transcript
Agent-assisted owner refactor and real regression proof; independently reviewed by four fresh source reviewers and explicit Sol/high P0–P3 review. No credentials or private reasoning are included.