Repository navigation
fix(reports): preserve UTF-8 LF report artifacts on Windows - #7251
Open
JasonBuildAI wants to merge 1 commit into
Open
JasonBuildAI wants to merge 1 commit into
JasonBuildAI wants to merge 1 commit into
Conversation
JasonBuildAI
requested review from
huangruiteng,
loopx-agent and
songoow
as code owners
October 24, 2026 10:29
Native scheduled reports wrote report.md through platform text mode, which turned LF into CRLF on Windows while the frozen receipt hashed LF. Validate the same UTF-8 bytes that were written, and pin UTF-8 reads for the frozen inputs, health projection, and original-chat body handoff. Add a report-generation regression test that simulates Windows newline translation and a non-UTF-8 host codec. Fixes loopx-project#7246 Signed-off-by: JasonBuildAI <jasonbuildai@gmail.com>
JasonBuildAI
force-pushed
the
codex/agent-q8n4
branch
from
October 24, 2026 10:34
2184956 to
a4fa4a1
Compare
JasonBuildAI
added a commit
to JasonBuildAI/loopx
that referenced
this pull request
Oct 24, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every native scheduled report fails on supported Windows hosts, stranding an already-generated model response before private delivery can begin.
This affects the shipped, opt-in native scheduled-report capability introduced by #7179. The failure is deterministic even when Python runs in UTF-8 mode, and default non-UTF-8 Windows locales (
cp936,cp932,cp949) independently fail on report-artifact reads. Native Windows is a documented supported surface, and recent cp936 regressions such as #6708 and #7063 show that this locale class has real users.What is broken
freeze_private_reportwrotereport.mdthrough text mode. Windows translated its LF line endings to CRLF, whileprivate-generation.jsonhashed the in-memory LF body. The immediate validation then hashed the CRLF file and rejected its own generation. Because this happens inside the scheduled report pipeline, the report Todo cannot complete, private delivery never starts, and the same failure recurs for every report window.Five report-artifact reads also relied on the host default codec: frozen request/source inputs, generation/delivery receipts, the generated body, and the full body returned to the original chat. Those reads fail on Windows hosts whose default encoding is not UTF-8.
Fix
report.mdonce as UTF-8, write those exact bytes without newline translation, and use the same bytes forbody_sha256.Reproduction and result
Before the fix, on native Windows with
preferred_encoding=cp936andutf8_mode=0:After the fix, through the same real entry point:
The new regression fails against the parent commit with
ValueError: frozen generation or full report body changedand passes with this change.Validation
1 passed.2 passed; it previously listed all five unpinned reads.PYTHONUTF8=1:150 passed in 230.96s.ruff checkon all four changed files:All checks passed!.loopx canary premerge --from-git-diff:passed,selected=2,failures=0.git diff --check, Python compile checks, public/private boundary scan, CLI output-budget smoke, and semantic-vocabulary drift smoke: passed.Environment-only limits: two legacy native-steward tests could not execute on this Windows host because their fake
codexexecutable is extensionless;test_periodic_report_machine_storeandtest_periodic_report_turn_replanfail identically on the clean parent commit for unrelated Windows/registry reasons. No passing result is claimed for those paths.CI note at head
a4fa4a1a: DCO, dependency review, Windows PowerShell, all TypeScript core jobs, stage2c, and the frontstage build pass. Three browser jobs and the release-artifact browser step fail on the UI assertionGoal drawer header is still pinned too close to the top edge; this change contains no frontend edits.kernel-contractsreports 5,236 repository-wide mypy errors, with no error on a changed line. The six Python test shards remained queued in the repository concurrency group at handoff, not blocked on workflow approval.The change is limited to the write/read boundary and one focused test: 4 files, +188/-8. No dependencies, public contracts, or unrelated refactors are included.
Follow-up to #7179 and refined paths from #7200, #7215, and #7218.
AI disclosure: this change was drafted with AI assistance at my request, under my direction and review.
Fixes #7246