(detail: DetailState)
| 496 | } |
| 497 | |
| 498 | function compactCallMap(detail: DetailState) { |
| 499 | const keep = new Set(recent(detail.data.call.keys(), SUBAGENT_CALL_LIMIT)) |
| 500 | |
| 501 | for (const request of detail.data.permissions) { |
| 502 | const key = callKey(request.tool?.messageID, request.tool?.callID) |
| 503 | if (key) { |
| 504 | keep.add(key) |
| 505 | } |
| 506 | } |
| 507 | |
| 508 | for (const item of detail.frames) { |
| 509 | const key = callKey(item.commit.part?.messageID, item.commit.part?.callID) |
| 510 | if (key) { |
| 511 | keep.add(key) |
| 512 | } |
| 513 | } |
| 514 | |
| 515 | return copyMap(detail.data.call, keep) |
| 516 | } |
| 517 | |
| 518 | function compactEchoMap(data: SessionData, messageIDs: Set<string>) { |
| 519 | const keys = new Set([...messageIDs, ...recent(data.echo.keys(), SUBAGENT_ECHO_LIMIT)]) |
no test coverage detected