nextlevelbuilder / nextlevelbuilder/goclaw
Agent bindings cannot override channel instance agent_id
Open
@haidang1810 is already working on this.
Since Mar 23, 2026.
agent:github-maintain
area:channels
maintain:triaged
P3-low
- Dominant language
- Go
- Stars
- 3.6k
- Forks
- 1.1k
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 24
Description
Problem
The maintainer of PR #227 recommended using agent bindings for per-channel agent routing. However, bindings cannot work when a channel instance has an agent_id set.
Flow
- Channel instance
mother-slackhasagent_id = <mother UUID> - Slack adapter creates message with
msg.AgentID = "mother"(fromBaseChannel.AgentID()) - In
processNormalMessage(),agentID := msg.AgentID→"mother" resolveAgentRoute()is only called whenagentID == ""— it never fires- Config bindings are completely bypassed
Code
// cmd/gateway_consumer_normal.go
agentID := msg.AgentID
if agentID == "" {
agentID = resolveAgentRoute(cfg, msg.Channel, msg.ChatID, msg.PeerKind)
}
What I need
One Slack bot (Socket Mode) serving multiple agents. DMs → Mother. #cell-invoice → invoice agent. #cell-ops → ops agent.
Options I see
- Make channel_instance.agent_id nullable — when NULL,
msg.AgentIDis empty, bindings kick in. Requires instance_loader to skipSetAgentIDwhen agent_id is NULL. - Always check bindings first — before falling back to
msg.AgentID. Peer-level bindings (channel + chat_id) are more specific than a channel-wide default. - Both — nullable agent_id + bindings-first.
Happy to submit a PR for whichever approach you prefer.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.