Summary
Several reports describe the same broad failure family: long-running OpenClaude sessions can either exhaust the Node/V8 heap or stop after context-window failures even though auto-compact is expected to keep the workflow alive.
This issue is the canonical tracker for consolidating the related reports:
The symptoms are not all identical, but they overlap enough that tracking them separately made it hard to tell what is fixed, what is mitigated, and what still needs validation.
Consolidated Problem
OpenClaude had at least three related failure modes:
- Long sessions could keep growing in process memory until Node/V8 aborted with
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory.
- Auto-compact could reduce model context while retained in-memory transcript objects, native
toolUseResult payloads, tool outputs, session state, or teammate-agent histories still grew in the process heap.
- When a provider returned a context-window error after a large tool result, the current task could stop instead of automatically compacting/reducing context and retrying once.
These are provider-independent in the reports: affected configurations include Anthropic/litellm proxy, Codex/GPT-5.5, MiMo via OpenGateway, MiniMax, and first-party Anthropic. Reports also span macOS, Windows, and Linux.
Implementation Status
The main implementation work is now covered by #1856 and #1858:
Earlier mitigations that remain relevant:
Report Coverage
#1046 - Memory error and no autocompact
This overlaps both the heap/OOM reports and context/autocompact recovery. #1858 addresses the no-autocompact/context-overflow and retained transcript growth paths that apply here. The remaining proof point is a representative long-session heap soak after #1858 lands.
#1105 - Auto-recover from context-window errors after large tool results
#1858 implements the retry-after-failure path preferred in the issue discussion: provider context-overflow errors are tagged, withheld from the stream while recoverable, followed by forced compaction, and retried once with explicit recovery context. It does not add pre-flight token estimation before provider send.
#1148 - Windows OOM
Launcher heap fixes already landed before this tracker, and #1856/#1858 address the concrete retained-memory and autocompact recovery paths identified since then. The broad Windows long-session claim still needs soak evidence after #1858 lands.
#1258 - Node/V8 process crashes during long-running tasks
#1858 targets the retained-history/autocompact/provider-conversion mechanisms called out by this report, including active-message hard caps, teammate history bounding, and OpenAI-compatible message pruning. The remaining proof point is a real long-session heap soak across representative providers/OSes.
#1373 - Auto-compact circuit breaker disables compaction
#1375 already made the breaker retry after cooldown. #1858 adds the active-message safety cap, forced compaction, failure diagnostics, and pre-provider-call safety blocking so repeated failed compactions do not silently allow unbounded state.messages growth.
#1379 - Remaining long-session OOM guards after auto-compact cooldown
#1858 covers the listed remaining work: bounded main active-message behavior, in-process teammate allMessages bounding, provider conversion pressure reduction, compact-boundary/tool-state cleanup, and tests for pruned tool-call/tool-result histories.
#1839 - Idle PerformanceMeasure/FPS/MCP/heapdump retention
#1856 fixed the concrete #1839 root cause and secondary retention paths. This path is no longer an open implementation blocker for this tracker.
Still Open / Remaining Work
This tracker should stay open until the implementation PR has landed and a representative long-session heap validation has been completed or explicitly split into a follow-up issue.
Remaining checklist:
Acceptance Criteria
- Long-running sessions do not grow heap without bound after repeated compactions.
- Retained native tool results and old transcript/tool payloads are released or bounded after compaction.
- Auto-compact failure/cooldown states are visible and recoverable.
- Provider context-window overflow from a large tool result either pre-compacts before send or retries once after compacting/reducing context.
- The behavior is covered by focused tests plus a documented long-session validation procedure or follow-up issue for any remaining soak-only risk.
Supersedes
This issue supersedes #1046, #1105, #1148, #1258, #1373, #1379, and #1839 for tracking the consolidated long-session OOM/autocompact recovery failure family.
Summary
Several reports describe the same broad failure family: long-running OpenClaude sessions can either exhaust the Node/V8 heap or stop after context-window failures even though auto-compact is expected to keep the workflow alive.
This issue is the canonical tracker for consolidating the related reports:
The symptoms are not all identical, but they overlap enough that tracking them separately made it hard to tell what is fixed, what is mitigated, and what still needs validation.
Consolidated Problem
OpenClaude had at least three related failure modes:
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory.toolUseResultpayloads, tool outputs, session state, or teammate-agent histories still grew in the process heap.These are provider-independent in the reports: affected configurations include Anthropic/litellm proxy, Codex/GPT-5.5, MiMo via OpenGateway, MiniMax, and first-party Anthropic. Reports also span macOS, Windows, and Linux.
Implementation Status
The main implementation work is now covered by #1856 and #1858:
allMessagesbounding, compact-boundary/tool-state cleanup, OpenAI-compatible conversion pruning, memory guard diagnostics, and focused long-session guard tests.Earlier mitigations that remain relevant:
--expose-gc.Report Coverage
#1046 - Memory error and no autocompact
This overlaps both the heap/OOM reports and context/autocompact recovery. #1858 addresses the no-autocompact/context-overflow and retained transcript growth paths that apply here. The remaining proof point is a representative long-session heap soak after #1858 lands.
#1105 - Auto-recover from context-window errors after large tool results
#1858 implements the retry-after-failure path preferred in the issue discussion: provider context-overflow errors are tagged, withheld from the stream while recoverable, followed by forced compaction, and retried once with explicit recovery context. It does not add pre-flight token estimation before provider send.
#1148 - Windows OOM
Launcher heap fixes already landed before this tracker, and #1856/#1858 address the concrete retained-memory and autocompact recovery paths identified since then. The broad Windows long-session claim still needs soak evidence after #1858 lands.
#1258 - Node/V8 process crashes during long-running tasks
#1858 targets the retained-history/autocompact/provider-conversion mechanisms called out by this report, including active-message hard caps, teammate history bounding, and OpenAI-compatible message pruning. The remaining proof point is a real long-session heap soak across representative providers/OSes.
#1373 - Auto-compact circuit breaker disables compaction
#1375 already made the breaker retry after cooldown. #1858 adds the active-message safety cap, forced compaction, failure diagnostics, and pre-provider-call safety blocking so repeated failed compactions do not silently allow unbounded
state.messagesgrowth.#1379 - Remaining long-session OOM guards after auto-compact cooldown
#1858 covers the listed remaining work: bounded main active-message behavior, in-process teammate
allMessagesbounding, provider conversion pressure reduction, compact-boundary/tool-state cleanup, and tests for pruned tool-call/tool-result histories.#1839 - Idle PerformanceMeasure/FPS/MCP/heapdump retention
#1856 fixed the concrete #1839 root cause and secondary retention paths. This path is no longer an open implementation blocker for this tracker.
Still Open / Remaining Work
This tracker should stay open until the implementation PR has landed and a representative long-session heap validation has been completed or explicitly split into a follow-up issue.
Remaining checklist:
Acceptance Criteria
Supersedes
This issue supersedes #1046, #1105, #1148, #1258, #1373, #1379, and #1839 for tracking the consolidated long-session OOM/autocompact recovery failure family.