Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
159 changes: 158 additions & 1 deletion config/openclaw/openclaw.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,166 @@
{
"id": "main",
"default": true
},
{
"id": "code-reviewer-opus",
"name": "Code Reviewer (Opus)",
"workspace": "__HOME__/agents/code-review",
"model": {
"primary": "cliproxy/claude-opus-4-6",
"fallbacks": [
"cliproxy/glm-4.7"
]
},
"tools": {
"allow": [
"read",
"exec"
]
}
},
{
"id": "code-reviewer-sonnet",
"name": "Code Reviewer (Sonnet)",
"workspace": "__HOME__/agents/code-review",
"model": {
"primary": "cliproxy/claude-sonnet-4-5-20250929",
"fallbacks": [
"cliproxy/glm-4.7"
]
},
"tools": {
"allow": [
"read",
"exec"
]
}
},
{
"id": "code-reviewer-glm",
"name": "Code Reviewer (GLM)",
"workspace": "__HOME__/agents/code-review",
"model": {
"primary": "cliproxy/glm-4.7"
},
"tools": {
"allow": [
"read",
"exec"
]
}
},
Comment on lines +234 to +247

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

GLM-as-primary agents have no fallback — if GLM is down, these agents fail outright.

code-reviewer-glm, code-formatter, and test-coverage all set cliproxy/glm-4.7 as primary without specifying fallbacks. Depending on how OpenClaw merges partial model overrides with agents.defaults.model:

  • Deep merge: inherits fallbacks: ["cliproxy/glm-4.7"] from defaults — self-referential and useless.
  • Shallow replace: loses fallbacks entirely.

Add an explicit non-self-referential fallback (e.g., Sonnet or Haiku) for these agents.

Example fix for code-reviewer-glm
       {
         "id": "code-reviewer-glm",
         "name": "Code Reviewer (GLM)",
         "workspace": "__HOME__/agents/code-review",
         "model": {
-          "primary": "cliproxy/glm-4.7"
+          "primary": "cliproxy/glm-4.7",
+          "fallbacks": ["cliproxy/claude-sonnet-4-5-20250929"]
         },
         "tools": { "allow": ["read", "exec"] }
       },

Apply similarly to code-formatter and test-coverage.

Also applies to: 249-257, 268-276

🤖 Prompt for AI Agents
In `@config/openclaw/openclaw.template.json` around lines 220 - 228, The agent
entries that set model.primary to "cliproxy/glm-4.7" (e.g., the agent with id
"code-reviewer-glm" and the agents "code-formatter" and "test-coverage") must
include an explicit non-self-referential fallback to avoid single-point failure;
update each agent's model block to add a fallbacks array containing a different
model (e.g., "sonnet/*" or "haiku/*") rather than repeating the primary,
ensuring you add the fallbacks key alongside primary in the agent objects so
that a healthy fallback is available if glm is unreachable.

{
"id": "code-reviewer-gpt-codex",
"name": "Code Reviewer (GPT Codex)",
"workspace": "__HOME__/agents/code-review",
"model": {
"primary": "cliproxy/gpt-5.3-codex",
"fallbacks": [
"cliproxy/glm-4.7"
]
},
"tools": {
"allow": [
"read",
"exec"
]
}
},
{
"id": "code-reviewer-gemini",
"name": "Code Reviewer (Gemini Pro)",
"workspace": "__HOME__/agents/code-review",
"model": {
"primary": "cliproxy/gemini-3-pro-preview",
"fallbacks": [
"cliproxy/glm-4.7"
]
},
"tools": {
"allow": [
"read",
"exec"
]
}
},
Comment on lines +200 to +281

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 | 🟠 Major

Five code-reviewer agents share the same workspace while running in parallel — potential file conflicts.

All five code-reviewer-* agents use "workspace": "__HOME__/agents/code-review" and have exec tool access. Under the parallel broadcast strategy, they'll run concurrently in the same directory. If any agent writes intermediate files, checkouts, or scratch data to the workspace, the others may read stale or corrupted state.

Consider giving each agent a distinct workspace (e.g., __HOME__/agents/code-review/opus, .../sonnet, etc.) to ensure isolation.

Example diff for unique workspaces
       {
         "id": "code-reviewer-opus",
         "name": "Code Reviewer (Opus)",
-        "workspace": "__HOME__/agents/code-review",
+        "workspace": "__HOME__/agents/code-review/opus",
         ...
       },
       {
         "id": "code-reviewer-sonnet",
         "name": "Code Reviewer (Sonnet)",
-        "workspace": "__HOME__/agents/code-review",
+        "workspace": "__HOME__/agents/code-review/sonnet",
         ...
       },

