MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / clearChatState

Function clearChatState

cli/src/utils/run-state-storage.ts:179–200  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

177 * Clear the saved state files
178 */
179export 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}

Callers

nothing calls this directly

Calls 2

getRunStatePathFunction · 0.85
getChatMessagesPathFunction · 0.85

Tested by

no test coverage detected