Problem
A durable session can enter state.status === "failed" after its ACP adapter exits during a prompt—for example, after exceeding limits.jsRuntime.cpuTimeLimitMs. getSession({ sessionId }) correctly preserves a useful serialized failure such as prompt_interrupted.
Calling openSession(...) again with the same durable sessionId does not restore or reset the adapter. Through the RivetKit actor API it instead returns only:
group=rivetkit code=internal_error message="An internal error occurred"
The stored failure explaining why the session cannot be reopened is lost at the action boundary. A fresh session on the same actor still opens successfully.
Expected behavior
One of the following would make this lifecycle recoverable:
openSession restores or resets a session whose durable state is failed; or
- it returns a typed terminal error such as
session_failed, including the stored serialized failure and documenting that callers must call deleteSession before recreating it.
It should not collapse this state into a generic internal_error.
Reproduction outline
- Create a durable Pi session with a stable
sessionId.
- Cause the adapter to exit during a prompt, such as by using a small JavaScript CPU-time budget.
- Confirm
getSession({ sessionId }) reports state.status === "failed".
- Call
openSession again with the same sessionId and original options.
- Observe the opaque RivetKit
internal_error.
- Open a new session ID and observe that it succeeds.
Observed with @rivet-dev/agentos@0.0.0-fix-main-wasm-ownership.8ca391b on the RivetKit actor path.
Problem
A durable session can enter
state.status === "failed"after its ACP adapter exits during a prompt—for example, after exceedinglimits.jsRuntime.cpuTimeLimitMs.getSession({ sessionId })correctly preserves a useful serialized failure such asprompt_interrupted.Calling
openSession(...)again with the same durablesessionIddoes not restore or reset the adapter. Through the RivetKit actor API it instead returns only:The stored failure explaining why the session cannot be reopened is lost at the action boundary. A fresh session on the same actor still opens successfully.
Expected behavior
One of the following would make this lifecycle recoverable:
openSessionrestores or resets a session whose durable state isfailed; orsession_failed, including the stored serialized failure and documenting that callers must calldeleteSessionbefore recreating it.It should not collapse this state into a generic
internal_error.Reproduction outline
sessionId.getSession({ sessionId })reportsstate.status === "failed".openSessionagain with the samesessionIdand original options.internal_error.Observed with
@rivet-dev/agentos@0.0.0-fix-main-wasm-ownership.8ca391bon the RivetKit actor path.