Repository navigation
fix(agents): persist sender identity for direct-message turns - #124548
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
f6098b3 to
31ff72f
Compare
|
Codex review: needs maintainer review before merge. Reviewed August 27, 2026, 12:35 AM ET / 04:35 UTC. ClawSweeper reviewWhat this changesThe PR records sender identity for admitted external direct-message turns while retaining operator attribution for self-authored and gateway-local turns. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessThe patch restores sender metadata at the transcript boundary so existing Control UI logic can distinguish an external direct-message contact from the local operator. It remains necessary because it is not on current main; no blocking defect was identified. Priority: P2 Review scores
Verification
How this fits togetherChannel ingress supplies sender facts to an admitted message context, which the reply runtime persists in the user-turn transcript. Chat history normalizes that metadata and the Control UI uses it to label messages. flowchart LR
A[Channel message] --> B[Ingress sender facts]
B --> C[Admitted message context]
C --> D[Reply runtime]
D --> E[User-turn transcript]
E --> F[Chat history normalization]
F --> G[Control UI sender label]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +11, Tests +120. Total +131 across 9 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the focused persistence repair after required exact-head checks complete, retaining the ingress-owned self-message distinction. Do we have a high-confidence way to reproduce the issue? Yes—source proves the former group/channel-only persistence condition, and focused tests cover external and self-authored direct turns; the untrusted PR branch was not executed in this read-only review. Is this the best way to solve the issue? Yes—the defect originates at transcript persistence, while existing history normalization and Control UI rendering already consume durable sender metadata. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 71d4a8c3e305. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (13 earlier review cycles; latest 8 shown)
|
31ff72f to
da1ceb2
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
f7caf30 to
7c5d894
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
7c5d894 to
458cdbd
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
458cdbd to
2e5dddd
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
f9a04d3 to
1408eee
Compare
d365271 to
9834212
Compare
Persist sender identity for admitted external direct messages at the user-turn transcript boundary. Keep from-me and gateway-local direct turns attributed to the operator. Closes openclaw#123393 Co-authored-by: Ayaan Zaidi <[email protected]>
9834212 to
4f18e6a
Compare
|
Thanks @SunnyShu0925! |
…-retirement-v13 * origin/main: (243 commits) fix: preserve Gateway error reasons in text logs (#130645) refactor(video): deduplicate generation contracts (#130635) fix(agents): preserve direct-message sender identity (#124548) fix(agents): preserve silent reply after settled tools (#130675) fix(talk): preserve replacement speech when an old utterance is canceled (#130687) fix(browser): preserve literal names and formatter-owned snapshot refs (#130599) fix(auth): reset only the profile replaced by a successful login (#124014) fix: bind session creation to admitted Gateway (#130686) refactor(qa-lab): reuse model reference splitter (#130317) docs(gateway): clarify independent HTTP endpoint switches (#130690) fix(ui): Control UI smooth scrolling ignores the reduced-motion preference (#130428) refactor(lmstudio): remove unreachable catalog merge (#130689) fix(crabbox): restore cloud machine CPU and RAM (#130684) fix(secrets): compare proxy bearer tokens directly (#127054) fix(matrix): show recovery key availability in text status (#128051) fix(ios): restore approval settings navigation and remove duplicate shell state (#130651) refactor(agents): use fixed tool-loop defaults directly (#130681) refactor(qa-lab): share process tree metric reader (#130419) refactor(models): simplify prepared owner access (#130683) fix(parallels): main install and update smoke cannot complete (#130658) ...
Preserve admitted external direct-message sender metadata at the transcript boundary so Control UI can show the contact label while gateway-local and from-me turns stay attributed to the operator. Co-authored-by: SunnyShu0925 <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
|
@obviyus Thanks for merging! Glad to help. |
Closes #123393
What Problem This Solves
External direct-message turns reached the model with channel sender identity, but transcript persistence dropped that identity. Control UI then rendered the operator fallback label,
You.Current main
71d4a8c3e305c623aa3ffe92696eec18f116cfc6reproduces the loss insrc/auto-reply/reply/get-reply-run-execute.ts: an admitted direct turn stores nosenderId,senderName, orsenderUsername.Root cause
executePreparedReplyRunpersisted sender metadata only forgroupandchannelroutes. The loss happened beforebuildPersistedUserTurnMetadata, so the existing Gateway and Control UI consumers had no durable identity to display.Fix
directroute only when channel ingress admitted the turn and did not mark it as self-authored.is_from_meand WhatsAppfromMefacts through the shared inbound context.Evidence
4f18e6ad12ffdf639b11c2731ec7e3e8aa58dc3f: 375 tests pass across reply persistence, shared inbound context, iMessage, WhatsApp, Gateway display projection, and Control UI normalization.chat.historyreturned the user turn withsenderId,senderName, andsenderUsername; the production Control UI grouping and label resolver returned<redacted-peer-label>withrenderedAsPeer: true.openclaw/ci-gatepassed in run33040236918.{"externalDirectTurnFound":true,"gatewayHistoryRole":"user","storedSenderFields":["senderId","senderName","senderUsername"],"controlUiGroupRole":"user","renderedLabel":"<redacted-peer-label>","renderedAsPeer":true}Change size
Compatibility
Future admitted external direct-message rows retain sender identifiers and names. This intentional display and transcript change is the feature. Existing rows and operator-authored rows stay unchanged.
AI assistance