On this page
On this page
Gateway
Configuration — agent heartbeat, compaction, and streaming
agents.defaults.* keys that govern when an agent runs on its own, how its transcript is compacted and pruned, and how partial output reaches a chat.
agents.defaults.heartbeat
Heartbeat configuration has moved to ordinary automation jobs. Run
openclaw doctor --fix to migrate supported agents.defaults.heartbeat and
agents.entries.<id>.heartbeat settings before starting the upgraded Gateway.
Doctor preserves the job's schedule, scratch, model policy, and delivery settings;
edit or disable the resulting job in Automations instead of restoring this key.
Use each job's activeHours, idleOnly, payload.skipIfScratchEmpty, and
delivery policies for monitoring. Fresh setup creates a disabled Proactive
check for the ambient owner; reloads and restarts do not recreate deleted jobs.
See Heartbeat migration and
Monitoring policies.
agents.defaults.systemAgent
Selects the agent whose model and credentials own ambient OpenClaw system work: system-agent and Custodian consults, and the fallback owner whenever an ambient path omits agentId. That includes models.list, models.authStatus, skills.status, and doctor.memory.status, the default agent directory and workspace behind auth, model-catalog, and doctor resolution, outbound channel bootstrap and queued-delivery recovery, unscoped main-session routing, Talk relay ownership, and first-run onboarding:
An explicit request agentId always wins, followed by systemAgent.agentId, a legacy default owner when ownership is not explicit, and finally the sole configured agent. Retained migration provenance alone never designates an explicit fleet's runtime default. Delegated consults with a requesting agent keep that requester as their owner.
With agents.ownership: "explicit", this setting also supplies the recorded default
for operations that support default-agent selection, including the agent-list
badge, unbound channel routing, unscoped Gateway reads, openclaw sessions,
openclaw hooks status, and TUI startup. Doctor records the migrated default here
so these operations keep the same owner after restart. Explicit bindings, requests,
and session-store owners take precedence. Use --agent <id> to select a different
agent or openclaw sessions --all-agents to inspect the whole fleet. Operations
that require explicit selection, such as openclaw models, keep that requirement.
An ownerless multi-agent fleet has no default badge. Set a configured id with
openclaw config set agents.defaults.systemAgent.agentId <id>. A sole configured
agent can still own unqualified Gateway session requests without a saved default
designation. Ambient work
without an owner fails with an actionable error, except queued-delivery recovery,
which records the failing delivery and keeps draining the rest of the queue.
Changing the runtime default does not relocate existing workspaces or legacy data.
Upgrade-only ownership lives at agents.defaults.authInheritance.agentId for
inherited credentials and agents.defaults.sessionStore.agentId for retired
main session rows or unscoped rows in a fixed session.store.
agents.defaults.compaction
Compaction replaces older history with one checkpoint that has fixed sections, a stated budget, and the user's own messages quoted verbatim. It runs on the session's own model. See Compaction.
enabled: whenfalse, disables compaction before model requests. Overflow-recovery compaction and manual/compactremain available. Default:true.keepRecentTokens: how much of the most recent conversation stays verbatim after the checkpoint. Default:20000.timeoutSeconds: how long a built-in compaction model request may go without progress. Each request start and each streamed output token refreshes the window, so a slow request that keeps streaming finishes while a silent one is aborted after one window. The complete compaction stops after 10 windows even if it keeps streaming. Plugin-owned compaction keeps one window unless the engine explicitly declares"onProgress"ininfo.acceptedHostParamsand reports progress through the supplied callback. Default:180.postIndexSync: post-compaction session-memory reindex mode. Default:"async". Use"await"for strongest freshness,"async"for lower compaction latency, or"off"only when session-memory sync is handled elsewhere.maxActiveTranscriptBytes: optional positive bytes or a size string such as"20mb". Bounds history seeds for runtimes that start a fresh thread from OpenClaw history, such as Codex app-server. Unset or0disables it.notifyUser: whentrue, sends brief notices when compaction starts and completes, and when a pre-compaction memory flush is exhausted so the reply continues in a degraded state. Default:false. A degraded-checkpoint warning is always shown, regardless of this setting.memoryFlush: silent agentic turn before compaction to store durable memories. It uses the active session model and its normal fallback chain.enableddefaults totrue;softThresholdTokens(default4000) runs the flush when context is that many tokens from the compaction threshold;forceFlushTranscriptBytes(default"2mb",0disables) forces it when the model-visible history reaches that size even if token counters are stale. File-arm providers require writable workspace access; tools-arm providers do not.
Custom summary construction belongs to a context engine. Use
before_prompt_build when post-compaction context must be injected into later
model prompts.
agents.defaults.contextPruning
Prunes old tool results from in-memory context before sending to the LLM. Does not modify session history on disk. Disabled by default; set mode: "cache-ttl" to enable.
cache-ttl mode behavior
mode: "cache-ttl"enables pruning passes.ttlsets how long a cache entry is considered fresh before a new pruning round can start. It is a duration string whose bare numbers are minutes; the built-in default is 5 minutes, and the bundled Anthropic plugin seeds1h.tools.allowandtools.denyscope which tool names are prunable.hardClear.enabled: falseskips the hard-clear step, andhardClear.placeholderreplaces the default[Old tool result content cleared]text.- Pruning soft-trims oversized tool results first, then hard-clears older tool results if needed.
Soft-trim keeps beginning + end and inserts ... in the middle.
Hard-clear replaces the entire tool result with the placeholder.
Notes:
- Image blocks are never trimmed/cleared.
- Ratios are character-based (approximate), not exact token counts.
- The most recent assistant messages are preserved.
See Session Pruning for behavior details.
agents.defaults.promptCacheKeepWarm
Keeps the prompt cache of an idle interactive session warm. Shortly before the provider's known cache lifetime ends, the Gateway sends one read-only prewarm request that reads the session's cached prefix and generates no output, so the next turn reads the cache instead of rewriting the whole prompt. On by default.
See Prompt caching for which routes and sessions it covers and what each prewarm costs.
Block streaming
- Non-Telegram channels require explicit
*.streaming.block.enabled: trueto enable block replies. QQ Bot is the exception: it has nostreaming.blockkeys and streams block replies unlesschannels.qqbot.streaming.modeis"off". - Channel overrides:
channels.<channel>.streaming.block.coalesce(and per-account variants). Discord, Google Chat, Mattermost, MS Teams, Signal, and Slack defaultminChars: 1500/idleMs: 1000. blockStreamingChunk.breakPreference: preferred chunk boundary ("paragraph" | "newline" | "sentence").humanDelay: randomized pause between block replies. Default:off.natural= 800-2500ms.customusesminMs/maxMs(falls back to the natural range for any unset bound). Per-agent override:agents.entries.*.humanDelay.
See Streaming for behavior + chunking details.
Typing indicators
- Defaults:
instantfor direct chats/mentions,messagefor unmentioned group chats. typingIntervalSecondsdefault:6.- Per-agent override:
agents.entries.*.typingMode.
See Typing Indicators.