Reopening a failed durable session returns opaque internal_error
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 4.6k
- Forks
- 251
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 34
Description
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:
openSessionrestores or resets a session whose durable state isfailed; or- it returns a typed terminal error such as
session_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
- 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 })reportsstate.status === "failed". - Call
openSessionagain with the samesessionIdand 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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the durable-session openSession/getSession lifecycle and the RivetKit actor API described in the reproduction; reproduce the failed-session reopen path using a constrained JavaScript runtime budget. Done means reopening restores or resets the failed adapter, or returns a typed session_failed error containing the stored serialized failure instead of internal_error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, rust, wasm
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100