惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Engineering at Meta
Engineering at Meta
G
Google Developers Blog
WordPress大学
WordPress大学
M
MIT News - Artificial intelligence
D
DataBreaches.Net
云风的 BLOG
云风的 BLOG
爱范儿
爱范儿
Microsoft Security Blog
Microsoft Security Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Blog — PlanetScale
Blog — PlanetScale
T
Tailwind CSS Blog
S
SegmentFault 最新的问题
阮一峰的网络日志
阮一峰的网络日志
博客园 - 三生石上(FineUI控件)
酷 壳 – CoolShell
酷 壳 – CoolShell
Recent Announcements
Recent Announcements
T
The Blog of Author Tim Ferriss
I
InfoQ
MyScale Blog
MyScale Blog
V
V2EX
B
Blog
罗磊的独立博客
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix: handle iOS global agent transcripts · openclaw/openc...
steipete · 2026-06-01 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -95,6 +95,7 @@ import Testing

9595

@Test func mapsSessionMessageEventToSessionMessage() {

9696

let payload = AnyCodable([

9797

"sessionKey": AnyCodable("agent:main:main"),

98+

"agentId": AnyCodable("main"),

9899

"messageId": AnyCodable("msg-1"),

99100

"messageSeq": AnyCodable(7),

100101

"message": AnyCodable([

@@ -119,6 +120,7 @@ import Testing

119120

switch mapped {

120121

case let .sessionMessage(message):

121122

#expect(message.sessionKey == "agent:main:main")

123+

#expect(message.agentId == "main")

122124

#expect(message.messageId == "msg-1")

123125

#expect(message.messageSeq == 7)

124126

#expect(message.message?.role == "assistant")

Original file line numberDiff line numberDiff line change

@@ -326,17 +326,20 @@ public struct OpenClawChatEventPayload: Codable, Sendable {

326326
327327

public struct OpenClawSessionMessageEventPayload: Codable, Sendable {

328328

public let sessionKey: String?

329+

public let agentId: String?

329330

public let message: OpenClawChatMessage?

330331

public let messageId: String?

331332

public let messageSeq: Int?

332333
333334

public init(

334335

sessionKey: String?,

336+

agentId: String? = nil,

335337

message: OpenClawChatMessage?,

336338

messageId: String?,

337339

messageSeq: Int?)

338340

{

339341

self.sessionKey = sessionKey

342+

self.agentId = agentId

340343

self.message = message

341344

self.messageId = messageId

342345

self.messageSeq = messageSeq

Original file line numberDiff line numberDiff line change

@@ -8,7 +8,21 @@ extension OpenClawChatViewModel {

88

mainSessionKey: self.resolvedMainSessionKey)

99

}

1010
11-

static func matchesCurrentSessionKey(incoming: String, current: String, mainSessionKey: String) -> Bool {

11+

func matchesCurrentSessionKey(incoming: String, agentId: String?, current: String) -> Bool {

12+

Self.matchesCurrentSessionKey(

13+

incoming: incoming,

14+

agentId: agentId,

15+

current: current,

16+

mainSessionKey: self.resolvedMainSessionKey)

17+

}

18+
19+

static func matchesCurrentSessionKey(

20+

incoming: String,

21+

agentId: String? = nil,

22+

current: String,

23+

mainSessionKey: String)

24+

-> Bool

25+

{

1226

let incomingNormalized = incoming.trimmingCharacters(in: .whitespacesAndNewlines).lowercased()

1327

let currentNormalized = current.trimmingCharacters(in: .whitespacesAndNewlines).lowercased()

1428

if incomingNormalized == currentNormalized {

@@ -23,6 +37,13 @@ extension OpenClawChatViewModel {

2337

{

2438

return true

2539

}

40+

if Self.matchesSelectedAgentGlobal(

41+

incoming: incomingNormalized,

42+

agentId: agentId,

43+

current: currentNormalized)

44+

{

45+

return true

46+

}

2647

return false

2748

}

2849

@@ -36,4 +57,14 @@ extension OpenClawChatViewModel {

3657

return (current == "main" && incoming == "agent:main:main") ||

3758

(incoming == "main" && current == "agent:main:main")

3859

}

60+
61+

private static func matchesSelectedAgentGlobal(incoming: String, agentId: String?, current: String) -> Bool {

62+

guard incoming == "global",

63+

let selectedAgentId = agentId?.trimmingCharacters(in: .whitespacesAndNewlines).lowercased(),

64+

!selectedAgentId.isEmpty

65+

else {

66+

return false

67+

}

68+

return current == "agent:\(selectedAgentId):global"

69+

}

3970

}

Original file line numberDiff line numberDiff line change

@@ -1302,7 +1302,7 @@ public final class OpenClawChatViewModel {

13021302
13031303

private func handleSessionMessageEvent(_ payload: OpenClawSessionMessageEventPayload) {

13041304

if let sessionKey = payload.sessionKey,

1305-

!self.matchesCurrentSessionKey(incoming: sessionKey, current: self.sessionKey)

1305+

!self.matchesCurrentSessionKey(incoming: sessionKey, agentId: payload.agentId, current: self.sessionKey)

13061306

{

13071307

return

13081308

}

Original file line numberDiff line numberDiff line change

@@ -1092,6 +1092,75 @@ extension TestChatTransportState {

10921092

}

10931093

}

10941094
1095+

@Test func appendsGlobalSessionUserMessageForSelectedAgent() async throws {

1096+

let now = Date().timeIntervalSince1970 * 1000

1097+

let (transport, vm) = await makeViewModel(

1098+

sessionKey: "agent:work:global",

1099+

historyResponses: [historyPayload(sessionKey: "agent:work:global")])

1100+
1101+

await MainActor.run { vm.load() }

1102+

try await waitUntil("bootstrap history loaded") { await MainActor.run { vm.messages.isEmpty } }

1103+
1104+

transport.emit(

1105+

.sessionMessage(

1106+

OpenClawSessionMessageEventPayload(

1107+

sessionKey: "global",

1108+

agentId: "work",

1109+

message: OpenClawChatMessage(

1110+

role: "user",

1111+

content: [

1112+

OpenClawChatMessageContent(

1113+

type: "text",

1114+

text: "global transcript",

1115+

mimeType: nil,

1116+

fileName: nil,

1117+

content: nil),

1118+

],

1119+

timestamp: now),

1120+

messageId: "msg-global-work",

1121+

messageSeq: 1)))

1122+
1123+

try await waitUntil("selected agent global transcript visible") {

1124+

await MainActor.run {

1125+

vm.messages.count == 1 &&

1126+

vm.messages.first?.role == "user" &&

1127+

vm.messages.first?.content.first?.text == "global transcript"

1128+

}

1129+

}

1130+

}

1131+
1132+

@Test func ignoresGlobalSessionUserMessageForDifferentAgent() async throws {

1133+

let now = Date().timeIntervalSince1970 * 1000

1134+

let (transport, vm) = await makeViewModel(

1135+

sessionKey: "agent:work:global",

1136+

historyResponses: [historyPayload(sessionKey: "agent:work:global")])

1137+
1138+

await MainActor.run { vm.load() }

1139+

try await waitUntil("bootstrap history loaded") { await MainActor.run { vm.messages.isEmpty } }

1140+
1141+

transport.emit(

1142+

.sessionMessage(

1143+

OpenClawSessionMessageEventPayload(

1144+

sessionKey: "global",

1145+

agentId: "main",

1146+

message: OpenClawChatMessage(

1147+

role: "user",

1148+

content: [

1149+

OpenClawChatMessageContent(

1150+

type: "text",

1151+

text: "wrong global transcript",

1152+

mimeType: nil,

1153+

fileName: nil,

1154+

content: nil),

1155+

],

1156+

timestamp: now),

1157+

messageId: "msg-global-main",

1158+

messageSeq: 1)))

1159+
1160+

try await Task.sleep(nanoseconds: 100_000_000)

1161+

#expect(await MainActor.run { vm.messages.isEmpty })

1162+

}

1163+
10951164

@Test func ignoresAgentMainSessionMessageForDifferentCurrentMainAlias() async throws {

10961165

let now = Date().timeIntervalSince1970 * 1000

10971166

let (transport, vm) = await makeViewModel(historyResponses: [historyPayload()])