Skip to content

docs(rivetkit): clean up stale setPreventSleep references in docs and JSDoc#4760

Draft
NathanFlurry wants to merge 1 commit intosleep-cleanup/14-document-counter-arm-racefrom
sleep-cleanup/15-stale-prevent-sleep-refs
Draft

docs(rivetkit): clean up stale setPreventSleep references in docs and JSDoc#4760
NathanFlurry wants to merge 1 commit intosleep-cleanup/14-document-counter-arm-racefrom
sleep-cleanup/15-stale-prevent-sleep-refs

Conversation

@NathanFlurry
Copy link
Copy Markdown
Member

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copy link
Copy Markdown
Member Author

NathanFlurry commented Apr 24, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@claude
Copy link
Copy Markdown

claude Bot commented Apr 24, 2026

PR Review

Title: docs(rivetkit): clean up stale setPreventSleep references in docs and JSDoc
Changes: +9/-8 across 5 files

What the PR does

Replaces stale references to setPreventSleep(true/false) with the current c.keepAwake(promise) API in JSDoc, .describe() strings, and public-facing documentation across 5 files.

Changed lines are individually correct

  • config.ts:887noSleep JSDoc correctly points to keepAwake(promise)
  • config.ts:1811DocActorOptionsSchema describe string is consistent
  • workflow/context.ts:547-554waitUntil JSDoc accurately contrasts with keepAwake; correctly describes that waitUntil participates in the sleep grace period but does not block idle sleep
  • limits.mdx and versions.mdx — Table rows correctly updated from preventSleep to keepAwake
  • architecture.mdx — Correctly updated to c.keepAwake(promise)

No CLAUDE.md violations in the changed lines.


Issues found (cleanup is incomplete)

Must Fix:

  1. Backwards @deprecated on keepAwake itselfrivetkit-typescript/packages/rivetkit/src/actor/instance/mod.ts still reads @deprecated Use setPreventSleep(true).... This is inverted: keepAwake is the current API, not the deprecated one.

  2. Silent functional regression in agent-OSrivetkit-typescript/packages/rivetkit/src/agent-os/actor/index.ts:108 still calls c.setPreventSleep(shouldPrevent), which is now a no-op. The agent-OS actor sleep-prevention logic is silently broken and needs to be migrated to keepAwake(promise).

Should Fix:

  1. Missed preventSleep in config.ts — The .describe() string for sleepGracePeriod still says "...and waiting for preventSleep to clear after shutdown starts.". Lines 884 and 1811 were updated but this one was skipped.

Track as follow-up:

  1. Test fixture sleep-db.ts calls setPreventSleep(true/false) — since it is a no-op on the native path, sleep-prevention behavior in those tests is not actually being tested.

  2. Agent skill reference docs (.agents/skills/rivetkit/reference/actors/lifecycle.md, .agents/skills/multiplayer-game/reference/actors/lifecycle.md) still document setPreventSleep extensively.


Recommendation

Issues 1 and 2 should be fixed before merging. The inverted @deprecated tag actively guides users toward the deprecated API, and the agent-OS regression is a silent behavioral break. Issue 3 is a trivial one-liner. Issues 4 and 5 can be deferred.

@NathanFlurry NathanFlurry force-pushed the sleep-cleanup/15-stale-prevent-sleep-refs branch from 97055a6 to 1b59a25 Compare April 24, 2026 13:16
@NathanFlurry NathanFlurry force-pushed the sleep-cleanup/14-document-counter-arm-race branch from c76a37f to 3d62102 Compare April 24, 2026 13:16
@github-actions
Copy link
Copy Markdown
Contributor

Preview packages published to npm

Install with:

npm install rivetkit@pr-4760

All packages published as 0.0.0-pr.4760.808b98a with tag pr-4760.

Engine binary is shipped via @rivetkit/engine-cli on linux-x64-musl, linux-arm64-musl, darwin-x64, and darwin-arm64. Windows users should use the release installer or set RIVET_ENGINE_BINARY.

Docker images:

docker pull rivetdev/engine:slim-808b98a
docker pull rivetdev/engine:full-808b98a
Individual packages
npm install rivetkit@pr-4760
npm install @rivetkit/react@pr-4760
npm install @rivetkit/rivetkit-napi@pr-4760
npm install @rivetkit/workflow-engine@pr-4760

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant