Merge nucleic/mellow-glass-quail-hxmb into dev
This commit is contained in:
@@ -385,6 +385,9 @@ enum TranscriptProjection {
|
||||
var topLevel: [AgentEvent] = []
|
||||
var byParent: [String: [AgentEvent]] = [:]
|
||||
for event in events {
|
||||
// Older desktop builds persisted mesh coordination as synthetic userText. Keep those
|
||||
// backend-only rows out of existing mobile transcripts as well as new deliveries.
|
||||
if isLegacyMeshCoordinationInput(event) { continue }
|
||||
if let owner = subagentOwner(of: event, parentOf: parentOf) {
|
||||
byParent[owner, default: []].append(event)
|
||||
} else {
|
||||
@@ -394,6 +397,13 @@ enum TranscriptProjection {
|
||||
return (topLevel, byParent)
|
||||
}
|
||||
|
||||
private static func isLegacyMeshCoordinationInput(_ event: AgentEvent) -> Bool {
|
||||
guard case .userText(let chunk) = event.kind,
|
||||
let lineBreak = chunk.text.firstIndex(of: "\n") else { return false }
|
||||
let header = chunk.text[..<lineBreak]
|
||||
return header.hasPrefix("[Mesh message from ") && header.hasSuffix("]")
|
||||
}
|
||||
|
||||
/// Maps each tool-call id to its parent subagent's id, built from the call start/complete
|
||||
/// events. A tool *result* or *file change* names only a tool id, so it inherits its subagent
|
||||
/// scope from the call it belongs to via this map.
|
||||
|
||||
Reference in New Issue
Block a user