Skip to main content
Unlisted page
This page is unlisted. Search engines will not index it, and only users having a direct link can access it.

Message Processing

message_processing is an optional root-level setting that edits the running context automatically in a session. It supports two features: redacting, which removes the earlier output of a particular tool or tools, and compacting, which summarizes older turns when estimated token usage crosses a fraction of the model’s context window. redacting and compacting are each optional—you can include either, both, or neither.

Example

This workflow redacts two tools by exact name, and compacts history after a threshold, keeps a minimum number of recent user messages, and uses a separate summarizer model.

{
"name": "Message Processing Demo",
"orchestrator": {
"name": "Message Processing Demo",
"model_settings": {
"ai_provider": "openai",
"name": "gpt-5-mini",
"context_size": 400000,
"api_key": {
"owner_type": "project",
"owner_id": "<your-project-id>",
"path": "secret/Custom/<openai-api-key-secret-id>/value"
}
},
"system_prompt": "You assist users with long-running tasks."
},
"message_processing": {
"redacting": {
"tools": ["fetch_pii_row", "internal_lookup"]
},
"compacting": {
"context_threshold": 0.9,
"user_messages_to_keep": 10,
"model_settings": {
"ai_provider": "openai",
"name": "gpt-5-mini",
"api_key": {
"owner_type": "project",
"owner_id": "<your-project-id>",
"path": "secret/Custom/<openai-api-key-secret-id>/value"
}
}
}
}
}

Redacting (message_processing.redacting)

Prevents tool outputs from remaining verbatim in earlier turns when you still need the conversation structure but not the full payloads.

This is useful when certain tools return results that change frequently: Rather than letting the model reference old results from the conversation history, redaction forces the model to re-run those tool calls for the most up-to-date information.

tools

A list of tool names to redact. When earlier turns contain results for those tools, matching return bodies are replaced with Chariot’s fixed placeholder: [Previous result redacted - call tool again for fresh data].

note

Redaction matches exact tool names only, not regular expression patterns.

Redaction runs before compacting when both are configured.

Compacting (message_processing.compacting)

When (input tokens + output tokens) / context_size exceeds context_threshold, Chariot summarizes older history while keeping at least user_messages_to_keep recent user turns. Set context_size on the orchestrator’s model_settings so that ratio is defined—see Models.

context_threshold (optional)

A fraction in (0, 1]. Chariot defaults this to 0.9 when omitted.

user_messages_to_keep (optional)

Minimum number of recent user turns to leave before summarizing older material. Chariot defaults this to 10 when omitted.

model_settings

The language model used for summarization. See Models.