Skip to content

[Bug] opencode session freezes after macOS lock screen while task remains “In Progress” #15431

Closed as not planned

Description

@LiusCraft

Description

When running a long task in opencode on macOS, if the system is locked for an extended period (e.g., about 1 hour), the session becomes unresponsive after unlocking. The task status still shows as “In Progress”, but the UI appears frozen and no further output is received.

The task does not complete, fail, or timeout visibly. The interface remains stuck indefinitely.


Expected Behavior

The task should either:

  • Continue running normally and stream results, or
  • Gracefully reconnect and resume output, or
  • Show a clear error if the connection was interrupted.

The session should not remain stuck in an indefinite “In Progress” state.


Actual Behavior

  • The session appears frozen after unlocking.
  • The task status still shows “In Progress”.
  • No new output is streamed.
  • The UI does not update.
  • There is no explicit error message.
  • Manual intervention (interrupt the task, or restarting the session) is required.

Plugins

plannotator

OpenCode version

1.2.15

Steps to reproduce

  1. Start a long-running task in opencode (e.g., code generation, refactoring, test execution, or build-related task).
  2. Lock the macOS screen.
  3. Leave the device locked for approximately 1 hour.
  4. Unlock the system and return to the opencode session.

Screenshot and/or share link

Image

Operating System

macOS 15.5

Terminal

iterm2

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Feb 28, 2026
  2. github-actions commented on Feb 28, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If your issue is distinct from those (e.g., the task status stays "In Progress" indefinitely rather than a UI rendering glitch), please note that distinction so maintainers can track it separately.

  3. ndizazzo commented on Mar 21, 2026

    @ndizazzo

    I experience this too, even using tools like amphetamine to stop sleep - I come back to a terminal and it's hung after locking the screen right where I left it during it's edits.

  4. jbrulmans commented on Apr 7, 2026

    @jbrulmans

    I have noticed, that if one manually locks the screen, this tends to happen. But when it locks itself after being idle or after a screensaver, it seems to be fine most of the time

  5. removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  6. sankalpmukim commented on May 24, 2026

    @sankalpmukim

    @jbrulmans I've experienced the opposite behavior unfortunately
    It's mostly related to sleep instead of screen lock
    If I manually lock the screen, and have caffeinate -d -i -u running in some background, it runs fine. Everytime I forget to do that and it goes to sleep automatically, opencode will hang
    The TUI animation will still work, but I need to interrupt execution, then send a continue, only then it restores to functioning. If I just send a continue before interrupting ongoing execution, that continue message will always be stuck on queued

  7. Tranthanh98 commented on Jun 24, 2026

    @Tranthanh98

    1. Open System settings -> search "Prevent automatic sleeping on power adapter when the display is off" -> turn on the option

    2. run opencode in terminal by using caffeinate -is opencode

  8. github-actions commented on Aug 23, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

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