Repository navigation
fix(pod): decode localized schtasks output in the OEM code page - #38907
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the change is display-only and easy to revert. schtasks output only feeds error messages, exit codes decide everything, and Notes
[DESIGN-REVIEWED] 0916380 Description read[DESCRIPTION-READ] 14454515502fc660a32280c7ba02e1c86285942e43607976fe8ed8e01d4b6818 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. This is a one-site fix aimed at the cause, Not checked: whether Inventory (4 items) — 4 justifiedIntent: an operator on a non-English Windows host reads
The premise is not an availability-path risk: [FIRST-PRINCIPLES-REVIEWED] 0916380 Description read[DESCRIPTION-READ] 54b38f929cb3f2f779e912293ac2b7c7169cc4ed7071ef1a8ccd3eb837f83608 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
7d9d82f to
1bbfe63
Compare
1bbfe63 to
0916380
Compare
Code change approver recommendation: ApproveWhy: the decider estimates a 7% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes. The change swaps the Tier: 1, every tier gate passed. An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved automatically by the code change approver, not by a person. The decider estimates a 7% chance that this change introduces a defect, within the 12% limit for approving on its own, and the change has at most 400 changed lines.
The change swaps the **UTF8_TEXT decode in _schtasks_raw for the OEM code page (via _script_encoding()) and keeps errors="replace". It also adds the # subprocess-encoding: locale marker that code-style.md asks for when a child writes in the console encoding. Every caller of _schtasks_raw/schtasks() decides by exit code. The output text only ends up in the WindowsTaskCreateRefused message, so a wrong codec can only garble that text. It cannot break control flow or crash. The removed UTF8_TEXT import was unused in pod/windows.py. The new tests decode bytes with the encoding the call passes, so they would fail with the old UTF-8 decode. CI is all green, including the Windows tests and the Pod Boot Canary (Windows).
Tier: 1, every tier gate passed.
Criteria: no merge conflict, no owner block, no change request, the default branch, no security-sensitive path, no design document to agree on, the readiness status, the review lanes, the P0 history, the linked issues' tier, the review lessons, no concern label, the file count, a safe change category, not its own change, the decider, the security checklist, the change matches its title, no competing change.
Decider v3c (217fe607). To overrule it, request changes or dismiss this review.
Problem / Motivation
Goal: A localized
schtasksrefusal on a non-English Windows host shows its accented letters instead of replacement characters._schtasks_rawdecodesschtasks.exeoutput as UTF-8, butschtasks.exewrites to a redirected pipe in the console's OEM code page. Every non-ASCII byte becomes U+FFFD, in therequire_backendrefusal and in the/Createand/Deletefailure messages.Why it matters
The refusal text is the only explanation an operator gets of why pods cannot run on the host. On a French host
ERREUR : Acces refuse.loses both accented letters. Exit-code decisions are unaffected.Not a goal
schtasksoutput..cmdwrapper encoding.What changed (motivation → approach → change)
Symptom: U+FFFD in the refusal. Cause:
**UTF8_TEXTon_schtasks_raw, whileschtasks.exewrites the OEM page. Change:_schtasks_rawnow decodes with_script_encoding()(Python'soemcodec on Windows, UTF-8 elsewhere), the codec the wrapper.cmdalready uses. It keepserrors="replace"and carries the# subprocess-encoding: localemarker. TheUTF8_TEXTimport inpod/windows.pyis removed because nothing else used it.Backwards compatibility
Compatible: ASCII and English output decode identically; only non-ASCII bytes change, from U+FFFD to the real letters.
Removes nothing: no key, function or behaviour is taken away.
Tests
test_schtasks_output_is_decoded_in_the_oem_code_page: cp437 bytes for three accented letters come back intact.test_a_localized_refusal_reaches_the_operator_unchanged: a cp850 French/Createrefusal appears unchanged inWindowsTaskCreateRefused.test_an_ascii_refusal_reads_the_same_in_the_oem_page: ASCII is unchanged.They stub
subprocess.runwith a fake that decodes the bytes with theencodinganderrorsthe call passes, and patch_script_encoding, so they start no child and run on Linux. The first two fail on main ('/Z ���' != '/Z éüè') and pass here. Local: 452 related pod/spawn-audit/encoding-gate tests pass,check_subprocess_encoding.py, black, mypy and comment-history are clean.Proof: not provable -- other: prove.py not run on this ARM host; checked by hand that two of the new tests fail on origin/main's windows.py and pass with the fix.
Manual verification
A maintainer must check this on Windows. It was written on Linux (aarch64) and the real
oemcodec andschtasks.exewere not run. Per the issue:_schtasks_raw(schtasks_bin(), "/Query", "/Z", <three OEM-437 letters>)should return those letters in stderr, and a French or German host's refusal should read correctly.Screenshots / video
N/A — no UI change.
Related Issues
Fixes #38541
Sibling sweep
Swept: git grep -n "UTF8_TEXT" -- src/kiro_crew/pod/
Siblings: none --
_schtasks_rawis the only schtasks.exe spawn inpod/windows.py.Pattern harvest
Not generalizable: one Windows tool wrongly pinned to UTF-8; the encoding lint gate already steers such sites to its locale marker.
Checklist