← Back to Pull requests

fix(windows-install): preserve Unicode Python paths and qualify writeback recovery #6430

Closed
unknown closed this pull request without merging on Oct 15, 2026 04:55 UTC
View on GitHub
unknown unknown commented on Oct 14, 2026 10:21 UTC
Author

Goal And Delivered Outcome

The native Windows installer cannot start its selected Python when interpreter discovery corrupts a Unicode path. _resolve_python reads UTF-8, but its fresh child interpreter prints using the locale codec. With GBK output, Chinese paths become replacement characters and later startup fails; an emoji in the path makes discovery itself fail.

Pin the discovery child's stdout to UTF-8 before printing sys.executable. Keep interpreter selection and the Python 3.11 minimum unchanged. Extend the existing installed PowerShell regression through validated completion, fresh-process readback and idempotent completion replay.

  • Related to #6015; this does not close the broader first-run/session adoption report.

  • Intended base: main; branch baseline 373f2fa12ad5cc525c3960c95685807110dc0c93.
  • Author Declaration

  • Written by: model_agent — OpenAI Codex (GPT-6 family), at the contributor's direction.
  • Implemented against

  • Specification and revision: the UTF-8 subprocess read contract in loopx/windows_install.py::_resolve_python at the branch baseline; the missing writeback/recovery steps in #6015; existing installed lifecycle test in tests/test_windows_install.py.
  • | Criterion | Disposition | Validation |
    | --- | --- | --- |
    | The selected interpreter's path survives discovery exactly, including spaces, Chinese and emoji under GBK | implemented | Two real disposable-venv cases fail on baseline and pass on head |
    | Installed Windows entrypoint supports failed validation, retry and durable result readback | implemented | Existing PowerShell install/doctor test extended through registered actor, current lease/version, rejected validation, successful completion and receipt replay |
    | Automatic continuation or original host-session reattachment | out_of_scope | Remains with #6015 / #5208 |

  • Self-check: reviewed both changed paths, reproduced the baseline defect, ran real native installation and rollback/skill-preservation tests, checked source provenance, lint and public boundaries. No new capability, provider, vocabulary or state owner. This stays in the existing Python Windows-install transport adapter; no TypeScript decision rule is added.
  • Scope And Continuation

  • Complete within this scope: interpreter discovery encoding and installed CLI writeback regression coverage. CLI install is the affected entrypoint; frontend and Lark behavior are unchanged.

  • Future-facing pass: considered the existing interpreter-discovery boundary; its small function already owns the probe. Reusing that owner needs no extraction or second resolver.

  • Remaining coverage: automatic host/session recovery stays in the existing adoption tasks. No live model, benchmark, Desktop or Lark run. Rollback is reverting this PR's two commits. Maintainer review/merge required.
  • Validation

  • Tested revision: 5841f9efa285066cf4a945c95e0c6fb04504ba63 (the committed source/test bytes match the validated working tree).

  • Run state: finished.

  • Input classes: synthetic, public_fixture.

  • Environment: native Windows 10, Python 3.12.10, Node.js 24.20.0 and PowerShell 7.
  • | Check kind | Result | Evidence / limitation |
    | --- | --- | --- |
    | regression_parity | passed | Both Unicode interpreter cases fail with the baseline resolver and pass with the candidate. A four-case real-process comparison preserves ASCII paths under UTF-8/GBK and Unicode paths under UTF-8, and repairs the Unicode/GBK path. Baseline source was restored byte-for-byte after the comparison. |
    | real_entrypoint | passed | uv run --extra test python -m pytest -q tests/test_windows_install.py tests/test_cli_stdio_utf8.py: 16 passed on the rebased head, using a short disposable pytest base directory. Includes actual source-release installation, doctor, externally managed skill preservation, late-failure rollback, validated completion and fresh PowerShell receipt replay. |
    | integration | passed | Supplemental disposable CLI journey on the earlier f5f4848e501fadce915ab9ccff783895838e7140 source: Unicode artifact validation failure/retry; SQLite hard lease with its actual version; readback from another process/directory; original completion receipt on replay; exactly one successor; refresh/history. Usage collection disabled. |
    | unit | failed | Additional UTF-8 guard suites: 5 passed, 1 failed. The failure is the unchanged direction_runtime.py:50 gate_path.read_text() call. The same existing guard fails with the baseline resolver restored. This PR does not claim a green full-tree UTF-8 guard. |
    | real_entrypoint | failed | Initial native install run with the default long temporary path hit the host's Windows path-length limit while copying existing RFC ledgers. The complete suite passed with a short temporary base; arbitrary long-path installation remains unqualified. |
    | static | passed | Changed-file Ruff, compilation, git diff --check, semantic coinage advisory (no carriers), and changed-path public-boundary check. |
    | manual | passed | Risk-based canary plan inspected. Native install, rollback, skills, independent artifact validation, replay and encoding checks above cover this change's actual boundary. |
    | integration | not_run | Generic POSIX install/update catalog smokes and full repository suite; the canary plan was not executed. CI and independent maintainer review remain pending. |

    Frontend / Visual Evidence

  • UI impact: none. No visual presentation change or new UI capability.
  • Type / Area

  • Bug fix

  • Test update

  • Build, packaging, installer, or CI

  • Host or runtime integration
  • Shared-authority RFC fixture impact

    N/A. The test consumes the shipped SQLite lease/completion contract; it changes no authority behavior, schema, provider, routing or promotion policy.

    Boundary Checklist

  • No private state, credentials, raw traces, internal links or local machine paths in this diff or public evidence.

  • No maintainer-owned live benchmark work duplicated.

  • Two changed paths, one Windows install/writeback slice; generated assets, local probes and lockfiles excluded.

  • UI impact is none.

  • Both commits carry DCO sign-offs.
  • Diff: 650 lines (+487 / -163) across 8 files Reviewer: BigDataDZ Review duration: 1114m
    All Vouch review confidence checks passed
    Residual risk 0.23 = Change Risk (0.57) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.57 · 650 lines diff across 8 files
    0.57
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #6430"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 57% (MEDIUM) · Higher = larger blast radius
    57%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 22.5% · Safe to merge
    22.5%