Skip to content

fix(xlsx): force LibreOffice recalc and stop forcing formulas on reports - #515

Merged
xfgong merged 2 commits into
mainfrom
fix/2026-08-20-xlsx-skill
Aug 21, 2026
Merged

fix(xlsx): force LibreOffice recalc and stop forcing formulas on reports#515
xfgong merged 2 commits into
mainfrom
fix/2026-08-20-xlsx-skill

Conversation

@xfgong

@xfgong xfgong commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes the xlsx skill's broken recalc path (root cause of the >5min hang in the Video 2 Shot A run) and removes over-engineering that forced formulas onto static reports.

  • scripts/libreoffice_recalc.py: force LibreOffice to actually recalc OOXML formulas on load via an isolated per-run UserInstallation profile + registrymodifications.xcu (OOXMLRecalcMode=0); kill orphan soffice procs by profile; add verify_recalculated() post-check that fails (exit 1) when formula <v> caches are not populated — a silent "success" with empty cells can no longer ship.
  • SKILL.md / references/create.md / references/validate.md (v1.1.0 → v1.2.0): introduce a Report vs Model split. Reports (final snapshot, values already computed in pandas) write computed values directly — no formulas, no recalc. Models (user edits inputs) keep Formula-First + recalc. Softens the blanket "every derived value must be a formula" rule and adds a recalc gate (never overwrite a good copy; fall back to values on recalc failure).

Test plan

  • Local unit test of verify_recalculated(): empty <v> → fail, populated <v> → pass, pure-value report → pass.
  • End-to-end recalc on 215 (/usr/bin/soffice v26.2.4.2) with a formula-bearing xlsx — confirm <v> is populated after recalc.
  • Re-record Shot A (sales report) — agent should now take the Report path, no recalc step, no hang.

🤖 Generated with WorkBuddy

- libreoffice_recalc.py: force recalc via isolated profile (OOXMLRecalcMode=0),
  kill orphan soffice procs, and verify formula <v> cache was populated so a
  silent 'success' with empty cells can no longer ship (root cause of the
  Shot A >5min recalc hang).
- SKILL.md/create.md/validate.md: introduce Report vs Model split; reports write
  computed values directly (no formulas, no recalc), models keep Formula-First.
@github-actions github-actions Bot added bug Something isn't working documentation Improvements or additions to documentation backend Backend code labels Aug 20, 2026
@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

- Detect missing headless (svp) VCL plugin; fall back to xvfb-run
  (present in cubeplex-sandbox images) so headless recalc actually
  loads documents instead of failing with 'source file could not be loaded'.
- Fix output path collision: write recalc output to a separate dir so
  soffice does not overwrite the input copy (was shipping un-recalc'd file).
- Verified end-to-end inside a cubeplex-sandbox container: 3/3 formula
  cells recalculated (A1=60, B1=20, A2=30), no orphan soffice procs.
@xfgong
xfgong merged commit 400d18e into main Aug 21, 2026
24 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend code bug Something isn't working documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant