openclaw - 💡(How to fix) Fix [Bug] ACP binding routes to wrong agent on second message (first message works fine) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#53680Fetched 2026-04-08 01:24:55
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
commented ×1cross-referenced ×1

Code Example

{
  "type": "acp",
  "agentId": "tradingdev",
  "match": {
    "channel": "telegram",
    "accountId": "default",
    "peer": {
      "kind": "group",
      "id": "-100XXXXXXXXXX:topic:66"
    }
  },
  "acp": {
    "cwd": "[REDACTED]/TradingAgents"
  }
}
RAW_BUFFERClick to expand / collapse

Bug Description

After upgrading to 2026.3.23-2, an ACP binding to a Telegram group topic only handles the first incoming message correctly via the ACP backend (Claude/Codex). On the second message, the binding falls back to the main agent instead of continuing via ACP.

Environment

  • OpenClaw version: 2026.3.23-2 (7ffe7e4)
  • Plugin: ACPX Runtime 2026.3.23 (loaded, no errors)
  • Channel: Telegram
  • Platform: macOS

Configuration

{
  "type": "acp",
  "agentId": "tradingdev",
  "match": {
    "channel": "telegram",
    "accountId": "default",
    "peer": {
      "kind": "group",
      "id": "-100XXXXXXXXXX:topic:66"
    }
  },
  "acp": {
    "cwd": "[REDACTED]/TradingAgents"
  }
}

There is also a route binding for topic:1 in the same group pointing to the main agent, and a route binding for DM.

Reproduction Steps

  1. Configure an ACP binding for a Telegram group topic (e.g. topic:66)
  2. Send the first message to that topic → routes correctly to ACP backend, Claude Code responds ✅
  3. Send the second message to the same topic → falls back to main agent (route binding for topic:1) ❌
  4. Delete the stuck ACP session from agents/<agentId>/sessions/sessions.json
  5. Restart gateway with openclaw gateway restart
  6. Send a new message → same pattern: first ✅ ACP, second ❌ fallback

Expected Behavior

All messages to the ACP-bound topic should consistently route through the ACP backend.

Attempted Fixes

  • Session cleanup: Deleted the stuck ACP session from sessions.json and restarted gateway — does not fix the issue
  • openclaw doctor --fix: Ran this command, which improved the first message routing (now correctly ACP on first attempt), but the second message still falls back to main
  • Extension re-check: ACPX plugin is loaded and shows no errors

Notes

  • ACP session identity resolves correctly (identity.state: \"resolved\") after the first message
  • The fallback goes to topic:1 route binding, which suggests the ACP session may be getting marked as expired/idle after the first message, causing subsequent messages to be re-routed
  • This started after upgrading to 2026.3.23-2 (was working fine on previous version)

extent analysis

Fix Plan

To resolve the issue of ACP binding falling back to the main agent after the first message, we need to adjust the session management in the ACP backend.

  1. Update ACP Session Timeout: Increase the session timeout to prevent the ACP session from expiring after the first message.
  2. Modify Route Binding: Update the route binding for the Telegram group topic to ensure it consistently routes messages to the ACP backend.

Code Changes

// Update the ACP configuration to increase the session timeout
{
  "type": "acp",
  "agentId": "tradingdev",
  "match": {
    "channel": "telegram",
    "accountId": "default",
    "peer": {
      "kind": "group",
      "id": "-100XXXXXXXXXX:topic:66"
    }
  },
  "acp": {
    "cwd": "[REDACTED]/TradingAgents",
    "sessionTimeout": 300 // Increase session timeout to 5 minutes
  }
}
# Example Python code to update the route binding
import json

# Load the route binding configuration
with open('route_bindings.json') as f:
    route_bindings = json.load(f)

# Update the route binding for the Telegram group topic
for binding in route_bindings:
    if binding['peer']['id'] == '-100XXXXXXXXXX:topic:66':
        binding['priority'] = 1  # Increase priority to ensure consistent routing

# Save the updated route binding configuration
with open('route_bindings.json', 'w') as f:
    json.dump(route_bindings, f)

Verification

To verify that the fix worked, send multiple messages to the Telegram group topic and check if they are consistently routed through the ACP backend.

Extra Tips

  • Monitor the ACP session logs to ensure that the session is not expiring after the first message.
  • Adjust the session timeout value as needed to prevent session expiration.
  • Review the route binding configuration to ensure that it is correctly prioritized to route messages to the ACP backend.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING