Skip to content

fix(server): keep OpenCode sessions alive while child sessions run - #60

Closed
macodev00 wants to merge 1 commit into
mainfrom
cursor/opencode-quiet-child-liveness-f037
Closed

macodev00 wants to merge 1 commit into
mainfrom
cursor/opencode-quiet-child-liveness-f037

Conversation

@macodev00

Copy link
Copy Markdown
Owner

What Changed

Related OpenCode child session.status is quiet liveness for the provider-session reaper. busy and retry hold that thread's binding; idle, deletion, and session teardown release the child. While any related child is still live, an inactivity sweep leaves the OpenCode session running. The idle clock is not reset, so the next sweep can reap once the last child is gone and user-facing activity is already past the window. Other providers are unchanged.

Why

Fixes pingdotgg#13514

On a headless OpenCode session, long-running background subagents keep the provider process busy after the parent turn settles. They do not emit task.* events, so the reaper treated that silence as inactivity and stopped the session with inactivity_threshold, which cancels the tracked sessions. Inactivity has to ignore that clock while a related child session is still alive, because stopping the session aborts those children.

The hold stays inside the reaper. Task activity is unchanged, so the sidebar liveness pill, thread settlement, and storage cleanup keep their existing task-event behavior.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes
Open in Web Open in Cursor 

OpenCode background subagents stay busy after the parent turn settles, but
they never emit task events, so the reaper treated the thread as idle and
stopped the provider session.

Related child session.status is now quiet liveness for that reaper check.
busy and retry hold the session; idle and deletion release it. The signal
stays inside the reaper and leaves task activity unchanged.

Fixes pingdotgg#13514
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Sep 28, 2026
@macodev00

Copy link
Copy Markdown
Owner Author

Opened upstream.

@macodev00 macodev00 closed this Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: session reaper counts opencode background agents activity as idle time on remote connection (headless)

1 participant