()
| 177 | * Clear the saved state files |
| 178 | */ |
| 179 | export function clearChatState(): void { |
| 180 | try { |
| 181 | const runStatePath = getRunStatePath() |
| 182 | const messagesPath = getChatMessagesPath() |
| 183 | |
| 184 | if (fs.existsSync(runStatePath)) { |
| 185 | fs.unlinkSync(runStatePath) |
| 186 | } |
| 187 | if (fs.existsSync(messagesPath)) { |
| 188 | fs.unlinkSync(messagesPath) |
| 189 | } |
| 190 | |
| 191 | logger.debug({ runStatePath, messagesPath }, 'Cleared chat state files') |
| 192 | } catch (error) { |
| 193 | logger.error( |
| 194 | { |
| 195 | error: error instanceof Error ? error.message : String(error), |
| 196 | }, |
| 197 | 'Failed to clear chat state', |
| 198 | ) |
| 199 | } |
| 200 | } |
nothing calls this directly
no test coverage detected