Skip to content

feat(runtime-core): env-override the native sidecar frame timeout#1641

Draft
khaled-mansour-zid wants to merge 1 commit into
rivet-dev:mainfrom
khaled-mansour-zid:pr/frame-timeout-option
Draft

feat(runtime-core): env-override the native sidecar frame timeout#1641
khaled-mansour-zid wants to merge 1 commit into
rivet-dev:mainfrom
khaled-mansour-zid:pr/frame-timeout-option

Conversation

@khaled-mansour-zid

Copy link
Copy Markdown

Summary

NATIVE_SIDECAR_FRAME_TIMEOUT_MS (packages/runtime-core/src/sidecar-process.ts) is hardcoded to 120_000 and is the value both native-sidecar spawn sites pass as frameTimeoutMs (packages/core/src/agent-os.ts, packages/core/src/runtime-compat.ts). There is currently no way to raise it without editing the source.

Why

A single long-running host request maps to one sidecar protocol frame. Workloads with legitimately long turns — an agent turn with many tool calls, media/asset generation, etc. — exceed 120s and are killed mid-turn with timed out waiting for sidecar protocol frame, which tears down the sidecar and hangs the turn.

Change

Resolve the const from AGENTOS_SIDECAR_FRAME_TIMEOUT_MS (validated finite + positive), falling back to 120_000. Behavior is unchanged when the env var is unset.

The native sidecar is process-global (spawned once and multiplexed across sessions), so an env override is the correct surface — a per-AgentOs.create option would be ambiguous for a shared process. Happy to expose it through AgentOsOptions instead if you'd prefer, but env matches the shared-resource model.

Notes

  • One-line-of-behavior change; both existing spawn sites already read this const, so no call-site edits are needed.

NATIVE_SIDECAR_FRAME_TIMEOUT_MS is hardcoded to 120_000 and is the value both
sidecar spawn sites pass as `frameTimeoutMs`. A single long-running host request
maps to one protocol frame, so workloads with legitimately long turns (an agent
turn with many tool calls, media generation, etc.) exceed 120s and get killed
mid-turn with "timed out waiting for sidecar protocol frame". There is currently
no way to raise it without editing the source.

Make the const resolve from AGENTOS_SIDECAR_FRAME_TIMEOUT_MS (validated: finite,
positive), falling back to 120_000. The native sidecar is process-global (spawned
once and multiplexed), so an env override is the right surface rather than a
per-AgentOs.create option. Behavior is unchanged when the env var is unset.
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