(tabId, content)
| 1809 | |
| 1810 | // Helper function to send chat error responses (prevents errors from being added to context) |
| 1811 | function sendChatErrorResponse(tabId, content) { |
| 1812 | chrome.tabs.sendMessage(tabId, { |
| 1813 | action: "updateChatHistory", |
| 1814 | role: "error", |
| 1815 | content: content |
| 1816 | }); |
| 1817 | } |
| 1818 | |
| 1819 | // ======================================== |
| 1820 | // NOTE: Token refresh is now handled automatically by the server |