Skip to content

fix(windows): resolve worker pipe typing and POSIX-only test assumptions #1658

Closed

Description

@knqiufan

Describe the bug

The current source fails Windows-target type checking with seven errors in artifact-processing workers and tests. This is an existing platform qualification issue recorded in RFC #1455's delivery plan, independently actionable before Desktop code is introduced.

The errors concern Windows PipeConnection values passed to Connection annotations and tests referencing POSIX-only os.WNOHANG. These diagnostics establish a type/platform-check failure; they do not by themselves demonstrate a runtime crash.

Steps to reproduce

On Windows, check out aa697c5315204249e090acdf1a00d0582e851c5f, synchronize the locked development environment, and run:

uv sync --locked
uv run --locked --no-sync ty check --python-platform win32

The local reproduction used --exclude docs/my only to exclude untracked personal research files; this exclusion is unnecessary in a clean checkout.

Expected behavior

  • Windows connection types are correctly represented for the operations the worker actually uses.
  • POSIX-only test behavior is correctly isolated or expressed through a supported platform-specific path.
  • Windows-target type checking passes without blanket ignores, removing tests, or relabeling a Linux-target check as Windows validation.
  • Add focused Windows type-check CI coverage and run relevant worker cancellation/cleanup behavior tests, preserving Linux behavior.

Actual behavior

Seven errors:

Location Diagnostic
src/powercontext/builtin/runtime/artifact_processing.py:203 Two arguments pass PipeConnection where Connection is expected
src/powercontext/builtin/runtime/artifact_processing.py:210 Two arguments pass PipeConnection where Connection is expected
src/powercontext/builtin/runtime/artifact_processing.py:216 Worker handle receives PipeConnection where Connection is expected
tests/builtin/runtime/test_artifact_processing.py:312 os.WNOHANG is unavailable on Windows
tests/builtin/runtime/test_artifact_processing.py:382 os.WNOHANG is unavailable on Windows

The same command also emitted three url2pathname deprecation warnings in cli/opencode.py; those warnings are separate from these seven blocking errors and do not need to expand this issue's scope.

Environment

  • PowerContext source: aa697c5315204249e090acdf1a00d0582e851c5f
  • OS: Windows 11 x64, build 26200
  • Active environment: Python 3.12.13
  • Configured type-check target: Python 3.11, Windows
  • ty: 0.0.56
  • uv: 0.11.15

Additional context

Desktop consumer: #1654.

Activity

  1. Doar999 commented on Sep 19, 2026

    @Doar999
    Contributor

    I'd like to work on this issue.

  2. moved this from Todo to In progress in PowerContexton Sep 19, 2026
  3. knqiufan commented on Sep 20, 2026

    @knqiufan
    CollaboratorAuthor

    Sorry, I ran into these Windows type-checking errors while working on Desktop and put together a fix in draft PR #1676 before noticing that @Doar999 had already volunteered to work on this issue.

    I'll close that draft PR so the issue can continue with the original community contribution. The reproduction, implementation and test results will remain available as an optional reference; please feel free to take a different approach. Sorry for the overlap, and thank you for taking this on.

  4. Doar999 commented on Sep 20, 2026

    @Doar999
    Contributor

    Thank you very much for letting me know, and please don’t worry about the overlap—it was completely understandable. I found the focused Windows CI approach very helpful and will use it as a reference while finishing my PR.

  5. moved this from In progress to Done in PowerContexton Sep 21, 2026
  6. added a commit that references this issue on Sep 21, 2026
    297f405
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions