-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Subagent abort-settle fails to release .jsonl.lock, permanently breaking the session #95833
Copy link
Copy link
Closed
Closed
Copy link
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.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:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.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.
Description
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.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:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.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.
Type
Fields
Priority
None yet
Summary
When an embedded subagent run exceeds
stuckSessionAbortMs(default 900s, 90s in our environment), the abort-settle mechanism times out but does not release the session.jsonl.lockfile. Once locked, every subsequent message to that session returns "Something went wrong" until the lock file is manually removed.Reproduction
stuckSessionAbortMsto a low value (e.g., 90s)sessions_spawnwithruntime="subagent") that takes longer than that threshold.jsonl.lockfile persists for minutes after the run has "ended".jsonl.lockfile restores the sessionRoot Cause
Two bugs:
Bug 1 — Abort-settle does not release lock. When the abort-settle process itself times out (stuck waiting for a subagent that will not respond), it exits without cleaning up the lock file. The lock file should always be released on every exit path.
Bug 2 — Default
stuckSessionAbortMsis too high. The default is 900s (15 minutes). A user has to wait 15 minutes before the system even attempts an abort, during which time the session is completely unresponsive. A more reasonable default would be 30-60s.Impact
Environment
stuckSessionAbortMsconfiguration optionsessions_spawnwithruntime="subagent"where the subagent exceeded the abort timeoutWorkaround
A watchdog process running on a cron timer that finds
.jsonl.lockfiles older thanstuckSessionAbortMs + bufferand removes them. This is fragile and should not be necessary.