DOCX preview can show stale content after regenerating the same file path

Open 💬 1 comment Opened Jun 1, 2026 by 0okay

Bug Description

Codex Desktop appears to cache the preview of a generated .docx file by path. After regenerating the same DOCX path with updated content, the file preview still showed the old paragraph, even though the actual DOCX package had been updated.

This caused the user to believe the requested edit had not been applied. Direct inspection of word/document.xml confirmed the old sentence was gone and the new sentence was present, while the visual preview still displayed the old text.

Environment

  • Agent Platform: Codex Desktop / Codex CLI
  • Codex CLI Version: codex-cli 0.135.0
  • OS: Windows 11 (Microsoft Windows NT 10.0.22621.0)
  • Shell: PowerShell 7.6.1
  • File type: .docx

What Happened

  1. Generated a DOCX file at an existing path using a Python OOXML/template script.
  2. User opened/previewed the file in Codex Desktop and saw an old paragraph:
  • e.g. wording like 贵司方案目前较有可区分价值...创造性风险较高...
  1. Regenerated the same DOCX path after changing the underlying JSON/template content.
  2. The preview still displayed the old paragraph.
  3. Verified the DOCX itself by opening the zip package and reading word/document.xml; the old sentence was no longer present and the new text was present.
  4. Saving the regenerated document under a new filename such as -V2.docx avoided the stale preview confusion.

Expected Behavior

When a file is regenerated or overwritten at the same path, Codex Desktop should invalidate the preview cache and show the latest file contents.

At minimum, the preview should have a visible refresh/reload action or an indication that the displayed preview may be stale.

Steps to Reproduce

  1. Create or open a .docx file in a Codex Desktop workspace.
  2. Preview it in Codex Desktop.
  3. Programmatically overwrite the same .docx path with different text in word/document.xml.
  4. Reopen or revisit the preview for that same file path.
  5. Observe whether the preview updates to the new content or continues showing the old content.
  6. Separately inspect the DOCX zip contents to confirm word/document.xml contains the new text.

Impact

This is particularly confusing for document-generation workflows, because the agent can correctly update the file while the user sees stale content in the preview and reports that the change was not made.

Workaround

  • Save regenerated DOCX files with a new filename/version suffix, e.g. -V2.docx.
  • Directly inspect word/document.xml to verify the actual file contents.

Additional Context

The issue appeared during a Chinese patent-search feedback document workflow. The generated DOCX was valid and could be verified by reading the internal OOXML, but Codex Desktop preview did not reflect the latest content for the same path.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