Skip to content

agentOs() quickstart fails with "Unknown type: function" on Bun (RC versions) #1460

@turisanapo

Description

@turisanapo

Bug

Running the official agentOS quickstart with RC versions fails:

RivetError: Unknown type: function
     group: "rivetkit",
      code: "internal_error"

Environment

  • rivetkit@2.3.0-rc.10
  • @rivet-dev/agent-os-core@0.1.2-rc.1 (via override to avoid nested 0.1.1)
  • @rivet-dev/agent-os-pi@0.1.2-rc.1
  • @rivet-dev/agent-os-common@0.0.260331072558
  • Bun 1.3.12, macOS arm64

Reproduce

Add override in package.json to prevent rivetkit from using its nested @rivet-dev/agent-os-core@0.1.1 (which crashes with error: No such built-in module: node:sqlite on Bun):

{
  "overrides": {
    "@rivet-dev/agent-os-core": "0.1.2-rc.1"
  }
}

server.ts

import { agentOs } from "rivetkit/agent-os";
import { setup } from "rivetkit";
import common from "@rivet-dev/agent-os-common";
import pi from "@rivet-dev/agent-os-pi";

const vm = agentOs({
  options: { software: [common, pi] },
});

export const registry = setup({ use: { vm } });
registry.start();

client.ts

import { createClient } from "rivetkit/client";
import type { registry } from "./server";

const client = createClient<typeof registry>("http://localhost:6420");
const agent = client.vm.getOrCreate(["my-agent"]);

const session = await agent.createSession("pi", {
  env: { ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY! },
});
console.log("Session:", session);

Run

# Terminal 1:
bun server.ts

# Terminal 2:
ANTHROPIC_API_KEY=sk-ant-... bun client.ts

Expected

Session created successfully.

Actual

Server starts fine:

RivetKit 2.3.0-rc.10 (Engine - Serverful)
  - Endpoint:     http://127.0.0.1:6420 (local native)
  - Actors:       1

Client fails:

RivetError: Unknown type: function
     __type: "RivetError",
     public: false,
   metadata: undefined,
 statusCode: 500,
      actor: undefined,
      group: "rivetkit",
       code: "internal_error"

Additional context

  • Without the override, rivetkit@2.3.0-rc.10 bundles a nested @rivet-dev/agent-os-core@0.1.1 which crashes on Bun with error: No such built-in module: node:sqlite.
  • With the override forcing 0.1.2-rc.1, the server starts but createSession fails with the error above.

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