Skip to content

fix(server): preserve number formats when XLSX styles are relocated - #41486

Merged
juliusmarminge merged 4 commits into
pingdotgg:mainfrom
Lucenx9:fix/xlsx-relocated-styles
Nov 23, 2026
Merged

juliusmarminge merged 4 commits into
pingdotgg:mainfrom
Lucenx9:fix/xlsx-relocated-styles

Conversation

@Lucenx9

@Lucenx9 Lucenx9 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Problem

XLSX attachments lose their number-format annotations when the workbook stores styles outside xl/styles.xml. Agents then see date serials and fractions without the context that identifies dates and percentages.

Change

Read the workbook's styles relationship using the same part lookup as its shared strings. Try the exact part name before comparing ASCII case, as required by OPC. Keep the conventional location as the fallback for workbooks that do not declare a styles target.

Scope

This is a small server-side extraction bug. #41441 covered relocated shared strings. This change applies the same lookup to styles. A targeted issue and PR search found no equivalent styles fix.

Verification

I generated an XLSX with XlsxWriter, moved its style part, and updated the relationship and content type. The worksheet and style definitions were byte-identical. The production extractor ran on the same relocated workbook on base and with the fix.

Cell Before After
Date 45292 45292 [Excel numFmtId=164; format=yyyy-mm-dd; date system 1900]
Percentage 0.25 0.25 [Excel numFmtId=165; format=0.0%; date system 1900]
Unformatted number 37 37

The existing office attachment test failed on base because it lost the date annotation. Eight worker replays pass for the default location, relative and absolute targets, and case differences in both the conventional and relocated styles names. The case controls failed against the first patch and passed after the exact-first lookup was extended. fast-check passed 80 relationship cases, and Jazzer.js completed 250 bounded runs. Stryker killed 24 of 25 mutants on a source-derived copy. The survivor always scans for an ASCII-case match, which is equivalent for compliant packages. CodeScene passed. Fallow's advisory gate failed on the complexity of the new fallback branch on a two-file snapshot with limited dependency coverage.

vp run check:changed --concurrency 1 passed with 51 tests, typecheck, format, lint, Knip, and GraphQL. The same check passed again after rebasing onto 06f513d. Normal commit hooks passed.

Independent reviews approved the final diff with Gemini 4 Neon on Antigravity at medium effort and Opus 5.5 at high effort.

Reviewed with sol-loop: 2 rounds with GPT-6.2 Sol on high. Sol verdict: approved.

Created with GPT-6.2 Sol in Codex through T3 Code.

Copilot AI balanced review requested due to automatic review settings November 23, 2026 14:11
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: โœ… Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
๐Ÿ“ Code Review โœ… Completed 2026-11-23T14:14:21.128828Z 5468855 PR opened
โ„น๏ธ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with ๐Ÿ‘€ while any review is running, comments if it has suggestions, and reacts with ๐Ÿ‘ once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 23, 2026
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change โ†’

No actionable comments were generated in the recent review.

Walkthrough

Document archive readers now support case-insensitive part-name lookup. The XLSX extractor resolves styles and shared strings through workbook relationships, with conventional path fallbacks. The XLSX test fixture uses a styles relationship target outside the conventional path.

Changes: Archive document part lookup

Layer / File(s) Summary
Case-insensitive archive lookup
apps/server/src/provider/documentTextWorker.ts
The archive reader prefers exact part-name matches and otherwise resolves names without regard to ASCII letter case. DOCX main-part reads and PPTX slide-relationship checks use this lookup.
Resolve XLSX workbook parts
apps/server/src/provider/documentTextWorker.ts, apps/server/src/provider/userInputAttachments.test.ts
The extractor resolves styles and shared strings through workbook relationships and falls back to xl/{part}.xml. The test fixture points the styles relationship to ../Formatting/Cells.xml and stores the fixture at formatting/cells.xml.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

  • pingdotgg/t3code#41441: Adds relationship-based lookup for XLSX shared strings, which uses the same part-lookup behavior.

Suggested labels: bugfix

Suggested reviewers: marve10s, only21mil, michel-liao

Merge Risk: Minimal ยท up to 69274

