Skip to content

fix(server): keep markup literal after an over-indented fence in PR review examples - #44736

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
saphid:hunter/c-1bcf268f92
Nov 28, 2026
Merged

juliusmarminge merged 2 commits into
pingdotgg:mainfrom
saphid:hunter/c-1bcf268f92

Conversation

@saphid

@saphid saphid commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Problem

In apps/server/src/orchestration-v2/pullRequestWatch.ts, withoutMarkup checked for closing code fences using line.trim(), stripping any amount of leading indentation. When a PR review comment contains a fenced code example with an over-indented fence line (4+ spaces or a tab), withoutMarkup exited the code block early and stripped literal HTML tags from the rest of the example sent in the agent wake message.

Deterministic repro on origin/main (0ee002394f44c1768e04f2405de6c6d8f9439637):
Pass a review remark whose body is the 4 lines ```html, four spaces followed by ```, <div>KEEP</div>, and unindented ``` to pullRequestWatchMessage (or run vp test run apps/server/src/orchestration-v2/pullRequestWatch.test.ts -t "code spans and fences" with the extended case):

  • Observed on origin/main: "```html ``` KEEP ```" (<div> and </div> were stripped).
  • Expected: "```html ``` <div>KEEP</div> ```" (<div>KEEP</div> stays literal until a valid closing fence).

Change

Matched closing fences directly against the original line in withoutMarkup (/^ {0,3}({3,}|~{3,})[ \t]*\r?$/), requiring at most 3 leading spaces, matching fence character of length >=the opener, and only optional trailing spaces/tabs and\rfor CRLF. Extended the"code spans and fences"table row inapps/server/src/orchestration-v2/pullRequestWatch.test.tswith a 4-space indented fence line inside a CRLF fenced block and a 3-space closing fence boundary control followed by prose HTML.withoutMarkupis server-only and private topullRequestWatch.ts`, so no other surfaces, contracts, or translations are affected.

Scope

Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.

Verification

  • Base failure (origin/main 0ee002394f44c1768e04f2405de6c6d8f9439637): vp test run apps/server/src/orchestration-v2/pullRequestWatch.test.ts -t "code spans and fences" failed with AssertionError because <div> and </div> were stripped; runtime call to pullRequestWatchMessage produced "```html ``` KEEP ```".
  • Head pass (1d54a4f74bc3c95b445682e1d3a2a37b0c6221cf): 2/2 consecutive runs of vp test run apps/server/src/orchestration-v2/pullRequestWatch.test.ts passed (59/59 tests each); runtime call produced "```html ``` <div>KEEP</div> ```".
  • vp run check:changed: exited 0 (format, lint, knip 1/2 & 2/2, graphql, typecheck across 3 packages, 2 affected test files / 61 tests passed).
  • Before/after transcript: https://gist.github.com/saphid/139c1dcce8e70627a0ea485d5d1cb876
  • Not shown: live GitHub webhook/polling end-to-end watch delivery (verified via pullRequestWatchMessage directly and unit tests).

Authored by Gemini 4 Neon (Antigravity); reviewed by Kimi K3.1 Pro (Model Hub).

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 28, 2026
@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between a8c5ee4 and 86d9aba.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The fenced-code closing check now requires a matching fence with valid indentation, length, and trailing whitespace. The related test now expects <div>KEEP</div> and after to remain in the normalized output.

Changes: Quote normalization

Layer / File(s) Summary
Fence closing detection and test
apps/server/src/orchestration-v2/pullRequestWatch.ts, apps/server/src/orchestration-v2/pullRequestWatch.test.ts
Fence closing detection now checks indentation, fence character and length, and trailing whitespace. The test expects <div>KEEP</div> and after to remain in the normalized output.

Estimated code review effort: 2 (Simple) | ~7 minutes

Change: Bug fix

Suggested reviewers: bil0000, dangh

Merge Risk: Minimal · previous review a8c5e

This change makes the pull request review watch keep HTML literal inside code examples when a closing fence is over-indented. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: withoutMarkup now keeps markup literal after an over-indented fence in PR review examples. It follows the conventional commit form and is specific to the bug fixed. Th…
Description check Passed The description covers the required template sections: Problem, Change, Scope, and Verification. It explains the over-indented fence bug with a deterministic repro and expected output. It states the c…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: withoutMarkup now keeps markup literal after an over-indented fence in PR review examples. It follows the conventional commit form and is specific to the bug fixed. The title is 83 characters, which is somewhat long but still readable.

Full details: Description check

Explanation

The description covers the required template sections: Problem, Change, Scope, and Verification. It explains the over-indented fence bug with a deterministic repro and expected output. It states the change, links the scope rationale (small obvious bug, no issue needed), and reports focused test runs with observed results. It also notes what was not checked (live GitHub webhook/polling delivery). It does not include the optional agent/model line in the required form, but it names the authoring model, which the template asks for. The description meets the template requirements.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
Fix failing CI checks

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 1b0a149 and a8c5ee4.

Files selected for processing: 2

  • apps/server/src/orchestration-v2/pullRequestWatch.test.ts
  • apps/server/src/orchestration-v2/pullRequestWatch.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 28, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Reproduced using real GitLab merge requests and a second identity's four-line comment: opening html fence, four-space-indented fence, <div>KEEP</div>, valid closing fence. Started watching through Linked items and waited for the real watch wake. Captures show each server's persisted wake text verbatim in the app's file viewer. Both runs used fresh databases, Replay, Chromium, light theme, and 1920x1080; final screenshot pairs were pixel-identical 500 ms apart.

Before After
1c2770d735 86d9abab51
Before: div tags stripped from wake After: literal div tags preserved
Recording · Raw wake Recording · Raw wake

Browser and seed driver.

Not shown:

  • The tab-indented variant was not exercised; this proof uses the reported four-space variant.
  • HTML stripping in prose after the valid closer was not separately exercised; the reproduced comment ends at that closer.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 28, 2026
@juliusmarminge
juliusmarminge merged commit 1d4d1f7 into pingdotgg:main Nov 28, 2026
60 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants