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
[BUG] Feishu plugin: orphaned sessions continue looping after abort, causing sustained high CPU #33050
When a Feishu (飞书) session is aborted by the user (e.g., via cancel in the Feishu UI), the session is marked as orphan=true but its processing loop is not terminated. The opencode process continues to re-enter the loop (step=0 → step=1 → ...), making repeated LLM inference requests indefinitely.
If the parent terminal/process exits, the opencode main process becomes an orphan (PPID=1) and keeps consuming high CPU (observed 370-420% CPU, ~8.5GB RSS) with no way to stop it except manually killing the process.
Root Cause
The Feishu plugin's session.error handler logs orphan=true but does not properly clean up the session's pending tasks or prevent the session from re-entering the processing loop. This is distinct from the existing orphan session issues (#19023, #30683, #31787) which deal with DB records or project ID drift — this is specifically about the Feishu WebSocket channel triggering repeated loop restarts for aborted sessions.
Additionally, when the Feishu WebSocket connection drops (e.g., certificate verification errors), the reconnect logic may trigger re-processing of orphaned sessions.
Reproduction
Start opencode with Feishu plugin configured
Send a message from Feishu to trigger a session
Cancel/abort the session from the Feishu UI
Observe that the session is marked orphan=true but continues looping
Close the terminal running opencode
The opencode process becomes orphaned (PPID=1) and continues consuming high CPU
Abort needs to be a terminal session state with cancellation propagated into the loop. When Feishu marks orphan=true, also cancel pending tasks, clear queued prompt work, and write session.aborted with source, channel id, final step, and cleanup result.
The loop should check that terminal flag before re-entering step 0. Parent process death and WebSocket reconnect should not revive an aborted session unless a new user action explicitly resumes it. Add a max-loop guard as a final failsafe.
Activity
Necmttn commentedon Jun 21, 2026
Abort needs to be a terminal session state with cancellation propagated into the loop. When Feishu marks
orphan=true, also cancel pending tasks, clear queued prompt work, and writesession.abortedwith source, channel id, final step, and cleanup result.The loop should check that terminal flag before re-entering step 0. Parent process death and WebSocket reconnect should not revive an aborted session unless a new user action explicitly resumes it. Add a max-loop guard as a final failsafe.
Generated with ax.
github-actions commentedon Aug 21, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.