(state: SessionState, logger: Logger, messages: WithParts[])
| 71 | } |
| 72 | |
| 73 | const pruneToolOutputs = (state: SessionState, logger: Logger, messages: WithParts[]): void => { |
| 74 | for (const msg of messages) { |
| 75 | if (isMessageCompacted(state, msg)) { |
| 76 | continue |
| 77 | } |
| 78 | |
| 79 | const parts = Array.isArray(msg.parts) ? msg.parts : [] |
| 80 | for (const part of parts) { |
| 81 | if (part.type !== "tool") { |
| 82 | continue |
| 83 | } |
| 84 | if (!state.prune.tools.has(part.callID)) { |
| 85 | continue |
| 86 | } |
| 87 | if (part.state.status !== "completed") { |
| 88 | continue |
| 89 | } |
| 90 | if (part.tool === "question" || part.tool === "edit" || part.tool === "write") { |
| 91 | continue |
| 92 | } |
| 93 | |
| 94 | part.state.output = PRUNED_TOOL_OUTPUT_REPLACEMENT |
| 95 | } |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | const pruneToolInputs = (state: SessionState, logger: Logger, messages: WithParts[]): void => { |
| 100 | for (const msg of messages) { |
no test coverage detected