Skip to content

Fix packaged worker native broker read starvation#52

Merged
dovvnloading merged 1 commit into
mainfrom
codex/worker-provider-transform-gate
Jul 24, 2026
Merged

Fix packaged worker native broker read starvation#52
dovvnloading merged 1 commit into
mainfrom
codex/worker-provider-transform-gate

Conversation

@dovvnloading

Copy link
Copy Markdown
Owner

Summary

  • Fix the packaged worker transform timeout by polling PeekNamedPipe with a bounded 5 ms wait before synchronous ReadFile calls.
  • Add a regression test proving the pipe waits for available bytes before reading.
  • Update ADR-0001 Phase 2 evidence and the qualification runbook with the verified result and remaining release gates.

Root cause

The worker starts a broker reader thread so cancellation frames remain live while Pillow transforms. A blocking synchronous native read could starve the packaged transform thread under the AppContainer, so the request stopped at input_complete even though the provider and transport contracts were otherwise valid. Availability polling keeps the reader responsive without changing framing, authentication, direction, or sequence validation; pipe errors still fail closed.

Validation

  • python -m pytest -q — 260 passed, 1 skipped.
  • python -m pytest tests/test_phase2_native_broker.py -q — 10 passed, 1 skipped.
  • python -m compileall -q backend\\cortex_backend\\execution tests.
  • git diff --check.
  • Fresh packaging/build_recipe_worker.ps1 build.
  • Strict signed AppContainer/broker qualification passed: prepare, input_chunk, input_complete, and collect_output; bounded cleanup left no worker process.
  • Temporary diagnostic probes were removed.

Release-gate status

This closes the packaged provider-transform qualification blocker. Phase 2 remains blocked on dedicated signed-worker watchdog/cancellation and hostile-decoder corpus evidence, external security review, and production lifecycle wiring. No production provider launch is enabled by this PR.

@dovvnloading
dovvnloading merged commit 9ff36c8 into main Jul 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant