Skip to content

[Bug]: ODT and ODP paragraph whitespace creates phantom lines in agent sidecars #36882

Closed

Description

@StiensWout

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Create an ODT with odfpy 1.4.1 using its public API:
from odf.opendocument import OpenDocumentText
from odf.text import P, Span

doc = OpenDocumentText()
p = P(text="Invoice")
p.addElement(Span(text="\n\t  number"))
p.addText("   AB-42")
doc.text.addElement(p)
doc.text.addElement(P(text="Second paragraph"))
doc.save("raw.odt")
  1. Upload it as an attachment in a T3 Code thread.
  2. Read the generated agent-readable .txt sidecar. The same result is reproducible through DocumentText.ensure and its real __document-text subprocess, without a provider turn.

Expected behavior

ODF ordinary XML whitespace collapses within paragraphs, including inline spans, per ODF 1.3 Part 3 sections 6.1.2 and 6.1.7:

Invoice number AB-42
Second paragraph

Explicit text:s, text:tab and text:line-break keep their specified whitespace.

Actual behavior

The sidecar contains Invoice\n\t number AB-42\nSecond paragraph. Phantom newlines and tabs split phrases and can break exact-phrase searches. Raw whitespace in ODT headings also detaches the heading text from its Markdown marker. ODP paragraphs take the same extraction path and have the same defect. No characters are lost.

Impact

Minor bug or occasional failure

Version or commit

pingdotgg/main @ 6fc2fb1

Environment

Linux, Node 24, server-side extraction; independent of provider and client. Confirmed with odfpy output, including its plain paragraph constructor. No LibreOffice, Word or Google Docs GUI producer claim; population prevalence is unknown.

Logs or stack traces

Original repro: direct extraction and real subprocess sidecar both return Invoice\n\t number AB-42\nSecond paragraph; canonical and explicit-whitespace controls pass. Independently confirmed by Claude Opus 5.5 after the GPT 6.1 Sol bughunt.

Workaround

Use explicit ODF whitespace elements when generating documents. Existing cached sidecars require regeneration after the extraction fix; there is no cache migration.

Activity

  1. added
    vouch:trusted
    on Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    vouch:trusted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions