-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
chat.history: surface idempotencyKey on hydrated user messages for client-side correlation #79844
Copy link
Copy link
Closed
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
What
chat.sendaccepts anidempotencyKeyparameter on user messages. The gateway persists this to the transcript (verified atdist/chat-3xUbD00m.js:303:...params.idempotencyKey ? { idempotencyKey: params.idempotencyKey } : {}) and reads it back viatranscriptHasIdempotencyKey()for de-duplication.But
chat.historydoes NOT includeidempotencyKeyin the hydrated message envelope it returns. The__openclawfield on user messages from chat.history contains only:{ "importedFrom": "...", "cliSessionId": "...", "externalId": "..." }Why it matters
Client-side chat surfaces (LCARS portal /comms; the openclaw control-ui chat tab) want to correlate locally-generated optimistic bubbles with their server-confirmed counterparts. With
idempotencyKeyechoed:Without it, clients fall back to text-equality matching (fragile) or role-FIFO heuristics (interleaving bugs).
Suggested fix
When chat.history hydrates a user message that was sent with
idempotencyKey, include it in the__openclawenvelope:{ "__openclaw": { "importedFrom": "...", "cliSessionId": "...", "externalId": "...", "idempotencyKey": "<the one supplied at send time>" } }The data is already persisted; this is a hydrate-side change to surface it through the existing wire shape.
Use case
LCARS portal /comms (https://github.com/datus1982/lcars Phase 1 work) currently has a known limitation in pending-pair correlation because of this gap. Documented in commit
b613782's message:Echoing
idempotencyKeywould make pending-bubble matching trivial and remove the FIFO-by-role fallback heuristic that has known interleaving edge cases.Environment
openclaw 2026.5.7