Repository navigation
fix(deploy): decode artifact-deploy aws cli output as utf-8 - #24017
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The change is a mechanism-level fix that reuses the existing What this change shipsInventory (4 items) — 4 justifiedIntent: a person attaching or detaching a deploy backend on a non-UTF-8 Windows locale sees the real AWS CLI output and errors, not garbled text or a crash. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] a5967d9 Description read[DESCRIPTION-READ] 5ebb79cfbe7dc750460f7155553cb0faa581ed003aa8f0b6cb6dcd4df8e33bd1 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS This is a small decode-only fix. It reuses the Notes
[DESIGN-REVIEWED] a5967d9 Description read[DESCRIPTION-READ] b6e160bb948419b779ea36a9da62ce2db013f373e50caf84c15a3f54e109a761 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 |
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: |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (4 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: the artifact-deploy attach and detach helpers decode the aws CLI output as UTF-8 instead of the locale code page, with a test that pins the arguments passed to run_limited.
Problem / Motivation
Goal: The artifact-deploy attach and detach backend scripts read the aws CLI's output as UTF-8, so non-ASCII names and localized errors arrive intact on Windows.
Both scripts spawn the aws CLI with
text=Trueand noencoding=. Python then decodes the child's output with the locale code page (the ANSI code page on Windows), while the CLI writes UTF-8. Non-ASCII resource names, paths and localized AWS errors come back as mojibake, and a byte that is invalid in the code page raisesUnicodeDecodeError.Why it matters
Anyone attaching or detaching a deploy backend on a non-UTF-8 Windows locale can see garbled CLI output or a crash instead of the real AWS error.
Not a goal
cloud/aws.pysite, tracked separately in kirocrew cloud: run_aws decodes aws CLI output with the locale code page (Windows mojibake) #23944 / fix(cloud): decode the aws cli output as utf-8 #23946.What changed (motivation → approach → change)
Symptom: mojibake or
UnicodeDecodeErrorfrom the backend scripts on Windows. Cause: theaws()helper in each script decoded the child with the locale code page. Change: each helper now spawns with the sharedUTF8_TEXTmapping (UTF-8,errors="replace"), the same shape the deploy engine uses, and both scripts leave the subprocess-encoding baseline.Backwards compatibility
Compatible: on a UTF-8 locale the decode is unchanged; elsewhere the output is now read as the UTF-8 the CLI already writes.
Removes nothing: only the decode of captured output changes; the baseline shrinks because the two calls are now pinned.
Tests
test/test_artifact_deploy_aws_utf8_decode.pyloads each script and pins the keyword arguments itsaws()helper handsrun_limited:text,encoding="utf-8",errors="replace", plus the existing capture and timeout.Proof: PROVEN test/test_artifact_deploy_aws_utf8_decode.py::test_aws_helper_decodes_child_output_as_utf8[attach_backend], test/test_artifact_deploy_aws_utf8_decode.py::test_aws_helper_decodes_child_output_as_utf8[detach_backend] (head a5967d9)
Manual verification
N/A - unit coverage sufficient: the change is the decode keywords on one call per script, which the test pins directly.
Related Issues
Closes #23963
Sibling sweep
Swept: git grep -nE "text=True" -- src/kiro_crew/deploy/ and the deploy/cloud entries in .github/subprocess-encoding-baseline.txt
Sibling: src/kiro_crew/deploy/engine.py -- not affected -- already pinned to UTF8_TEXT on main
Sibling: src/kiro_crew/cloud/aws.py -- tracked in #23946
Sibling: src/kiro_crew/deploy/profiles.py:430 -- not affected -- credential_process snippet run by another shell; its output is ASCII JSON credentials
Pattern harvest
Rule candidate: lint
Pattern: text-mode subprocess spawn without a pinned encoding (already enforced by scripts/check_subprocess_encoding.py; this PR shrinks its baseline)
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)