-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Bug]: Potential resource leak in runBoundTurnWithMissingThreadRecovery -- retry not wrapped in try/finally after thread spawn #85458
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.bugSomething isn't workingSomething isn't workingclawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.staleMarked as stale due to inactivityMarked as stale due to inactivity
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.bugSomething isn't workingSomething isn't workingclawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.staleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Priority
None yet
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
Source review of dist/node-cli-sessions-C0-r5Nk8.js (OpenClaw 2026.5.18) found that runBoundTurnWithMissingThreadRecovery spawns a new conversation thread via startCodexConversationThread and then awaits runBoundTurn for the retry without wrapping the retry in try/finally; if the retry awaits and throws, the freshly spawned thread has no cleanup path. Not observed firing at runtime in this deployment; reporting as a source-level finding for maintainer review.
Steps to reproduce
NOT_ENOUGH_INFO
Expected behavior
NOT_ENOUGH_INFO
Actual behavior
NOT_ENOUGH_INFO
OpenClaw version
2026.5.18 (installed); latest release at time of filing is 2026.5.20 -- source lines referenced are from the 2026.5.18 dist build
Operating system
Debian 12 (LXC container, Proxmox host)
Install method
npm global (/usr/lib/node_modules/openclaw)
Model
NOT_ENOUGH_INFO (finding is source-level, model-independent)
Provider / routing chain
NOT_ENOUGH_INFO (finding is source-level, routing-independent)
Additional provider/model setup details
NOT_ENOUGH_INFO (finding is source-level, provider-independent)
Logs, screenshots, and evidence
Impact and severity
NOT_ENOUGH_INFO (no observed runtime occurrence; latent defect reported from source review only)
Additional information
Source-level analysis of the suspect function (paths and line numbers refer to OpenClaw 2026.5.18 as installed):
File: /usr/lib/node_modules/openclaw/dist/node-cli-sessions-C0-r5Nk8.js
Function: runBoundTurnWithMissingThreadRecovery (approx lines 709-730)
Observed structure (paraphrased; exact bytes available on request):
Leak vector:
Why this is latent and not currently observed:
Suggested fix area (illustrative, not a patch):
Adjacent issues observed during duplicate search (cross-references, not duplicates):
Reporter notes: