Skip to content

feat(runtime): execute Python coroutines in Node and Pyodide - #350

Closed
bbopen wants to merge 7 commits into
codex/tywrap-value-contracts-20260919from
codex/tywrap-coroutines-20260920
Closed

bbopen wants to merge 7 commits into
codex/tywrap-value-contracts-20260919from
codex/tywrap-coroutines-20260920

Conversation

@bbopen

@bbopen bbopen commented Sep 20, 2026 •

Copy link
Copy Markdown
Owner

Scope

  • Await Python coroutine and other awaitable results in the Node subprocess bridge.
  • Run Pyodide calls on its event loop, with registered tasks and per-request cancellation.
  • Retire a Node worker when a timed-out or aborted request reached stdin, then replace it before reuse.
  • Wait for child cleanup before publishing a pool replacement. Keep failed cleanup retryable.
  • Keep the configured RPC timeout through the outer execution bound.
  • Add generated asyncText coverage, backend lifecycle tests, and maintainer documentation.

Evidence

  • Rebases onto value-contract tip 755616f.
  • Regenerated the embedded Pyodide bridge core from runtime/tywrap_bridge_core.py.
  • git diff --check 755616f..HEAD and Prettier checks passed.
  • Exact-head CI on 11a1db7 passed all 22 jobs, with none failed or skipped. An earlier run found a pool test that expected immediate replacement; this head updates its timing.
  • Independent review reproduced pool cleanup ownership gaps. This head fences replacement and retains failed cleanup from retired and unpublished workers. Fresh review is pending.
  • Local build and full tests were deferred to CI because the host reports memory pressure level 2.

Integration boundary

The real Pyodide WASM and Chromium checks live in the separate conformance branch (PR #346). This PR includes a CPython bootstrap harness and mocked Pyodide lifecycle tests. Draft integration PR #352 commits generated asyncText and real WASM cancellation tests on top of the current numeric and conformance heads. Exact-head CI on 6d5fed9 passed all 24 jobs. Its real Pyodide and Chromium job passed eight tests, including both coroutine cases.

Refs #338.

@coderabbitai

coderabbitai Bot commented Sep 20, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@bbopen
bbopen force-pushed the codex/tywrap-coroutines-20260920 branch from d0a990e to 78d3656 Compare September 20, 2026 08:04
@bbopen

bbopen commented Sep 20, 2026

Copy link
Copy Markdown
Owner Author

Integrated through reviewed implementation PR #362, merged as 43f111b43fbb0ce31dcb59f8fb489e8dadf3f191. This branch head is an ancestor of that merged commit. Final combined release candidate aa5497f867b36a76670afedbe9b34a6712a322e3 passed full CI 35508107651. Closing this component PR because its work is already on main; release publication is tracked by #354.

@bbopen bbopen closed this Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs Area: documentation area:runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant