Repository navigation
fix(windows): resolve worker pipe typing and POSIX-only test assumptions #1658
Description
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 win32The 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
- Refs docs(rfc): propose Tauri desktop control center #1455 and Tracking Issue: deliver a secure PowerContext desktop control center #1428; delivery-plan platform prerequisite.
- Worker source.
- Test source.
- Existing Windows portability fixes do not eliminate these diagnostics at the inspected commit.
- Open for community implementation as a focused
masterPR. Desktop scaffolding can proceed in parallel, but these errors must be resolved or correctly platform-scoped before claiming Windows qualification.
Desktop consumer: #1654.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
Doar999 commentedon Sep 19, 2026
I'd like to work on this issue.
knqiufan commentedon Sep 20, 2026
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.
Doar999 commentedon Sep 20, 2026
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.
fix(windows): make worker pipe typing portable (oceanbase#1682)