Verify Agent Office Files with a LibreOffice Round-Trip Harness
Treat agent-made office files as test fixtures: generate, open, convert, edit, re-export, and assert structure before shipping.

An agent returns a .docx, .xlsx, or .pptx, and the model stops. The file still has to open, convert, edit, and preserve content. A local office stack gives you a repeatable surface for that check.
The OpenAI Codex desktop app's codex-primary-runtime cache contains 1.7GB of local components, including native LibreOffice binaries, a Python installation, and a Node.js installation. The Codex runtime contains a documents plugin folder with skills that instruct Codex how to locate and use the bundled binaries. That design turns document automation into a pipeline you can inspect.
OpenAI released a preview ChatGPT desktop app for Linux that provides access to ChatGPT, ChatGPT Work, and Codex. The Linux preview describes ChatGPT Work as a mode for extended tasks, including the creation of documents, spreadsheets, presentations, and reports. ZDNET describes the updated ChatGPT desktop app as effectively the Codex app with a ChatGPT Work mode.
OpenAI's Codex annotations feature extends to user-created documents, spreadsheets, and slides, letting users select a portion and request changes. If a user can point at a table and ask for a fix, the file must survive the fix.
A bundled office stack turns output into a test surface
Models can produce plausible files without preserving the internal rules that office applications use: tables may lose grids, formulas may store broken references, and slides may break layouts.
The round-trip forces the file to be read by a different process. That process does not know what the model intended. It only knows what the file contains. That is the right standard for a shared artifact.
Use the bundled office stack to open, convert, and re-save common office formats. It gives you a second writer that did not produce the original file. If the file is malformed, the second writer will show it.
Do not rely on the model's confidence. A generated file may look complete and still fail when another application reads it.
Run the round-trip before you trust the artifact
Use a document-agent round-trip harness: generate, open, convert, edit, re-export, and assert on .docx, .xlsx, .pptx, .odt, .ods, and .odp artifacts.
- Generate the target file from the agent workflow. Pass when the file exists, the task log records the prompt, and the output path is stable.
- Open the file with the local office stack. Complete when the application loads it without a repair prompt and the visible content matches the task.
- Convert it to a compatible format. The step succeeds when a second file exists, and the conversion log records the source and target formats.
- Edit a small, representative region. You are done when one table cell, one formula, one slide title, or one comment changes in a way the task would require.
- Re-export the edited file. The export is valid when the final file is written to a clean path, and no hidden warnings appear.
- Assert on structure, edits, and annotations. The test passes when expected headings, rows, sheets, slides, comments, and changed values all report correctly.
Do not stop at successful conversion. A file may convert cleanly and still lose formulas, comments, or table structure. Check the parts that carry meaning.
Record the conversion command, input hash, and output hash. A hash is a compact checksum of the file. If the same input produces different output, the pipeline is not stable. Fix the pipeline before you trust the assertions.
Keep the test data small. A short document, a small spreadsheet, and a short deck are enough to expose most format issues. Do not build a corpus before you have a failing case.
Assert the parts that break first
Start with the structure the user will see. Headings, sheet names, slide order, and table borders are cheap to check and expensive to miss.
Then check the edits. The changed cell should hold the new value. The paragraph must contain the requested sentence. The slide must show the new title.
Then check the annotations. Comments, tracked changes, and review notes should survive the round-trip. If the workflow is meant to preserve them, the test should fail when they do not.
Make the harness cheap enough to run often
Run the harness in the same environment where the agent runs. If the agent uses a local office stack, the test should use the same stack. A mismatch can hide a bug that only appears in production.
Store the expected output as a reference file. When the agent changes, compare the new output against the reference. The diff should show only the intended change. Anything else is a regression.
Fail the build when a required annotation disappears. A missing comment can be more serious than a changed font. The user may rely on the note to understand the edit.
Run the harness on every agent change that touches document output. Treat a failed round-trip as a broken build, not a cosmetic issue.