openclaw - 💡(How to fix) Fix [Feature Request] Agent loses identity context when switching between messaging channels [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#59585Fetched 2026-04-08 02:42:54
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants
RAW_BUFFERClick to expand / collapse

Problem

When an OpenClaw agent is configured with a custom identity (name, personality, role description), this identity context is not preserved across different messaging channels (e.g., webchat vs. Feishu vs. Discord).

Each channel creates a separate session, and the agent starts as if it has no prior identity knowledge — even though identity files are configured in the workspace.

Specific Example

  1. User defines a custom AI assistant persona via workspace files (SOUL.md, IDENTITY.md) in the webchat session
  2. The same agent is messaged via a different channel (e.g., Feishu)
  3. The Feishu session behaves as if it has no memory of the configured identity — it doesn't know its own name, role, or communication style

Expected Behavior

When an agent has a configured identity, that identity should be consistent regardless of which channel the user communicates through. Different channels should function as different "contact entry points" to the same agent — not as separate agent instances.

Technical Context

Currently, semantic memory search can find fragments of identity information, but:

  • It relies on passive keyword matching, not structured identity injection
  • SOUL.md and IDENTITY.md are not automatically loaded on session start for all channels
  • Each session bootstrap appears to start from a blank context for identity-related files

Suggested Solutions

  • Option A: On session initialization, automatically inject the full identity file contents (SOUL.md, IDENTITY.md) as system-level context, before any user message is processed
  • Option B: Provide a shared "global identity layer" that all channel sessions reference, so identity is loaded once and reused across sessions
  • Option C: Add a configuration flag like agent.identity.autoInject: true that ensures identity files are always the first thing loaded during bootstrap on any channel

extent analysis

TL;DR

Automatically injecting identity file contents or implementing a shared global identity layer can help preserve the agent's identity across different messaging channels.

Guidance

  • Investigate Option A: Modify the session initialization process to automatically inject the full identity file contents (SOUL.md, IDENTITY.md) as system-level context before processing any user messages.
  • Consider Option B: Design a shared "global identity layer" that all channel sessions reference, ensuring identity is loaded once and reused across sessions.
  • Evaluate Option C: Introduce a configuration flag like agent.identity.autoInject: true to ensure identity files are loaded during bootstrap on any channel.
  • Verify the chosen solution by testing the agent's behavior across multiple channels, ensuring the identity remains consistent.

Example

No explicit code example is provided due to the lack of specific technical details, but the solution might involve modifying the session initialization code to include a step that loads and injects identity files.

Notes

The best approach depends on the specific architecture and requirements of the OpenClaw agent system. It's essential to consider factors like performance, scalability, and potential side effects on other system components.

Recommendation

Apply Option A or Option B as they directly address the issue of preserving identity context across channels, with Option A being more straightforward to implement if the system already supports automatic content injection during session initialization.

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