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
The child session starts with no context from the parent. For a Discord channel used as the agent's "home" channel, this manifests as the agent suddenly forgetting recent conversations at seemingly random intervals.
Observed in production
Today on 2026.4.8: our #chat parent session grew to 154,551 tokens vs the 100k cap. 4 child threads opened over a morning all started cold. Users experienced the agent as "amnesiac" — forgetting things it was told 30 min ago.
Current workaround
Raised session.parentForkMaxTokens to 200000. Opus has ~1M context so 200k is still conservative, but this is a manual tuning exercise per deployment. When the session grows past 200k we'll hit the same silent fork skip again.
Proposed solutions (pick one or more)
Auto-compact the parent before forking — if parentTokens > maxTokens, trigger a compaction pass on the parent session before forking, instead of silently skipping. This feels like the right default given the new pluggable compaction provider (feat: add pluggable compaction provider registry #56224) and memoryFlush (2026.4.7).
Promote the WARN to a visible signal — post a one-time message to the originating channel ("⚠️ context window full, starting fresh — previous conversations not carried over") so users understand why the agent forgot things. Currently only logged.
Auto-scale the default — default maxTokens to e.g. min(500_000, modelContextWindow × 0.25) instead of the static 100_000. For Opus/Sonnet/GPT-5 the 100k default is now extremely conservative.
Problem
session.parentForkMaxTokensdefaults to100000. When a parent session exceeds this,session-initsilently skips the fork with a WARN-level log line:The child session starts with no context from the parent. For a Discord channel used as the agent's "home" channel, this manifests as the agent suddenly forgetting recent conversations at seemingly random intervals.
Observed in production
Today on 2026.4.8: our
#chatparent session grew to 154,551 tokens vs the 100k cap. 4 child threads opened over a morning all started cold. Users experienced the agent as "amnesiac" — forgetting things it was told 30 min ago.Current workaround
Raised
session.parentForkMaxTokensto200000. Opus has ~1M context so 200k is still conservative, but this is a manual tuning exercise per deployment. When the session grows past 200k we'll hit the same silent fork skip again.Proposed solutions (pick one or more)
Auto-compact the parent before forking — if
parentTokens > maxTokens, trigger a compaction pass on the parent session before forking, instead of silently skipping. This feels like the right default given the new pluggable compaction provider (feat: add pluggable compaction provider registry #56224) andmemoryFlush(2026.4.7).Promote the WARN to a visible signal — post a one-time message to the originating channel ("⚠️ context window full, starting fresh — previous conversations not carried over") so users understand why the agent forgot things. Currently only logged.
Auto-scale the default — default
maxTokensto e.g.min(500_000, modelContextWindow × 0.25)instead of the static100_000. For Opus/Sonnet/GPT-5 the 100k default is now extremely conservative.Related