On Advanced Context Management

When using the 'Summarize History' modifier, can we configure the summarization prompt to specifically preserve certain metadata like tool call IDs so that a resumed conversation can still reference previously executed app actions?

Answered by Frameworks Engineer in 893002022

The summarizeHistory modifier allows customization of the instructions which are used to produce the conversation summary. However, it will condense all entries into a .prompt entry.

If you're looking to preserve .toolCalls entries during summarization, you should be able to implement your own modifier using DynamicProfileModifier and either historyTransform or lifecycle modifiers (like onPrompt) to define your own summarize operation. The agentic app experiences session talks through these concepts: https://developer.apple.com/videos/play/wwdc2026/242/

The summarizeHistory modifier allows customization of the instructions which are used to produce the conversation summary. However, it will condense all entries into a .prompt entry.

If you're looking to preserve .toolCalls entries during summarization, you should be able to implement your own modifier using DynamicProfileModifier and either historyTransform or lifecycle modifiers (like onPrompt) to define your own summarize operation. The agentic app experiences session talks through these concepts: https://developer.apple.com/videos/play/wwdc2026/242/

Hi! 'Summarize History' modifier currently doesn't support preserving metadata like tool call IDs.

However, the 'Summarize History' modifier is implemented by combining a few primitives in Foundation Models — it asks a language model to summarize transcript when there's a prompt event (onPrompt), and overwrite the session history using summarization results.

You can also create your own modifier to preserve metadata while summarizing events. The session Build agentic app experiences with the Foundation Models framework covers some great details about lifecycle events.

On Advanced Context Management
 
 
Q