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): paragraphs and headings start on a new line after inline text in EPUB and DOCX documents - #43411
EPUB paragraphs and headings after inline text run into the preceding words. DOCX text-box paragraphs have the same problem, so agents read IntroBody paragraph or BeforeBox text instead of separate paragraphs.
Deterministic repro on origin/main (0df79074ad5f21478b616fe812746c0896ec90d7): after vp i, run the copyable Python ZIP fixture builder and Node extractDocumentText() command in the runtime transcript. The EPUB chapter body is <div>Intro<p>Body paragraph</p></div>, <ul><li>Summary<p>Details</p></li></ul>, <div>Intro<h2>Section Title</h2></div>, or <table><tr><td>First<p>Second</p></td></tr></table>. The DOCX fixture contains Before, an inline w:txbxContent paragraph containing Box text, then After in the enclosing paragraph.
The committed archive regression can also be run with vp test run apps/server/src/provider/userInputAttachments.test.ts -t "preserves office structure and EPUB reading order with bounded archives"; applying only its test diff to base reproduces the failing assertion.
Change
Emit the existing deferred paragraph boundary before paragraph/heading text and its heading prefix. The common server extractor handles EPUB and DOCX attachments for every client and provider; table cells keep their existing whitespace normalization. Extend the existing archive fixture table and correct its DOCX text-box heading expectation.
Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
The regression fails on unmodified base with IntroBody paragraph where Intro\nBody paragraph is expected.
Three consecutive full runs of vp test run apps/server/src/provider/userInputAttachments.test.ts: 61/61 tests pass each time.
Not shown: full app attachment upload, real office-generated files, web/desktop/mobile UI interaction, or a live provider turn. No client, contract, translation, provider-adapter, or connection-mode changes are required for this shared server parser fix.
Authored by GPT-6.1 Sol (Codex); reviewed by Gemini 4 Neon (Antigravity).
Reviewing files that changed from the base of the PR and between 5610f64 and f77cb84.
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 paragraph worker now emits a thematic-break marker before each paragraph or heading. Archive extraction tests add EPUB and DOCX fixtures that check text order, including a newline before a DOCX text-box heading.
Changes: Document text extraction
Layer / File(s)
Summary
Paragraph boundaries and archive extraction coverage apps/server/src/provider/documentTextWorker.ts, apps/server/src/provider/userInputAttachments.test.ts
The paragraph worker emits a thematic-break marker before each paragraph or heading. EPUB tests cover nested paragraphs, lists, a heading, and table cells. DOCX tests check text-box content order and require a newline before the text-box heading.
This change makes paragraphs and headings start on a new line after inline text in EPUB and DOCX attachments. It is a small, localized extraction fix with regression tests, and no merge-blocking risk remains.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: EPUB and DOCX paragraphs and headings now start on a new line after inline text. It matches the raw summary (a thematic-break marker before each paragraph or heading) …
Description check
The description covers the problem, a reproduction, the change, scope, and verification. It follows the template sections: Problem, Change, Scope, and Verification. It gives observed and expected outp…
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: EPUB and DOCX paragraphs and headings now start on a new line after inline text. It matches the raw summary (a thematic-break marker before each paragraph or heading) and the PR objectives. It follows the conventional commit format and is specific.
Full details: Description check
Explanation
The description covers the problem, a reproduction, the change, scope, and verification. It follows the template sections: Problem, Change, Scope, and Verification. It gives observed and expected outputs for five cases, names the regression test, and states what was not checked. The template's optional agent-attribution line is present. The description is detailed and matches the objectives, though it relies on an external gist for the runtime transcript.
Finishing Touches
Generate unit tests (beta)
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.
Upload the same synthetic EPUB and DOCX in a fresh thread, submit, and inspect the server-generated extracted text verbatim in the app's file viewer. Chromium, 1280×800, light theme, fresh database on each commit, Replay (dev).
The base joins inline text to paragraphs and headings, including DOCX text-box content. The head preserves newlines and normalizes the table-cell boundary to a space. scenarios:prove exited 0.
A live Codex response quoting the sidecars was not exercised; the scenario used Replay (dev) and displayed the actual server-generated sidecar contents directly.
… text in EPUB and DOCX documents (pingdotgg#43411)
Co-authored-by: SAPHID <saphid@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit 74c0308)
… text in EPUB and DOCX documents (pingdotgg#43411)
Co-authored-by: SAPHID <saphid@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit 74c0308)
… text in EPUB and DOCX documents (pingdotgg#43411)
Co-authored-by: SAPHID <saphid@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit 74c0308)
… text in EPUB and DOCX documents (pingdotgg#43411)
Co-authored-by: SAPHID <saphid@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit 74c0308)
… text in EPUB and DOCX documents (pingdotgg#43411)
Co-authored-by: SAPHID <saphid@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit 74c0308)
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
EPUB paragraphs and headings after inline text run into the preceding words. DOCX text-box paragraphs have the same problem, so agents read
IntroBody paragraphorBeforeBox textinstead of separate paragraphs.Deterministic repro on
origin/main(0df79074ad5f21478b616fe812746c0896ec90d7): aftervp i, run the copyable Python ZIP fixture builder and NodeextractDocumentText()command in the runtime transcript. The EPUB chapter body is<div>Intro<p>Body paragraph</p></div>,<ul><li>Summary<p>Details</p></li></ul>,<div>Intro<h2>Section Title</h2></div>, or<table><tr><td>First<p>Second</p></td></tr></table>. The DOCX fixture containsBefore, an inlinew:txbxContentparagraph containingBox text, thenAfterin the enclosing paragraph.Observed → expected (JSON string notation):
"IntroBody paragraph"→"Intro\nBody paragraph""SummaryDetails"→"Summary\nDetails""Intro## Section Title"→"Intro\n## Section Title""FirstSecond"→"First Second"inside a table cell"BeforeBox text\nAfter"→"Before\nBox text\nAfter"The committed archive regression can also be run with
vp test run apps/server/src/provider/userInputAttachments.test.ts -t "preserves office structure and EPUB reading order with bounded archives"; applying only its test diff to base reproduces the failing assertion.Change
Emit the existing deferred paragraph boundary before paragraph/heading text and its heading prefix. The common server extractor handles EPUB and DOCX attachments for every client and provider; table cells keep their existing whitespace normalization. Extend the existing archive fixture table and correct its DOCX text-box heading expectation.
Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
IntroBody paragraphwhereIntro\nBody paragraphis expected.vp test run apps/server/src/provider/userInputAttachments.test.ts: 61/61 tests pass each time.vp run check:changed: exit 0.Authored by GPT-6.1 Sol (Codex); reviewed by Gemini 4 Neon (Antigravity).