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
[FEATURE]: Re-announce tools after context compaction #20290
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
After context compaction, the model loses awareness of available tools and capabilities because the compacted message history no longer contains the original tool announcements.
Problem: When SessionCompaction.process() runs, it replaces the full message history with a summary. The model no longer sees the tool definitions that were present in earlier turns. This can cause the model to:
Stop using tools it previously had access to
Become confused about what capabilities are available
Ask the user to re-list available tools
Proposed Solution: After compaction completes, inject a synthetic user message that reminds the model it still has access to all previously available tools and should continue with its current task.
// After compaction.process() returns "continue":constuserMsg: MessageV2.User={id: MessageID.ascending(),
sessionID,role: "user",time: {created: Date.now()},agent: lastUser.agent,model: lastUser.model,}yield*sessions.updateMessage(userMsg)yield*sessions.updatePart({id: PartID.ascending(),messageID: userMsg.id,
sessionID,type: "text",text: "<system-reminder>Context was compacted. You still have access to all previously available tools and capabilities. Continue with your current task.</system-reminder>",synthetic: true,})
Impact: Prevents model confusion after compaction, especially in long-running agentic sessions where compaction happens multiple times.
Risk: Minimal — single synthetic message, marked as synthetic: true so it does not appear in user-facing history.
Activity
feat: re-announce tools after context compaction
github-actions commentedon Jul 4, 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.