Repository navigation
fix(runtime): complete a context call when its result settles - #2073
Merged
Merged
Conversation
A context call or JavaScript/TypeScript evaluation now completes when its top-level evaluation settles and its in-flight bridge calls finish, instead of waiting for the guest event loop to drain. Leftover timers and immediates are cancelled and ref'd sockets, servers, dgram sockets, and child processes are closed, with a summary on stderr. Context globals survive. One-shot execute keeps Node's wait-for-ref'd-handles behavior. Previously a leftover setInterval or listening server turned a finished call into timed_out and killed the context. The evaluation wrapper no longer needs a keep-alive interval. Fixes #1991
Contributor
📟 Pip-Boy ·
|
| package (linux-x64-gnu) | @latest |
base | this PR | Δ vs base | packages |
|---|---|---|---|---|---|
@rivet-dev/agentos-core |
458.2 MB | 458.2 MB | 458.2 MB | 0 | 121 (0) |
@rivet-dev/agentos-node-pty |
7.6 KB | 18.0 KB | 18.0 KB | 0 | 1 (0) |
@rivet-dev/agentos-posix |
253.6 MB | 253.6 MB | 253.6 MB | 0 | 7 (0) |
@rivet-dev/agentos-runtime-core |
253.6 MB | 253.6 MB | 253.6 MB | 0 | 6 (0) |
@rivet-dev/agentos-sandbox |
495.5 MB | 495.5 MB | 495.5 MB | 0 | 177 (0) |
@rivet-dev/agentos-toolchain |
130.8 KB | 141.2 KB | 141.2 KB | 0 | 2 (0) |
🧹 Rust dependencies · cargo deny + cargo shear
| check | new in this PR | fixed | existing on base |
|---|---|---|---|
| advisories | ✅ 0 | 0 | 25 |
| licenses | ✅ 0 | 0 | 0 |
| sources | ✅ 0 | 0 | 0 |
| bans | ✅ 0 | 0 | 0 |
| unused | ✅ 0 | 0 | 16 |
🦀 Binaries · publish Dockerfiles, --release
Base: main@8cc8f8b, the merge base.
| artifact | npm @latest |
base | this PR | Δ vs base |
|---|---|---|---|---|
agentos-native-sidecar linux-x64-gnu |
143.6 MB | 143.6 MB | 143.7 MB | +127.9 KB (+0.1%) |
⏱ Timing
| job | wall time | slowest step |
|---|---|---|
zizmor |
7s | checkout · 2s |
changes |
32s | checkout · 28s |
native · linux-x64-gnu |
14m16s | Build with the publish Dockerfile · 13m53s |
hygiene |
51s | checkout · 23s |
footprint |
2m04s | Pack this commit · 40s |
⏭ self-test |
— | skipped |
report |
18s | setup-node · 4s |
🔭 Full CI trace for this commit
One OpenTelemetry trace of CI and Pip-Boy for 3fdc1a6: every job and step, with the sizes above attached. Run after CI finishes.
pnpm install --frozen-lockfile --filter 'pipboy...'
pnpm --filter pipboy pipboy trace --sha 3fdc1a64733f57c76acc3cf90d62c6bbbdda01faAdd --otlp <url> to send it to any OTLP/HTTP collector.
Agent instruction: From a rivet-dev/agentos checkout, run the commands above, then read the trace file the last command prints. List the slowest jobs and steps and explain where CI time went.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1991.
A context call that left a
setIntervalor a listening server behind returnedtimed_outand lost the context's state, because every call waited for the guest event loop to drain.evaluate, now complete when the top-level evaluation settles and their in-flight host calls finish.executekeeps Node's behavior and waits for ref'd handles.evaluateno longer needs a keep-alive interval.javascript.mdxdocuments the completion rule and the updatedexecution_busybehavior.(setInterval(() => {}, 50), globalThis.answer = 41), thenanswer + 1maintimed_out, context killed4142Known limits: a leftover HTTP/2 server or an open
process.stdinread has no close hook yet, so a call that leaves one still ends at its timeout. Python contexts are unchanged.