This change preserves date and percentage number formats in XLSX attachments when the styles part is stored outside the conventional location. The fallback behavior for conventional workbooks is unchanged, and no merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(server): preserve number formats when XLSX styles are relocated" matches the main change. The change makes the XLSX styles lookup resolve the relocated styles part through workbook relaโ€ฆ
Description check Passed The description covers the problem, the change, scope, and verification. It follows the template's section structure. It explains the lookup rule (exact match first, then ASCII case-insensitive), the โ€ฆ
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(server): preserve number formats when XLSX styles are relocated" matches the main change. The change makes the XLSX styles lookup resolve the relocated styles part through workbook relationships, so number-format annotations survive. The title follows the conventional commit format and is specific.

Full details: Description check

Explanation

The description covers the problem, the change, scope, and verification. It follows the template's section structure. It explains the lookup rule (exact match first, then ASCII case-insensitive), the fallback to the conventional location, and reports concrete before/after results and test runs. The Scope section links related work (#41441) and explains why no issue is linked. The Verification section names the checks run and the observed results, and notes a failing advisory gate (Fallow). The template's agent-attribution line is present. Minor gaps: the Scope section does not link an issue that shows the bug, and it does not state whether a maintainer requested the PR. Those gaps are non-critical, so the check passes.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix ยท Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 7da2c35 and 6927461.

Files selected for processing: 2

  • apps/server/src/provider/documentTextWorker.ts
  • apps/server/src/provider/userInputAttachments.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 23, 2026
juliusmarminge and others added 3 commits November 23, 2026 14:23
Other workbook parts resolve exactly; keep styles consistent with them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OPC compares part names case-insensitively for ASCII letters, so a
relationship target like styles.xml must find xl/Styles.xml. Resolve
every part lookup in one place, exact name first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). and removed size:S 10-29 changed lines (additions + deletions). labels Nov 23, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Proven with scenarios:prove (exit 0). Environment on both sides: Linux Chromium, 1280ร—1200, light theme, fresh unseeded state.

Paste ten synthetic packages into the composer as fresh uploads, match stored uploads by SHA-256, and display their generated text sidecars in report threads. Replay supplies fixture turns only; the reports contain actual extraction output. The original XLSX fixtures use 45292 with custom format 164 (yyyy-mm-dd), 0.25 with custom format 165 (0.0%), and unformatted 42. Additional fixtures exercise the broader case-insensitive fallback.

Coverage Before โ€” 20419366c3 After โ€” 6927461641
Standard, relocated and differently cased XLSX styles Before: relocated and differently cased styles lose annotations After: all three retain number formats and date-system annotations
XLSX workbook/sheet/sharedStrings, DOCX main part, PPTX notes Before: XLSX and DOCX parts skipped; PPTX notes absent After: XLSX and DOCX content and PPTX notes retained
ODT, ODS and ODP content.xml Before: all three content parts skipped After: all three contents retained
EPUB container/package/chapter Before: differently cased container skipped After: chapter retained

Before recording ยท After recording

Self-contained scenario with embedded synthetic fixtures

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 23, 2026
@juliusmarminge
juliusmarminge merged commit 37a70fa into pingdotgg:main Nov 23, 2026
58 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 23, 2026
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Nov 23, 2026
**v0.1.12-nightly.20261123.5151** ยท 67 changes from 25 contributors

- **Background browser previews.** Agents can take screenshots and interact with previews while T3 Code is hidden, minimized, or covered.
- **Agent message delivery.** Messages from other agents can steer a running turn without waiting behind a queued message.
- **Web startup.** T3 Code starts in browsers where WebAssembly is disabled.
- **Open links on macOS.** Links open a T3 Code window when the app is running without one.

### Plus 51 more bug fixes and performance improvements.

<details>
<summary>Full changelog</summary>

