chore: remove setPreventSleep#4981
Conversation
|
🚅 Deployed to the rivet-pr-4981 environment in rivet-frontend
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
PR Review: chore: remove setPreventSleepThis PR completes the removal of the setPreventSleep / preventSleep API that was previously deprecated and converted to a no-op. The actual behavioral change happened in an earlier PR; this one cleans up all the dead code across Rust core, NAPI bindings, TypeScript, agent-OS, tests, and docs. Code Quality - Positive:
Potential Issues: 1. Docs inconsistency in processes.mdx The line 'Active processes prevent the actor from sleeping' is retained verbatim, but it is no longer accurate. waitUntil runs during the grace window only and does not block the idle-sleep check. An active spawned process will not prevent the actor from entering sleep; it only keeps the grace window open until the process exits. Either update the sentence (e.g. 'Active processes will finish before the actor fully sleeps') or switch processes to keepAwake if the stronger guarantee is intentional. 2. Sessions and shells: no keep-awake Active sessions (activeSessionIds) and shells (activeShells) no longer have any keep-awake mechanism after syncPreventSleep was removed. They were already broken when setPreventSleep was made a no-op, so this is not a regression from this PR. Worth confirming the intended design: should active LLM sessions or open shells use keepAwake(promise)? The docs update from 'active shells also prevent sleep' to 'close shells when disconnected' is accurate, but callers should understand the actor can sleep mid-session. 3. CLAUDE.md anti-pattern note removed The removed bullet 'Do not reintroduce a prevent_sleep field, a CanSleep::PreventSleep variant, or branches that read it' served as a regression guard. Consider a short tombstone note: 'prevent_sleep flag-style sleep control was removed in favor of keep_awake(future) regions. Do not reintroduce it.' Minor preference, not blocking. Test Coverage:
Summary: Clean, mechanical removal of dead code with no new behavioral risk. The one actionable item before merge: processes.mdx retains 'Active processes prevent the actor from sleeping,' which is no longer technically correct with waitUntil semantics. |
aa74c90 to
b9eff14
Compare

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: