Manage conversation history
Reduce the history sent to the model while retaining the stored transcript.
Limit history size
Section titled “Limit history size”Choose a context strategy to reduce the history sent to the model as a conversation grows. Outpost can summarize older messages or keep only a bounded part of the history; the stored transcript remains available.
Once the serialized history exceeds 200,000 characters, the model summarizes the older messages. The next request carries the first prompt, the summary and at least the six most recent messages.
Choose a strategy
Section titled “Choose a strategy”Choose summarizeHistory() when a long discussion needs to retain its decisions: older messages become a summary, at the cost of a model call. Choose truncateToolResults() when a few tool outputs dominate the history: it shortens them without generating a summary. Keep enough recent messages for the current task.
API reference: summarizeHistory, truncateToolResults and HarnessContextStrategyOptions.
A summary uses the agent’s model and provider. Its tokens count in the turn’s usage and in the harness limits.usage budget.
The API records the summary instructions and reinsertion prefix, plus the tool-result truncation marker. Their wording is fixed; a custom context strategy can replace the mechanism.
Write a custom strategy
Section titled “Write a custom strategy”Compose strategies when a conversation needs both shorter tool results and a summary. This example applies the two in that order.
API reference: HarnessContextStrategyOptions and HarnessContextInput.
The returned list must start and end with a user message and keep each tool call with its result. Outpost validates it and removes replayed reasoning blocks before the next request.
Compaction and the stored transcript
Section titled “Compaction and the stored transcript”Compaction changes what the model receives, not what is stored. The transcript keeps every earlier message and records each compaction; continuing the conversation resumes from the compacted history. Observers receive a compaction event with the strategy name and the message count.
Limits
Section titled “Limits”summarizeHistory()measures serialized characters, not tokens. Leave a margin when you sizetriggerCharactersfrom the model’s window.- An incomplete or empty summary fails the turn with code
response. conversations: falsestops storing the transcript and disables continuation and response repairs (Conversations).
API: summarizeHistory · truncateToolResults · defineHarnessContextStrategy · defineHarnessInstructions · defineHarnessSkill · HarnessOptions.

