(feat) Enhance Auto-Summarization with Goal-Directed Handoff #2140
Closed
francescoalemanno
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Feature Proposal: Enhance Auto-Summarization with Goal-Directed Handoff
PR : #2142
Problem
Crush currently manages context window pressure with auto-summarization: when remaining tokens drop below a threshold, the model produces a structured summary that replaces the conversation history. This has three known issues:
Blind extraction. The summary prompt is generic — it captures everything equally rather than prioritizing what matters for the next task. A 50-message debugging session might preserve debugging details you'll never revisit while dropping the architectural decision you actually need.
No look-back. Once summarized, the original messages are gone. If the summary missed something, it's lost. There's no way to search or revisit the pre-summary conversation.
Worst-case timing. Summarization triggers when context is nearly full — precisely when the model is most degraded and least likely to produce a good summary.
OpenAI's own internal Codex report confirmed that recursive summarization (summaries of summaries) distorts earlier reasoning, with accuracy declining as compaction count increases. Amp retired compaction entirely in October 2025 for these reasons.
Proposal: Handoff
Replace auto-summarization with a two-part system:
1.
/handoffcommand with goal-directed enrichmentThe user triggers handoff manually (or it's forced near capacity) with a stated goal:
An enrichment subagent analyzes the current conversation through the lens of that goal, extracting only what's relevant. The result is placed in a fresh session as the opening context. The user can review and edit before submitting.
This is fundamentally different from summarization: instead of "compress everything," it's "extract what I need for this specific next step."
2.
search_in_the_pasttool with archived contextWhen a handoff occurs, the original messages aren't discarded — they're archived as searchable text in memory. A new
search_in_the_pasttool spawns a subagent equipped with mini-tools (past_context_grep,past_context_read,past_context_stats) that can navigate the full archived history.This means: if the enrichment step missed something, the agent can still find it. Across multiple handoffs, the archive accumulates, giving the agent access to the entire session's history without bloating the active context window.
Why This Matters
Implementation Scope
The feature would involve:
PastContextstorage — thread-safe in-memory store for archived message text, with grep and line-range read supportSessionAgent(following the existingagentic_fetch_tool.gopattern) that receives the archived context + user goal and extracts relevant informationsearch_in_the_pasttool — anotherSessionAgentwith three mini-tools for navigating the archive, registered alongside existing tools/handoffcommand — TUI integration with manual trigger + forced trigger near capacityCrush already has the infrastructure this needs:
SessionAgentspawning from tools (agentic fetch), embedded markdown prompts, tool registration, and the TUI command system. The heaviest lift is adapting message rendering to Crush's message types and wiring the enrichment flow through the coordinator.Prior Art
Beta Was this translation helpful? Give feedback.
All reactions