Apply the same pattern for glm, gpt-codex, and gemini.

🤖 Prompt for AI Agents
In `@config/openclaw/openclaw.template.json` around lines 200 - 248, Multiple
code-reviewer agents (ids: code-reviewer-opus, code-reviewer-sonnet,
code-reviewer-glm, code-reviewer-gpt-codex, code-reviewer-gemini) currently
share the same workspace "__HOME__/agents/code-review" causing concurrent file
conflicts; update each agent's "workspace" value to its own unique directory
(for example "__HOME__/agents/code-review/opus", ".../sonnet", ".../glm",
".../gpt-codex", ".../gemini") so that each agent runs in an isolated workspace
while keeping their other settings (model, tools) unchanged.

{
"id": "code-formatter",
"name": "Code Formatter",
"workspace": "__HOME__/agents/formatter",
"model": {
"primary": "cliproxy/glm-4.7"
},
"tools": {
"allow": [
"read",
"write"
]
}
},
Comment on lines +282 to +295

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 | 🟠 Major

code-formatter has write tool permission while running in parallel with 8 other agents — risk of concurrent file mutation.

code-formatter is the only broadcast agent with "write" tool access (line 292). Under the parallel strategy, it can modify files while the other agents (code-reviewers, security-scanner, test-coverage, docs-checker) are simultaneously reading or executing against the same codebase. This can cause the other agents to read partially-written or inconsistent file state.

Consider either:

  • Running code-formatter sequentially (after reviewers finish), or
  • Giving it a dedicated workspace copy so writes don't affect the others.

Also applies to: 345-358

🤖 Prompt for AI Agents
In `@config/openclaw/openclaw.template.json` around lines 282 - 295, The
code-formatter agent currently has "write" tool permission while the run
strategy is "parallel", which risks concurrent file mutation; locate the
"code-formatter" block (and the duplicate block later) and either remove the
"write" permission from its "tools.allow" list so it becomes read-only, or
change its execution to run sequentially (move it out of the "parallel" group or
set the strategy for that agent to run after reviewers), or give it an isolated
workspace by changing "workspace" to a dedicated copy (e.g., a formatter-only
workspace) so its writes do not affect other agents (code-reviewers,
security-scanner, test-coverage, docs-checker).

