ios: hide raw tool entries in Agent transcript
TestFlight / Build and upload (push) Successful in 1m59s

This commit is contained in:
2026-10-14 15:40:37 -07:00
parent 56279fba7f
commit 4cbab487d0
5 changed files with 203 additions and 87 deletions
@@ -203,6 +203,23 @@ struct AgentRoomState: Equatable, Sendable {
}
}
// Filter only the transcript projection, before windowing. Keep the room's raw
// messages and cursors intact for upserts, replay, unread state and activity.
struct AgentTranscript {
let messages: [Message]
let startIndex: Int
var displayed: [Message] { Array(messages.dropFirst(startIndex)) }
init(messages: [Message], startID: String? = nil, limit: Int = 100) {
let visible = messages.filter {
$0.role != .tool && $0.metadata?.objectValue?["kind"]?.stringValue != "tool_call"
}
self.messages = visible
startIndex = startID.flatMap { id in visible.firstIndex(where: { $0.id == id }) }
?? max(0, visible.count - limit)
}
}
// The transcript latch is independent of the truthful sidebar/worker activity.
struct AgentPresentation {
private(set) var suppressed = false