You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(server): keep markup literal after an over-indented fence in PR review examples - #44736
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/main0ee002394f44c1768e04f2405de6c6d8f9439637):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).
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.
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: 4
Check name
Status
Explanation
Title check
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
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
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
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
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:XS0-9 changed lines (additions + deletions).vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In
apps/server/src/orchestration-v2/pullRequestWatch.ts,withoutMarkupchecked for closing code fences usingline.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),withoutMarkupexited 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```topullRequestWatchMessage(or runvp test run apps/server/src/orchestration-v2/pullRequestWatch.test.ts -t "code spans and fences"with the extended case):origin/main:"```html ``` KEEP ```"(<div>and</div>were stripped)."```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
origin/main0ee002394f44c1768e04f2405de6c6d8f9439637):vp test run apps/server/src/orchestration-v2/pullRequestWatch.test.ts -t "code spans and fences"failed withAssertionErrorbecause<div>and</div>were stripped; runtime call topullRequestWatchMessageproduced"```html ``` KEEP ```".1d54a4f74bc3c95b445682e1d3a2a37b0c6221cf): 2/2 consecutive runs ofvp test run apps/server/src/orchestration-v2/pullRequestWatch.test.tspassed (59/59 tests each); runtime call produced"```html ``` <div>KEEP</div> ```".vp run check:changed: exited0(format, lint, knip 1/2 & 2/2, graphql, typecheck across 3 packages, 2 affected test files / 61 tests passed).pullRequestWatchMessagedirectly and unit tests).Authored by Gemini 4 Neon (Antigravity); reviewed by Kimi K3.1 Pro (Model Hub).