{
"id": "security-scanner",
"name": "Security Scanner",
"workspace": "__HOME__/agents/security",
"model": {
"primary": "cliproxy/claude-opus-4-6",
"fallbacks": [
"cliproxy/claude-sonnet-4-5-20250929"
]
},
"tools": {
"allow": [
"read",
"exec"
]
}
},
{
"id": "test-coverage",
"name": "Test Coverage",
"workspace": "__HOME__/agents/testing",
"model": {
"primary": "cliproxy/glm-4.7"
},
"tools": {
"allow": [
"read",
"exec"
]
}
},
{
"id": "docs-checker",
"name": "Docs Checker",
"workspace": "__HOME__/agents/docs",
"model": {
"primary": "cliproxy/claude-sonnet-4-5-20250929",
"fallbacks": [
"cliproxy/glm-4.7"
]
},
"tools": {
"allow": [
"read"
]
}
}
]
},
"broadcast": {
"strategy": "parallel",
"120363425148909388@g.us": [
"code-reviewer-opus",
"code-reviewer-sonnet",
"code-reviewer-glm",
"code-reviewer-gpt-codex",
"code-reviewer-gemini",
"code-formatter",
"security-scanner",
"test-coverage",
"docs-checker"
]
},
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
"messages": {
"queue": {
"mode": "interrupt"
Expand Down Expand Up @@ -249,7 +406,7 @@
},
"sendReadReceipts": true,
"ackReaction": {
"emoji": "\ud83d\udc40",
"emoji": "👀",
"direct": true,
"group": "mentions"
}
Expand Down
159 changes: 158 additions & 1 deletion config/openclaw/openclaw.tpl.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,166 @@
{
"id": "main",
"default": true
},
{
"id": "code-reviewer-opus",
"name": "Code Reviewer (Opus)",
"workspace": "__HOME__/agents/code-review",
"model": {
"primary": "cliproxy/__CLAUDE_OPUS__",
"fallbacks": [
"cliproxy/__GLM__"
]
},
"tools": {
"allow": [
"read",
"exec"
]
}
},
{
"id": "code-reviewer-sonnet",
"name": "Code Reviewer (Sonnet)",
"workspace": "__HOME__/agents/code-review",
"model": {
"primary": "cliproxy/__CLAUDE_SONNET__",
"fallbacks": [
"cliproxy/__GLM__"
]
},
"tools": {
"allow": [
"read",
"exec"
]
}
},
{
"id": "code-reviewer-glm",
"name": "Code Reviewer (GLM)",
"workspace": "__HOME__/agents/code-review",
"model": {
"primary": "cliproxy/__GLM__"
},
"tools": {
"allow": [
"read",
"exec"
]
}
},
{
"id": "code-reviewer-gpt-codex",
"name": "Code Reviewer (GPT Codex)",
"workspace": "__HOME__/agents/code-review",
"model": {
"primary": "cliproxy/__GPT_CODEX__",
"fallbacks": [
"cliproxy/__GLM__"
]
},
"tools": {
"allow": [
"read",
"exec"
]
}
},
{
"id": "code-reviewer-gemini",
"name": "Code Reviewer (Gemini Pro)",
"workspace": "__HOME__/agents/code-review",
"model": {
"primary": "cliproxy/__GEMINI_PRO__",
"fallbacks": [
"cliproxy/__GLM__"
]
},
"tools": {
"allow": [
"read",
"exec"
]
}
},
Comment on lines +200 to +281

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 | 🟠 Major

Same shared-workspace concern applies here — give each parallel code-reviewer a distinct workspace.

All five code-reviewer-* agents point to __HOME__/agents/code-review. Since this is the template source and the generated openclaw.template.json mirrors it, the fix should be applied here. See the corresponding comment on openclaw.template.json for details.

🤖 Prompt for AI Agents
In `@config/openclaw/openclaw.tpl.json` around lines 200 - 248, All five
code-reviewer agent entries (code-reviewer-opus, code-reviewer-sonnet,
code-reviewer-glm, code-reviewer-gpt-codex, code-reviewer-gemini) currently
share the same workspace "__HOME__/agents/code-review"; update each agent's
"workspace" value to a unique workspace (e.g.,
"__HOME__/agents/code-review-opus", "__HOME__/agents/code-review-sonnet", etc.)
so each parallel reviewer has its own distinct workspace in the template.

{
"id": "code-formatter",
"name": "Code Formatter",
"workspace": "__HOME__/agents/formatter",
"model": {
"primary": "cliproxy/__GLM__"
},
"tools": {
"allow": [
"read",
"write"
]
}
},
Comment on lines +282 to +295

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 | 🟠 Major

code-formatter with write permission runs in parallel with all other read/exec agents — file mutation race.

This agent can modify files while 8 other agents concurrently read or exec against the same codebase. Either sequence code-formatter to run after the read-only agents, or isolate its writes to a separate workspace copy.

Also applies to: 345-358

🤖 Prompt for AI Agents
In `@config/openclaw/openclaw.tpl.json` around lines 282 - 295, The
"code-formatter" agent entry (id "code-formatter", workspace
"__HOME__/agents/formatter") grants "write" while running in parallel with
read/exec agents, causing file-mutation races; fix by changing its configuration
to either (A) run sequentially after all read-only agents (sequence/ordering
flag or move to a post-processing stage), or (B) switch its "workspace" to an
isolated copy and remove/limit "write" access in the shared workspace so it only
writes to the isolated workspace; apply the same change to the other occurrence
noted (the block around the second instance).

{
"id": "security-scanner",
"name": "Security Scanner",
"workspace": "__HOME__/agents/security",
"model": {
"primary": "cliproxy/__CLAUDE_OPUS__",
"fallbacks": [
"cliproxy/__CLAUDE_SONNET__"
]
},
"tools": {
"allow": [
"read",
"exec"
]
}
},
{
"id": "test-coverage",
"name": "Test Coverage",
"workspace": "__HOME__/agents/testing",
"model": {
"primary": "cliproxy/__GLM__"
},
"tools": {
"allow": [
"read",
"exec"
]
}
},
{
"id": "docs-checker",
"name": "Docs Checker",
"workspace": "__HOME__/agents/docs",
"model": {
"primary": "cliproxy/__CLAUDE_SONNET__",
"fallbacks": [
"cliproxy/__GLM__"
]
},
"tools": {
"allow": [
"read"
]
}
}
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",
"120363425148909388@g.us": [
"code-reviewer-opus",
"code-reviewer-sonnet",
"code-reviewer-glm",
"code-reviewer-gpt-codex",
"code-reviewer-gemini",
"code-formatter",
"security-scanner",
"test-coverage",
"docs-checker"
]
},
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 Expand Up @@ -249,7 +406,7 @@
},
"sendReadReceipts": true,
"ackReaction": {
"emoji": "\ud83d\udc40",
"emoji": "👀",
"direct": true,
"group": "mentions"
}
Expand Down
Loading