Skip to content

fix(sessions): prevent displayName overwrite on outbound sends (#4683)#4697

Closed
saurabhchopda wants to merge 1 commit into
openclaw:mainfrom
saurabhchopda:fix/session-displayname-outbound-4683
Closed

fix(sessions): prevent displayName overwrite on outbound sends (#4683)#4697
saurabhchopda wants to merge 1 commit into
openclaw:mainfrom
saurabhchopda:fix/session-displayname-outbound-4683

Conversation

@saurabhchopda

@saurabhchopda saurabhchopda commented Jan 30, 2026

Copy link
Copy Markdown

fix(sessions): prevent displayName overwrite on outbound sends

Summary

  • Fix session displayName being incorrectly updated to the message recipient when using the message tool to send to a different contact
  • Add skipDisplayName option to session metadata functions to prevent this during outbound sends

Fixes #4683

Test plan

  • Added unit test for skipDisplayName behavior in metadata.test.ts

Greptile Overview

Greptile Summary

This PR adds a skipDisplayName flag to session metadata derivation so outbound sends don’t overwrite a session’s displayName with the last recipient. The new option is threaded through deriveGroupSessionPatch/deriveSessionMetaPatch, exposed via recordSessionMetaFromInbound, and used by ensureOutboundSessionEntry during outbound message routing. A unit test is added to assert displayName is omitted when the flag is set, and the changelog notes the fix.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk.
  • Changes are tightly scoped to gating displayName derivation behind an explicit flag and only applied in the outbound-session entry path; no schema changes and a targeted unit test covers the new behavior. I did not find any functional regressions in the modified call sites.
  • No files require special attention

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

@sebslight

Copy link
Copy Markdown
Contributor

Closing as duplicate of #4693. If this is incorrect, comment and we can reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Session displayName updates to last message recipient instead of session owner

2 participants