## What's Changed
* fix(web): retry a failed port-forward locality probe by @juliusmarminge in pingdotgg/t3code#41353
* fix(web): start without WebAssembly by initialising Words in a guard by @juliusmarminge in pingdotgg/t3code#41361
* feat(scripts): server metrics read event-loop delay and GC in every window by @juliusmarminge in pingdotgg/t3code#41252
* feat(scripts): server metrics measure a busy server on a copy of real data by @juliusmarminge in pingdotgg/t3code#41280
* feat(scripts): server metrics attach real clients and time a reconnect storm by @juliusmarminge in pingdotgg/t3code#41281
* feat(scripts): server metrics time the turn pipeline and opening a large thread by @juliusmarminge in pingdotgg/t3code#41282
* perf(server): SQL transactions stop copying every service twice by @juliusmarminge in pingdotgg/t3code#41379
* fix(cli): environment link --from no longer ignores --url by @only21mil in pingdotgg/t3code#41375
* fix(server): a Claude turn no longer ignores messages added to its session in a terminal by @matthewcosier in pingdotgg/t3code#38528
* fix(server): projects behind a git insteadOf rewrite are recognized as GitHub again by @Muzammil-Bit in pingdotgg/t3code#41364
* fix(web): hide Mark unread on threads with no completed run by @juliusmarminge in pingdotgg/t3code#41365
* fix(web): keep OpenDocument image descriptions in alt text by @geezoria in pingdotgg/t3code#41383
* fix(server): t3_thread_read returns the newest page to outside MCP clients by @mfazekas in pingdotgg/t3code#41378
* fix(server): pull request tools say when repository is not owner/repo by @iamshadmantaqi in pingdotgg/t3code#41397
* fix(server): storage cleanup retries and keeps reporting git metadata it failed to delete by @juliusmarminge in pingdotgg/t3code#41386
* fix(desktop): โ‡งโŒ˜V (Paste as Text) pastes text in the composer on macOS by @tiliakoos in pingdotgg/t3code#39008
* perf(server): replay stored events about twice as fast by @hieu-lee in pingdotgg/t3code#26719
* fix(server): Codex async alerts keep their delivery marker in the thread API by @juliusmarminge in pingdotgg/t3code#41411
* fix(desktop): recover frozen macOS backends on relaunch by @juliusmarminge in pingdotgg/t3code#41401
* fix(cli): npx no longer skips the install offer for a directory or non-runnable t3 on PATH by @only21mil in pingdotgg/t3code#41402
* fix(server): PR tools build URLs through the refined forge they are exposed for by @juliusmarminge in pingdotgg/t3code#41414
* fix(desktop): a link opened while the macOS window is closed opens a window by @Marve10s in pingdotgg/t3code#40347
* fix(server): slow provider batches stay whole while a write waits on its own thread by @juliusmarminge in pingdotgg/t3code#41416
* fix(server): agent browsers' DevTools ports no longer show as servers by @tiliakoos in pingdotgg/t3code#40728
* fix(mobile): apply Android language changes immediately by @qi-hey in pingdotgg/t3code#38982
* fix(web): chat links open their menu from the keyboard on macOS by @Kenmege in pingdotgg/t3code#37405
* fix(server): report failed Finder reveals for missing files by @VinzentHubrich in pingdotgg/t3code#38748
* fix(server): Word attachments leave hidden text out of what agents read by @only21mil in pingdotgg/t3code#41421
* fix(server): skip CodeRabbit review acknowledgement wakes by @voltcrash in pingdotgg/t3code#32300
* fix(cli): expand ~ in t3 environment link --from by @Marve10s in pingdotgg/t3code#41430
* fix(cli): reject incomplete workflow signal addresses locally by @only21mil in pingdotgg/t3code#41431
* fix(opencode): Usage โ†’ Limits no longer warns when no Console workspace is signed in by @nthewara in pingdotgg/t3code#41415
* fix(cli): uninstall removes a script launcher whose target names the home through a symlink by @only21mil in pingdotgg/t3code#41435
* fix(server): long setup scripts complete in macOS zsh by @sync in pingdotgg/t3code#37836
* fix(server): preview type sends key events to the page by @juliusmarminge in pingdotgg/t3code#41432
* fix(shared): Open in Cursor skips a broken cursor on PATH by @N4M3Z in pingdotgg/t3code#38212
* fix(cli): expand ~ in t3 policy templates --policy by @Marve10s in pingdotgg/t3code#41438
* fix(server): read relocated shared strings in XLSX attachments by @Lucenx9 in pingdotgg/t3code#41441
* fix(server): import Claude sessions whose first prompt carries a large image by @juliusmarminge in pingdotgg/t3code#41446
* fix(server): keep PowerPoint slides with alternate relationship prefixes by @Lucenx9 in pingdotgg/t3code#41454
* fix(server): another agent's queued message no longer holds back an auto send by @juliusmarminge in pingdotgg/t3code#41461
* feat(scripts): server metrics record machine load and derive noise floors from A/A runs by @juliusmarminge in pingdotgg/t3code#41370
* feat(scripts): server metrics measure many threads working at once with one client by @juliusmarminge in pingdotgg/t3code#41371
* docs: point provider setup at ACP Registry agents like GitHub Copilot by @juliusmarminge in pingdotgg/t3code#41478
* fix: treat empty PATH entries as the working directory in launcher and CLI lookups by @Motaghi in pingdotgg/t3code#41393
* test(web): open history documents without reloading the app in iframes by @juliusmarminge in pingdotgg/t3code#41489
* feat(scripts): server metrics reconnect a user's devices by default and keep the 20-client storm behind --stress by @juliusmarminge in pingdotgg/t3code#41372
* fix(cli): clarify provider-specific model option examples by @nettee in pingdotgg/t3code#41484
* feat(scripts): server metrics get a --quick profile, one-line failures and a guide to the scenarios by @juliusmarminge in pingdotgg/t3code#41373
* fix(server): analytics report every model name by @t3dotgg in pingdotgg/t3code#41237
* fix(server): workflows find a project named by its Windows folder by @Marve10s in pingdotgg/t3code#41456
* fix(client-runtime): a workflow reply with no space before the limit is cut at the limit by @Marve10s in pingdotgg/t3code#41488
* test(web): load history documents without re-evaluating the app graph by @juliusmarminge in pingdotgg/t3code#41497
* fix(server): an unfinished control sequence no longer delays terminal output by @juliusmarminge in pingdotgg/t3code#41420
* fix(server): service commands no longer stop systemd-oomd watching the user manager by @juliusmarminge in pingdotgg/t3code#41495
* fix(server): a compaction or manual continuation keeps its session busy like a turn by @navidnadali in pingdotgg/t3code#41490
* fix(server): Azure DevOps PRs read by number get their full URL by @4dwaffle in pingdotgg/t3code#41472
* fix(desktop): agent screenshots and clicks work while T3 Code is hidden, minimized or covered by @3xcalibur-tech in pingdotgg/t3code#40263
* fix(server): a PR whose merge is refused for conflicts shows as conflicting by @micnem in pingdotgg/t3code#41500
* fix(cli): a symlinked spelling of the T3 home is the same home for service uninstall by @only21mil in pingdotgg/t3code#41464
* fix(server): preserve number formats when XLSX styles are relocated by @Lucenx9 in pingdotgg/t3code#41486
* fix(web): Markdown previews load relative images in timestamped and root folders by @only21mil in pingdotgg/t3code#41505
* fix(server): RTF text in an ANSI font reads as code page 1252 under any document code page by @Marve10s in pingdotgg/t3code#41508
* fix(web): RTF previews read text in an ANSI font as code page 1252 under any document code page by @Marve10s in pingdotgg/t3code#41514
* fix(web): notebook previews show errors saved without a traceback by @only21mil in pingdotgg/t3code#41511
* fix(server): a declined steer of a delegated completion still wakes the parent by @juliusmarminge in pingdotgg/t3code#41521
* test(server): HTML preview revision test no longer depends on a fine kernel clock by @t3dotgg in pingdotgg/t3code#40931

## New Contributors
* @qi-hey made their first contribution in pingdotgg/t3code#38982
* @VinzentHubrich made their first contribution in pingdotgg/t3code#38748
* @nthewara made their first contribution in pingdotgg/t3code#41415
* @sync made their first contribution in pingdotgg/t3code#37836
* @N4M3Z made their first contribution in pingdotgg/t3code#38212
* @nettee made their first contribution in pingdotgg/t3code#41484
* @4dwaffle made their first contribution in pingdotgg/t3code#41472
* @micnem made their first contribution in pingdotgg/t3code#41500

**Full Changelog**: pingdotgg/t3code@v0.1.12-nightly.20261123.5138...v0.1.12-nightly.20261123.5151

</details>


Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.1.12-nightly.20261123.5151
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants