Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions config/openclaw/openclaw.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,29 @@
{
"id": "main",
"default": true
},
{
"id": "sonnet",
"model": {
"primary": "cliproxy/claude-sonnet-4-5-20250929"
}
},
{
"id": "glm",
"model": {
"primary": "cliproxy/glm-4.7"
}
}
]
},
"broadcast": {
"strategy": "parallel",
"120363425572081403@g.us": [
"main",
"sonnet",
"glm"
]
},
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
"messages": {
"queue": {
"mode": "interrupt"
Expand Down
20 changes: 20 additions & 0 deletions config/openclaw/openclaw.tpl.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,29 @@
{
"id": "main",
"default": true
},
{
"id": "sonnet",
"model": {
"primary": "cliproxy/__CLAUDE_SONNET__"
}
},
{
"id": "glm",
"model": {
"primary": "cliproxy/__GLM__"
}
}
Comment on lines +199 to 342

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

New agents may lose default fallbacks; glm fallback is self-referential either way.

The sonnet and glm agents override model.primary without specifying fallbacks. Depending on how OpenClaw merges partial model overrides with agents.defaults.model:

  • If it's a deep merge, sonnet inherits fallbacks: ["cliproxy/__GLM__"] (fine), but glm ends up with its own model as its fallback (useless).
  • If it's a shallow replace of the model key, both agents lose fallbacks entirely.

Consider explicitly setting fallbacks for each agent — e.g., glm could fall back to Sonnet or Opus, and sonnet could keep the GLM fallback.

🤖 Prompt for AI Agents
In `@config/openclaw/openclaw.tpl.json` around lines 199 - 211, The agent entries
"sonnet" and "glm" set model.primary but omit model.fallbacks, which can lead to
either losing defaults or creating a self-referential fallback for "glm"; update
the "sonnet" and "glm" agent objects to explicitly set model.fallbacks (e.g.,
for "sonnet" keep ["cliproxy/__GLM__"] and for "glm" point to a different
fallback such as Sonnet or Opus) instead of relying on agents.defaults.model so
that fallback resolution is explicit and non-self-referential.

]
},
"broadcast": {
"strategy": "parallel",
"120363425572081403@g.us": [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The WhatsApp group ID is hardcoded in this template. For better reusability and security, please replace it with a placeholder like __WHATSAPP_BROADCAST_GROUP__. You'll then need to update hydrate.sh to substitute this value at runtime, and regenerate openclaw.template.json.

Suggested change
"120363425572081403@g.us": [
"__WHATSAPP_BROADCAST_GROUP__": [

"main",
"sonnet",
"glm"
]
},
Comment on lines +345 to +358

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

OpenClaw broadcast parallel strategy interrupt queue behavior

💡 Result:

In OpenClaw, these three pieces interact like this:

  • Broadcast + strategy: "parallel": when a message is eligible for broadcast, OpenClaw fans it out to every listed agent, and those agents process simultaneously (unless you set strategy: "sequential"). Each agent runs with an isolated session key and separate context, so they don’t share history or state. Responses can arrive in any order. [1]

  • Queueing model (important for “parallel”): OpenClaw still serializes runs per session key (“only one active run per session”), while allowing parallelism across different session keys, subject to global concurrency limits. Because broadcast agents have different session keys, they can run concurrently. [2]

  • Queue mode interrupt behavior: interrupt is a legacy queue mode that aborts the active run for that session, then processes the newest inbound message for that same session. In a broadcast-parallel setup, this applies per agent session—interrupting one agent’s session won’t automatically stop the other broadcast agents’ runs, because they’re isolated sessions. [1][2]

Implication: with broadcast-parallel + interrupt, rapid-fire inbound messages can cause each broadcast agent to repeatedly abort and restart its own run, potentially producing fewer/shorter outputs and higher churn, while other agents may still complete depending on timing and per-session queue state. [1][2]

Sources: Broadcast Groups docs [1], Queue/Command Queue docs [2].


🏁 Script executed:

# Check if there's OpenClaw documentation or README in the repo
find . -type f -name "*.md" | head -20

Repository: shunkakinoki/dotfiles

Length of output: 269


🏁 Script executed:

# Look for any OpenClaw-related code or documentation
git ls-files | grep -i openclaw | head -30

Repository: shunkakinoki/dotfiles

Length of output: 264


🏁 Script executed:

# Check the actual configuration file for context around lines 214-221
head -250 config/openclaw/openclaw.tpl.json | tail -40

Repository: shunkakinoki/dotfiles

Length of output: 816


🏁 Script executed:

# Search for documentation or code about broadcast strategy and queue modes
rg -i "broadcast|queue.*mode" --type json -A 2 -B 2 | head -100

Repository: shunkakinoki/dotfiles

Length of output: 610


Parallel broadcast with interrupt queue mode creates independent session churn per agent.

Every message in group 120363425572081403@g.us will invoke all three models concurrently:

  • 3× the token consumption and API costs per inbound message.
  • Each agent runs in an isolated session with separate context—partial failure in one agent doesn't block others.
  • interrupt queue mode applies per-agent session, not globally. A new inbound message interrupts each agent's run independently. This means rapid messages can cause each broadcast agent to repeatedly abort and restart its own session, potentially producing incomplete outputs and independent timing mismatches across the three agents, not synchronized interrupts.
🤖 Prompt for AI Agents
In `@config/openclaw/openclaw.tpl.json` around lines 214 - 221, The parallel
broadcast entry for group "120363425572081403@g.us" with agents
["main","sonnet","glm"] causes independent per-agent session churn under
interrupt queue mode; update the "broadcast" configuration to avoid concurrent
independent runs—either switch "strategy" from "parallel" to "sequential" so
agents run one after another, replace the three agents with a single aggregator
agent that fan-outs internally, or change the queue mode to a global/centralized
interrupt behavior if your runtime supports a global interrupt flag; modify the
entry containing the group id and the agents list ("main", "sonnet", "glm")
accordingly so interrupts are synchronized and token/API duplication is avoided.

"messages": {
"queue": {
"mode": "interrupt"
Expand Down
Loading