Skip to content

[Bug] ACP binding routes to wrong agent on second message (first message works fine) #53680

@pengziran

Description

@pengziran

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions