Context management
Summarize older messages before a conversation gets too large.
Context management is off by default. Turn on summarization when an agent needs to keep working through long conversations.
const agent = new AgentDock({
model,
contextManagement: {
summarization: {
trigger: "auto",
},
},
});With trigger: "auto", Agentdock uses the primary model's context size. It starts summarizing at 75% and keeps the newest 25% of the conversation. Supported AgentDockModel models provide the context profile.
Choose a different summary model
contextManagement: {
summarization: {
trigger: "auto",
summaryModel: AgentDockModel.openAI({ model: "gpt-5.4-nano" }),
},
}The summary model is optional. If you omit it, Agentdock uses the primary model.
Set your own limits
Use a token limit or message limit instead of "auto":
contextManagement: {
summarization: {
trigger: { tokens: 96_000 },
keep: { tokens: 24_000 },
},
}maxSteps limits model calls in a run. It does not control conversation size. Agentdock keeps system instructions and recent messages when it summarizes. Your tool ctx is not added to the prompt.

