Skip to content

fix(agentos): answer runtime requests from every child of a WebAssembly shell - #2026

Merged
eersnington merged 1 commit into
mainfrom
fix/sidecar-shell-children-runtime-requests
Oct 8, 2026
Merged

eersnington merged 1 commit into
mainfrom
fix/sidecar-shell-children-runtime-requests

Conversation

@eersnington

Copy link
Copy Markdown
Member

Fixes #2012.

  • Under a WebAssembly parent such as sh, the process pump claimed supervisor-owned events only from JavaScript children. A Python child never got its filesystem requests answered, and a nested shell never got its child_process.spawn answered. So sh -c 'python3 -c "…"', echo … | python3 -, and sh -c "sh -c 'cat f'" hung with no output.
  • The pump now claims those events from children of every runtime: process-control requests, completions, Python filesystem requests and socket completions, and signal-state updates. Stdout, stderr, and exit delivery stay with the parent's child_process.poll.
  • Adds shell_children_of_every_runtime_run_to_completion to crates/client/tests/process_e2e.rs. It runs Python, piped Python, a Python exit status, and a nested shell through one sh.
  • Same root cause as fix(native-sidecar): keep queued child services progressing beneath WASM parents #2013 and the nested-shell case in fix: service queued process-control RPCs beneath WASM parents #2007. This change keeps the fix to the pump's admission check.

@railway-app

railway-app Bot commented Oct 8, 2026

Copy link
Copy Markdown

This PR was not deployed automatically as @eersnington does not have access to the Railway project.

In order to get automatic PR deploys, please add @eersnington to your workspace on Railway.

@the-company-company the-company-company Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 1 high-severity finding

Reviewed commit d4a62c7.

Comment on lines +2810 to +2812
// The parent's poll queues every supervisor-owned event, but a
// JavaScript child can also expose one before the parent polls.
None => child.runtime == GuestRuntimeKind::JavaScript,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 High · Probe empty non-JavaScript child queues

A Python child’s first VFS request is still in its runtime event receiver, so pending_execution_events.front() is None here and this returns false. The WASM-parent branch then continues without calling try_poll_execution_event; if the parent reaches child_process.poll first, that same request is polled without owned_python_services and fails with ERR_AGENTOS_PYTHON_EVENT_OWNERSHIP instead of being serviced. This leaves the Python-under-shell path added by the E2E test dependent on a queue state that normal runtime events do not create. Probe children of every runtime when this queue is empty (for example, let the existing preserving nowait poll run for None) so Python VFS requests and WASM internal RPCs can be discovered and claimed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slop. prod's dispatcher uses poll_owned_descendant_javascript_child_process which

  1. reads the python request
  2. queues it for the supervisor
  3. calls notify_one()

the shell queues the py req, and this fix handles it. this is looking at the wrong code path

@eersnington
eersnington merged commit daae5c5 into main Oct 8, 2026
4 of 5 checks passed
@eersnington
eersnington deleted the fix/sidecar-shell-children-runtime-requests branch October 8, 2026 18:59
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.

Python launched through guest shell stalls on queued filesystem RPCs

1 participant