withTrace(). Bitfab records its input, output, errors, and first-party calls. Rivet continues to own step scheduling and recovery.
This initial integration is a tracing recipe using the existing TypeScript SDK.
Subtree tracing is experimental. The actor fixture is verified with RivetKit
2.3.15 on Node.js using the TypeScript transform. Tool mocking and full actor
replay are separate work.
Configure capture
Install@bitfab/sdk and configure a TypeScript transform adapter for your server build. The transform records first-party functions called beneath withTrace().
Without a transform, the root still records its input and output. Its descendants are absent. Use withNode() to name or type a discovered call. A node does not create a span by itself.
Trace an existing step
Keep the step name and callback in place. Create the traced function inside the callback so the live step context stays in a closure. Pass the message as the recorded input.processTurn is your existing application function. It may close over the step context when it needs actor state or database access. Await all work that uses that context before the step callback returns. Rivet restricts actor capabilities to an active step callback. See Rivet’s step context rules.
Record message data as input. Store actor and turn identifiers in trace metadata. Passing a live context as input would record runtime internals without reconstructing actor state.
Trace shape and retries
The root represents one execution attempt of the business function. Calls such as input preparation, model invocation, and persistence appear underneath it when their first-party code is transformed.- Queue waits and workflow sleeps stay outside the root. Waiting for a message does not create a failed turn trace.
- A failed business function records its error and rethrows it. Rivet applies its existing retry policy.
- A retry creates a new trace for the new attempt. The actor session and turn metadata let you correlate attempts.
- A completed step restored from Rivet’s history does not invoke the callback again. It produces no new business-function trace.