Skip to content

[Bug]: Linux keep-awake reports a held inhibitor before acquisition and hides permission errors #38495

Closed

Description

@merrkry

Before submitting

  • I searched existing issues, discussions, and PRs and did not find a duplicate.
  • I included enough detail to investigate the problem.

Area

apps/server

Steps to reproduce

Observed setup on Linux:

  1. Run t3 serve --mode web as a lingering systemd user service without an interactive login session.
  2. Leave Keep awake while agents work enabled and start an agent turn.
  3. Check the server process's permission with pkcheck --action-id org.freedesktop.login1.inhibit-block-sleep --process <server-pid>. In the observed setup, it returns status 2 and auth_admin_keep, requiring authentication.

This report uses the code-path analysis below; a fresh upstream build was not run.

Expected behavior

An unsuccessful inhibitor acquisition should produce an actionable diagnostic, including the helper's exit status and denial reason, without claiming that a sleep inhibitor is already held.

Actual behavior

The server logs keep-awake holding sleep inhibitor when the helper process starts, before acquisition is known to have succeeded. The helper immediately exits, followed by keep-awake released sleep inhibitor and a generic KeepAwakeInhibitorExited stack trace. The observed warning includes neither the exit status nor the permission-denial reason.

The same condition is retried indefinitely while work remains active, with exponential backoff capped at 10 minutes. This is repeated low-rate noise, not a high-frequency retry storm.

Impact

Minor bug or occasional failure. Keep-awake is ineffective in this setup, and its diagnostics make the reason difficult to identify. Agent work otherwise continues normally.

Version or commit

Observed in a 0.1.10-based Linux build. The same failure-handling path remains on upstream main at 856c84e4b14653facaa3ee320cd165e4e1b103c1, checked by source inspection.

Environment

NixOS, systemd 262, non-WSL Linux server, systemd user service with lingering enabled.

Code-path evidence

Workaround

Set keepAwakeWhileAgentsWork to false on servers that do not need sleep prevention. This stopped the attempts after the existing grace period.

Related issues and PRs

PR #34128 introduced this feature. Issue #38059 and PR #38072 address WSL sleep prevention; this report concerns non-WSL Linux authorization failures and their diagnostics.

Investigated with GPT-6.1 Sol via Codex in T3 Code.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions