(text)
| 509 | const minuteTokenMap = new Map(); |
| 510 | |
| 511 | function truncateToolResult(text) { |
| 512 | if (MAX_TOOL_RESULT_CHARS == 0 || text.length <= MAX_TOOL_RESULT_CHARS) return text; |
| 513 | return text.slice(0, MAX_TOOL_RESULT_CHARS) + "\n... (truncated)"; |
| 514 | } |
| 515 | |
| 516 | function trimHistory() { |
| 517 | if (messages.length <= MAX_HISTORY_MESSAGES) return; |