vibe.assistant.history_pruner¶
History pruning utilities for conversation context management.
HistoryPruner ¶
Prunes conversation history to optimize context window usage.
Provides two pruning strategies: 1. Response checkpoint pruning: For APIs that support response_id continuation 2. Consolidated strategy pruning: Aggressive pruning when draft is in system prompt
prune_to_response_checkpoint ¶
Prune history to messages after the last response_id checkpoint.
When an AssistantMessage has a response_id, the Responses API already has context up to that point. We only need to send messages that came after.
| Parameters: |
|
|---|
| Returns: |
|---|
prune_for_consolidated_strategy ¶
Prune conversation history for consolidated draft strategy.
With consolidate_draft=True, system prompt contains current state, so we only need minimal history: - INITIAL user message (the goal/instruction from template - critical!) - Last assistant message (shows what was just done and what questions were asked) - Tool responses to those calls - User message (if answering questions)
All older block manipulation history is redundant with system prompt.
| Parameters: |
|
|---|
| Returns: |
|
|---|