openclaw - 💡(How to fix) Fix Performance: Telegram skill invocations (e.g. /weather) pay full workspace bootstrap cost on every turn — 30s+ on Haiku 4.5 [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#80289Fetched 2026-05-11 03:16:46
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
2
Author
Timeline (top)
mentioned ×3subscribed ×3commented ×1

Trivial Telegram slash-command skill invocations (e.g. /weather) pay the full workspace bootstrap injection cost on every turn even though they don't need most of it. With default config on a Pi 5 + Anthropic Haiku 4.5, end-to-end latency for /weather is ~30 seconds. The only way to bring it under 5 seconds is to set agents.defaults.contextInjection: "never" globally — which then strips USER.md / SOUL.md / IDENTITY.md from all sessions, including the multi-turn DM where they actually carry useful context.

There's no documented way to apply minimal-context only to skill-dispatched turns, the way subagents do (subagents inject only AGENTS.md + TOOLS.md per dist/.../resolveBootstrapContextForRun codepath).

Root Cause

Trivial Telegram slash-command skill invocations (e.g. /weather) pay the full workspace bootstrap injection cost on every turn even though they don't need most of it. With default config on a Pi 5 + Anthropic Haiku 4.5, end-to-end latency for /weather is ~30 seconds. The only way to bring it under 5 seconds is to set agents.defaults.contextInjection: "never" globally — which then strips USER.md / SOUL.md / IDENTITY.md from all sessions, including the multi-turn DM where they actually carry useful context.

There's no documented way to apply minimal-context only to skill-dispatched turns, the way subagents do (subagents inject only AGENTS.md + TOOLS.md per dist/.../resolveBootstrapContextForRun codepath).

Fix Action

Fix / Workaround

There's no documented way to apply minimal-context only to skill-dispatched turns, the way subagents do (subagents inject only AGENTS.md + TOOLS.md per dist/.../resolveBootstrapContextForRun codepath).

Workarounds tried

SettingEffect on /weatherSide effect
agents.defaults.model.primary: claude-haiku-4-5~30 s → ~30 s (no change)none
reasoningDefault: off~30 s → ~22 slosing reasoning across the agent
contextInjection: never + reasoningDefault: off~30 s → single‑digitstrips USER/SOUL/IDENTITY from all sessions, including normal DM where context matters
Editing the weather SKILL.md to embed format specworks at the skill leveldoes not reduce bootstrap cost
command-dispatch: tool plugin pathwould skip LLM entirelyrequires a custom plugin (child_process is sandbox-blocked, manifest needs configSchema; non-trivial); does not address the underlying injection cost for other skills

Code Example

{
  "channels": {
    "telegram": {
      "commands": {
        "weather": { "contextInjection": "never" }
      }
    }
  }
}
RAW_BUFFERClick to expand / collapse

Summary

Trivial Telegram slash-command skill invocations (e.g. /weather) pay the full workspace bootstrap injection cost on every turn even though they don't need most of it. With default config on a Pi 5 + Anthropic Haiku 4.5, end-to-end latency for /weather is ~30 seconds. The only way to bring it under 5 seconds is to set agents.defaults.contextInjection: "never" globally — which then strips USER.md / SOUL.md / IDENTITY.md from all sessions, including the multi-turn DM where they actually carry useful context.

There's no documented way to apply minimal-context only to skill-dispatched turns, the way subagents do (subagents inject only AGENTS.md + TOOLS.md per dist/.../resolveBootstrapContextForRun codepath).

Environment

  • OpenClaw 2026.4.15 (041266a)
  • Raspberry Pi 5, Debian 13 (trixie), aarch64
  • Anthropic provider, primary model claude-haiku-4-5
  • Telegram channel via long polling
  • Workspace files default-sized: AGENTS.md 7.7k, SOUL.md 1.7k, USER.md ~1.5k, IDENTITY.md 0.6k, TOOLS.md 0.85k, HEARTBEAT.md, plus skills snapshot ≈ 10k → total system prompt ≈ 27k chars per turn

Reproduce

  1. Default openclaw onboard --flow quickstart setup with Haiku 4.5 as primary, Telegram channel attached
  2. Send /weather from Telegram (built-in weather skill, single-step curl wttr.in tool call + reply formatting)
  3. Observe ~25–35 s round trip

Network is verified clean: wttr.in 0.25 s from the Pi, Anthropic API 0.7 s. The cost is OpenClaw’s bootstrap injection + Haiku’s prefill on a 27 k‑char prompt × 2 LLM round trips (decide → tool → format).

Workarounds tried

SettingEffect on /weatherSide effect
agents.defaults.model.primary: claude-haiku-4-5~30 s → ~30 s (no change)none
reasoningDefault: off~30 s → ~22 slosing reasoning across the agent
contextInjection: never + reasoningDefault: off~30 s → single‑digitstrips USER/SOUL/IDENTITY from all sessions, including normal DM where context matters
Editing the weather SKILL.md to embed format specworks at the skill leveldoes not reduce bootstrap cost
command-dispatch: tool plugin pathwould skip LLM entirelyrequires a custom plugin (child_process is sandbox-blocked, manifest needs configSchema; non-trivial); does not address the underlying injection cost for other skills

What's missing

A per‑skill or per‑command context mode, e.g.:

{
  "channels": {
    "telegram": {
      "commands": {
        "weather": { "contextInjection": "never" }
      }
    }
  }
}

…or a reuse of the existing subagent minimal injection (AGENTS.md + TOOLS.md only) for any turn driven by a skill invocation rather than free-form chat. Skills are by design self-contained — their SKILL.md is loaded on dispatch — so the bootstrap stack adds little value but pays full latency cost.

Related

  • #9157 — the framework fix that landed contextInjection: never|continuation-skip (closed). Validates the broader concern; this issue is asking for the fine-grained per-skill version.
  • #67419 — proposes making continuation-skip the default (open). Helps multi-turn but skill-only invocations still pay the first-turn full cost.

Suggested resolutions

  1. Skill-invocation minimal injection — when a turn enters via skill dispatch, inject only AGENTS.md + TOOLS.md (mirror subagent behavior). No new config required, predictable.
  2. Per-command override under channels.<provider>.commands.<name>.contextInjection — explicit, opt-in, conservative.
  3. Document the latency cost of default bootstrap injection more prominently in docs/concepts/system-prompt so users hitting "my Telegram bot is slow" can find the workaround.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING