You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TUI power inhibitor ignores prevent_sleep_while_streaming=false #452
autonomous: clearHands-off: unambiguous bug, obvious fix, no decisions. Don't even look - an agent can fully solve.bugSomething isn't workingpriority: mediumP2 - normal prioritytriage: fixed-pending-releaseFixed in code/committed; will close automatically on next release
[power].prevent_sleep_while_streaming = false disables the shared daemon power inhibitor, but the TUI client can still acquire a power inhibitor while a turn is processing.
On Linux this can still hit the systemd-inhibit / polkit / pkttyagent path even though the config says sleep prevention is disabled.
Repro
Set:
[power]
prevent_sleep_while_streaming = false
Start a Linux TUI/remote-client session.
Run an agent turn.
Observe the power-inhibit path can still be used from the TUI sleep guard.
Expected
When prevent_sleep_while_streaming = false, neither the daemon nor the TUI should acquire a power inhibitor.
Reference fix
I could not create a PR from this account, but pushed a minimal reference fix here:
Fixed in 6b94b54. The TUI sleep guard (sync_sleep_guard()) now re-checks [power].prevent_sleep_while_streaming on every call, matching the daemon-side gate, so neither the daemon nor the TUI acquires a power inhibitor when the config disables it. Thanks @pigmej for the reference fix, which this follows (the dev_cargo.sh linker hunk in the reference branch was unrelated and not taken).
Confirmed the user-visible Linux failure mode on jcode v0.55.0 over an SSH/TTY session: when streaming begins with sleep prevention enabled, the terminal polkit path writes text such as org.freedesktop.login1.inhibit-block-sleep, polkit-agent-helper-1, and Password: directly over the Ratatui screen.
The post-fix configuration works as expected in v0.55.0:
[power]
prevent_sleep_while_streaming = false
After changing it, fully exit the affected TUI, run reset, and restart jcode to clear the already-contaminated frame. No polkit rule, password, or elevated permission is needed.
Trade-off: jcode no longer prevents the machine from sleeping during model streaming; normal OS power policy and other inhibitors remain unchanged.
autonomous: clearHands-off: unambiguous bug, obvious fix, no decisions. Don't even look - an agent can fully solve.bugSomething isn't workingpriority: mediumP2 - normal prioritytriage: fixed-pending-releaseFixed in code/committed; will close automatically on next release
Activity
1jehuang commentedon Jul 7, 2026
Fixed in 6b94b54. The TUI sleep guard (
sync_sleep_guard()) now re-checks[power].prevent_sleep_while_streamingon every call, matching the daemon-side gate, so neither the daemon nor the TUI acquires a power inhibitor when the config disables it. Thanks @pigmej for the reference fix, which this follows (thedev_cargo.shlinker hunk in the reference branch was unrelated and not taken).Will be included in the next release.
fix(tui): honor prevent_sleep_while_streaming=false in TUI sleep guard
0p9b commentedon Jul 23, 2026
Confirmed the user-visible Linux failure mode on jcode v0.55.0 over an SSH/TTY session: when streaming begins with sleep prevention enabled, the terminal polkit path writes text such as
org.freedesktop.login1.inhibit-block-sleep,polkit-agent-helper-1, andPassword:directly over the Ratatui screen.The post-fix configuration works as expected in v0.55.0:
After changing it, fully exit the affected TUI, run
reset, and restart jcode to clear the already-contaminated frame. No polkit rule, password, or elevated permission is needed.Trade-off: jcode no longer prevents the machine from sleeping during model streaming; normal OS power policy and other inhibitors remain unchanged.
fix(tui): honor prevent_sleep_while_streaming=false in TUI sleep guard
fix(tui): honor prevent_sleep_while_streaming=false in TUI sleep guard