Skip to content

Use agent bindings for message account defaults#26983

Open
NewdlDewdl wants to merge 3 commits intoopenclaw:mainfrom
NewdlDewdl:fix/issue-26975-telegram-account-routing
Open

Use agent bindings for message account defaults#26983
NewdlDewdl wants to merge 3 commits intoopenclaw:mainfrom
NewdlDewdl:fix/issue-26975-telegram-account-routing

Conversation

@NewdlDewdl
Copy link
Contributor

@NewdlDewdl NewdlDewdl commented Feb 26, 2026

Summary

  • prefer channel/agent binding account IDs when the message action omits accountId
  • keep explicit accountId values as highest priority
  • add tests for binding precedence and explicit override behavior

Why

Sub-agents can inherit the requester account context, which caused outbound messages to route through the wrong bot in multi-account setups. This change makes account selection align with routing bindings for the active agent.

Testing

  • bash /Users/newdldewdl/.openclaw/workspace/skills/openclaw-autonomous-contributor/scripts/quality_gate.sh /Users/newdldewdl/.openclaw/workspace/memory/openclaw-contrib/worktrees/issue-26975

AI-assisted: yes

Fixes #26975

Greptile Summary

Adds agent-bound account ID resolution to the message action runner, ensuring sub-agents use their configured account bindings instead of inheriting the requester's account context.

  • Introduced resolveAgentBoundAccountId helper that looks up agent-specific account bindings from channel configuration
  • Modified account resolution to use three-tier precedence: explicit accountId param → agent binding → defaultAccountId
  • Added comprehensive test coverage for binding precedence and explicit override behavior

The implementation correctly prevents wrong-bot routing in multi-account setups by respecting agent-to-account bindings defined in the configuration.

Confidence Score: 5/5

  • Safe to merge with no issues found
  • The changes are well-structured, thoroughly tested, and maintain backward compatibility. The new account resolution logic correctly implements the stated precedence (explicit > agent-bound > default) and all edge cases are properly handled with optional chaining and type safety.
  • No files require special attention

Last reviewed commit: 5acd1d6

@openclaw-barnacle
Copy link

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle bot added stale Marked as stale due to inactivity and removed stale Marked as stale due to inactivity labels Mar 3, 2026
@NewdlDewdl NewdlDewdl force-pushed the fix/issue-26975-telegram-account-routing branch from 09c4f69 to f208b6f Compare March 7, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Bug + Fix: Multi-Agent Telegram Routing Fails Without Explicit accountId in message Tool

1 participant