Skip to content

Conversation

@michnovka
Copy link
Contributor

@michnovka michnovka commented Nov 20, 2025

Summary

Prevent Screen Sleep While Responses Stream - fixes #10290

  • add a reusable useWakeLock hook that requests the browser screen wake lock whenever LibreChat is actively generating a reply, re-acquiring after releases or tab visibility changes
  • expose anySubmittingSelector and a headless WakeLockManager that observes submission state so the wake lock is managed globally without touching chat components
  • mount the manager inside App so every conversation benefits automatically, keeping displays awake until generation completes

This keeps long-running generations from pausing when the device tries to go idle.

Change Type

Please delete any irrelevant options.

  • 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
  • Translation update

Testing

Please describe your test process and include instructions so that we can reproduce your test. If there are any important variables for your testing configuration, list them here.

Test Configuration:

Checklist

Please delete any irrelevant options.

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • I have made pertinent documentation changes
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes
  • Any changes dependent on mine have been merged and published in downstream modules.
  • A pull request for updating the documentation has been submitted.

@michnovka
Copy link
Contributor Author

@danny-avila fixed eslint, please rerun workflows. Thanks!

@danny-avila danny-avila force-pushed the feature/wake-lock-prevent-sleep branch from b54458f to c34b3a2 Compare November 21, 2025 13:31
@danny-avila danny-avila changed the base branch from main to dev November 21, 2025 14:04
@danny-avila danny-avila changed the title feat: prevent screen sleep during response generation ☕ feat: Prevent Screen Sleep During Response Generation Nov 21, 2025
@danny-avila danny-avila merged commit 040d083 into danny-avila:dev Nov 21, 2025
8 checks passed
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.

[Enhancement]: Prevent display going dark when response is generated with navigator.wakeLock

2 participants