openclaw - 💡(How to fix) Fix [Feature]: Start and persist routed agent sessions from outbound WhatsApp sends [1 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#59788Fetched 2026-04-08 02:40:30
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
labeled ×1

Enable openclaw message send and similar outbound channel actions to create or attach to the correct routed agent session, so the first outbound message is saved in that session transcript and the assigned agent can continue the conversation with full context.

Root Cause

Enable openclaw message send and similar outbound channel actions to create or attach to the correct routed agent session, so the first outbound message is saved in that session transcript and the assigned agent can continue the conversation with full context.

Fix Action

Fix / Workaround

Current workaround

My current workflow is:

  1. Configure a WhatsApp account and bind it to a non-default agent (realtor)
  2. Send the first message manually with: openclaw message send --channel whatsapp --account realtor-whatsapp --target +... --message "..."
  3. Wait for the client to reply
  4. Let inbound routing send the reply to the realtor agent
RAW_BUFFERClick to expand / collapse

Summary

Enable openclaw message send and similar outbound channel actions to create or attach to the correct routed agent session, so the first outbound message is saved in that session transcript and the assigned agent can continue the conversation with full context.

Problem to solve

I am using OpenClaw with a dedicated WhatsApp account bound to a non-default agent (realtor) via routing rules (whatsapp accountId=realtor-whatsapp).

Current behavior:

  • Inbound WhatsApp replies are correctly routed to the realtor agent.
  • I can successfully send the first outbound message with:
    • openclaw message send --channel whatsapp --account realtor-whatsapp --target +... --message "..."
  • However, that first outbound message does not start or populate the realtor session transcript.
  • When the client replies, the realtor agent receives the inbound message, but does not have its own first outbound message in session context.

As a result, the agent does not fully understand what was already sent to the client. This is especially problematic for sales/outreach workflows where the first message contains important framing, offer details, qualifying context, or conversation tone.

Why current behavior is insufficient:

  • message send is useful for outbound initiation, but currently behaves like a channel-only delivery instead of a routed conversational start.
  • The session only becomes meaningful after the client replies, and even then the transcript is incomplete.
  • This breaks continuity for agents that are supposed to handle full WhatsApp conversations end-to-end.

Proposed solution

Desired behavior:

When sending an outbound message through a channel/account that is already routed to a specific agent, OpenClaw should support creating or resuming the correct agent session and persisting that outbound message into the transcript before the client replies.

Suggested behavior / API options:

Option A: automatic session-aware outbound send

When running: openclaw message send --channel whatsapp --account realtor-whatsapp --target +1800... --message "Hello"

OpenClaw should:

  1. Resolve the routed agent from the channel/account/peer binding.
  2. Resolve or create the session key using the same DM scoping logic as inbound messages.
  3. Write the outbound message into that agent's transcript.
  4. Deliver the message to WhatsApp.
  5. Ensure that when the client replies, the same agent/session already contains the first outbound turn.

Option B: explicit flag on message send

Add a flag such as:

  • --agent realtor
  • --start-session
  • --mirror-to-session
  • --persist-transcript

Example: openclaw message send --channel whatsapp --account realtor-whatsapp --target +1800... --agent realtor --start-session --message "Hello"

This would make the behavior explicit and remove ambiguity.

Option C: dedicated command for agent-led outbound conversation start

Add a new command such as: openclaw agent message --agent realtor --channel whatsapp --account realtor-whatsapp --target +1800... --message "Hello"

This command would:

  • generate or accept agent-authored outbound text,
  • create the correct session,
  • store the outbound turn,
  • and ensure future replies continue in the same transcript.

Additional UX expectations:

  • The stored transcript should clearly mark the first outbound turn as assistant/agent-originated.
  • Session creation should respect dmScope, especially per-channel-peer.
  • The routing should use the same agent/channel/account resolution already used for inbound messages.
  • This should work for non-default agents, not only the default CLI agent.

Alternatives considered

No response

Impact

Affected users/systems/channels

  • Users running outbound-first workflows
  • Sales, support, lead-gen, and broker/realtor agents
  • Multi-agent setups with channel/account routing
  • WhatsApp in particular, but likely also other DM-style channels

Severity

  • Blocks an important workflow for outbound agent use cases
  • Not just annoying: it prevents agents from having full conversational continuity

Frequency

  • Always, whenever the conversation is initiated manually via outbound message send
  • Especially frequent for users who proactively contact leads before the lead sends the first message

Consequence

  • The agent loses awareness of its own first message
  • Follow-up replies can become awkward, repetitive, or context-blind
  • Users must do extra manual work:
    • either force the client to message first,
    • or manually restate the first outbound message to the agent,
    • or avoid using agent-led outbound initiation entirely
  • This reduces trust in agent continuity and makes outbound sales workflows much harder to automate

Current workaround

My current workflow is:

  1. Configure a WhatsApp account and bind it to a non-default agent (realtor)
  2. Send the first message manually with: openclaw message send --channel whatsapp --account realtor-whatsapp --target +... --message "..."
  3. Wait for the client to reply
  4. Let inbound routing send the reply to the realtor agent

What is missing:

  • the first outbound message is not part of the agent session,
  • so the agent continues without seeing the actual opener it sent.

Environment / example scenario

  • OpenClaw version: 2026.4.1
  • Channel: WhatsApp
  • Routed agent: realtor
  • Routing rule: whatsapp accountId=realtor-whatsapp
  • Desired use case: outbound-first real estate conversations where the agent should remember its own opener and continue naturally from there.

Evidence/examples

No response

Additional information

No response

extent analysis

TL;DR

To fix the issue of the first outbound message not being saved in the agent session transcript, consider adding an explicit flag to the openclaw message send command to create or resume the correct agent session and persist the outbound message into the transcript.

Guidance

  • Implement one of the proposed solutions: automatic session-aware outbound send, explicit flag on message send, or dedicated command for agent-led outbound conversation start.
  • Verify that the chosen solution correctly resolves the routed agent from the channel/account/peer binding and writes the outbound message into the agent's transcript.
  • Test the solution with different routing rules and agent configurations to ensure it works as expected.
  • Consider adding a flag to clearly mark the first outbound turn as assistant/agent-originated in the stored transcript.

Example

openclaw message send --channel whatsapp --account realtor-whatsapp --target +1800... --agent realtor --start-session --message "Hello"

This example uses the explicit flag approach to create or resume the correct agent session and persist the outbound message into the transcript.

Notes

The proposed solutions require changes to the OpenClaw command-line interface or internal logic. The exact implementation details may vary depending on the chosen solution and the OpenClaw version being used.

Recommendation

Apply a workaround by using an explicit flag on the openclaw message send command, such as --agent and --start-session, to create or resume the correct agent session and persist the outbound message into the transcript. This approach provides a clear and explicit way to control the behavior and ensures that the first outbound message is saved in the agent session transcript.

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

openclaw - 💡(How to fix) Fix [Feature]: Start and persist routed agent sessions from outbound WhatsApp sends [1 participants]