Skip to content

agentOs(): expose actor-level options (sleepTimeout, etc.) in config #5157

@turisanapo

Description

@turisanapo

Summary

The agentOs() helper in rivetkit/agent-os does not expose actor-level options like sleepTimeout. Users who need to control how long the VM stays awake after the last client disconnects must patch the returned ActorDefinition config object directly:

const vm = agentOs({ ... });
(vm.config as any).options.sleepTimeout = 900_000;

This works (the config is not frozen), but it's fragile and relies on internal structure.

Requested Change

Add an actorOptions field to agentOsActorConfigSchema that passes through to the underlying actor() call, merged with the existing hardcoded values (sleepGracePeriod, actionTimeout):

const vm = agentOs({
  actorOptions: {
    sleepTimeout: 900_000, // 15 minutes
  },
  options: { software, mounts },
  onPermissionRequest: ...,
});

Use Case

We run long-lived conversational agents (Pi-based) behind messaging channels. After a user pauses a conversation, we want the actor to stay awake for ~15 minutes (not the 30-second default) to avoid cold-start latency on follow-up messages. The sleepTimeout knob exists on the underlying actor() config but is inaccessible through agentOs().

Current Workaround

// Patch after creation — works but relies on internal config shape
(vm.config as any).options.sleepTimeout = 900_000;

Relevant Code

  • rivetkit/src/agent-os/actor/index.ts line ~199 — hardcoded options
  • rivetkit/src/agent-os/config.tsagentOsActorConfigSchema (no passthrough)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions