(state: SessionState, logger: Logger, messages: WithParts[])
| 97 | } |
| 98 | |
| 99 | const pruneToolInputs = (state: SessionState, logger: Logger, messages: WithParts[]): void => { |
| 100 | for (const msg of messages) { |
| 101 | if (isMessageCompacted(state, msg)) { |
| 102 | continue |
| 103 | } |
| 104 | |
| 105 | const parts = Array.isArray(msg.parts) ? msg.parts : [] |
| 106 | for (const part of parts) { |
| 107 | if (part.type !== "tool") { |
| 108 | continue |
| 109 | } |
| 110 | |
| 111 | if (!state.prune.tools.has(part.callID)) { |
| 112 | continue |
| 113 | } |
| 114 | if (part.state.status !== "completed") { |
| 115 | continue |
| 116 | } |
| 117 | if (part.tool !== "question") { |
| 118 | continue |
| 119 | } |
| 120 | |
| 121 | if (part.state.input?.questions !== undefined) { |
| 122 | part.state.input.questions = PRUNED_QUESTION_INPUT_REPLACEMENT |
| 123 | } |
| 124 | } |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | const pruneToolErrors = (state: SessionState, logger: Logger, messages: WithParts[]): void => { |
| 129 | for (const msg of messages) { |
no test coverage detected