-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Bug/RFC] Missing binding causes silent fallback to main agent — no warning, no validation #97655
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.
Type
Fields
Priority
None yet
Problem
When creating a new agent instance, if the user configures
agents.list[],workspace(with SOUL.md/IDENTITY.md), andchannels.feishu.accounts.<id>, but forgets to add abindings[]entry, the system silently falls back to themainagent.Symptom: The new bot responds with the main agent's identity instead of its own (e.g., a "stack" bot自称 "Mango").
Log appearance:
feishu[stack]: dispatching to agent (session=agent:main:main)— this looks like a normal dispatch to a user who doesn't know about bindings.Root Cause
The config is split into three independent pieces that must all be present:
agents.list[]— defines the agentchannels.<ch>.accounts.<id>— channel credentialsbindings[]— routes channel+account → agentWhen
bindings[]has no matching entry, the dispatch phase silently falls back tomainwith no error, no warning, no log distinction from a normal dispatch.Three Compounding Design Issues
1. Config Fragmentation
Three independent config blocks must be manually aligned. CLI/wizard guides users through
agents.list[]andchannels.*.accounts.*but often omitsbindings[]. There's no declaration-style linking (like K8s label selectors).2. Silent Fallback
When no binding matches, the system falls back to
mainwithout any warning. The error manifests as "wrong agent identity," which is very far from the actual root cause (routing config). This makes debugging extremely difficult — users naturally check SOUL.md/IDENTITY.md first.3. Inconsistent Hot-Reload
Other config sections (
agents.list[],channels.feishu.accounts.*,mcp.servers) support hot-reload.bindings[]does not — changes require a gateway restart. But the log saysconfig change detected; evaluating reload (bindings)without indicating that restart is needed.Proposed Improvements (by priority)
P0: Startup Sanity Check
Scan all
channels.<ch>.accounts.*entries and check if each has a correspondingbindings[]entry. Output WARNING for any account without a binding:This alone eliminates this class of bugs.
P1: Dispatch-time Warning
When dispatch falls back to main, upgrade log to WARN with explicit reason:
Make fallback logs distinguishable from normal dispatch.
P2: Agent Creation Wizard Completion
When
openclaw agent createor console "new agent" flow detects a channel account was configured, auto-generate the corresponding binding entry — or at minimum prompt: "No binding configured for this agent. Would you like to add one?"P3: Hot-Reload Consistency
Either make
bindings[]support hot-reload, or when a bindings change is detected but cannot be hot-applied, output explicit guidance:P4 (Optional): Convention-Based Binding
When
agents.list[].idmatches achannels.<ch>.accounts.<id>name and no explicit binding exists, automatically route by name convention. This reduces the need for manualbindings[]maintenance.P5: Config Validation CLI
openclaw config checkoropenclaw agent validate <id>— one-shot diagnostic that checks all four elements (agent exists, workspace has SOUL.md, channel account valid, binding present) and outputs a report.Environment