Skip to content

Commit 807aa55

Browse files
committed
fix: persist upgraded assistant identity
1 parent 3769ce5 commit 807aa55

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

src/OpenClaw.Tray.WinUI/Chat/OpenClawChatDataProvider.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4677,6 +4677,11 @@ openClawSeq is not null &&
46774677
existing.OpenClawSeq == openClawSeq &&
46784678
string.Equals(entry.Text, assistantText, StringComparison.Ordinal))
46794679
{
4680+
if (!string.IsNullOrEmpty(gatewayMessageId) &&
4681+
string.IsNullOrEmpty(existing.GatewayMessageId))
4682+
{
4683+
threadMeta[entry.Id] = existing with { GatewayMessageId = gatewayMessageId };
4684+
}
46804685
return true;
46814686
}
46824687
}

tests/OpenClaw.Tray.Tests/OpenClawChatDataProviderTests.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2713,6 +2713,17 @@ public async Task AssistantRetransmit_WithNewGatewayIdStillMatchesPriorSequenceO
27132713
OpenClawSeq = 10,
27142714
});
27152715

2716+
Assert.Empty(snapshots);
2717+
bridge.RaiseChat(new ChatMessageInfo
2718+
{
2719+
SessionKey = "main",
2720+
Role = "assistant",
2721+
Text = "cumulative prefix\nstable response",
2722+
State = "final",
2723+
OpenClawId = "message-10",
2724+
OpenClawSeq = 10,
2725+
});
2726+
27162727
Assert.Empty(snapshots);
27172728
var current = await provider.LoadAsync();
27182729
Assert.Single(current.Timelines["main"].Entries, e =>

0 commit comments

Comments
 (0)