-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed as duplicate of#8153
Closed as duplicate of#8153
Copy link
Labels
Issue - In ProgressSomeone is actively working on this. Should link to a PR soon.Someone is actively working on this. Should link to a PR soon.bugSomething isn't workingSomething isn't working
Description
Version: v3.22.5
API Provider: anthropic
Model: sonnet-3.5
What happened?
Clicking the 'cancel' button while the model is responding can cause a race condition between an open and closed task while it tries to write. If the in-memory state is empty after cancelling, safeWriteJson will be given '[]' to write and clobber the file.
This results in the following error:
ERR [Extension Host] [Roo-Debug] readApiMessages: Found API conversation history file,
but it's empty (parsed as []). TaskId: 68d5b8fb-1a53-45dd-9bf2-24934374293d,
Path: /home/ewheeler/.config/Code - Insiders/User/globalStorage/rooveterinaryinc.roo-cline/tasks/68d5b8fb-1a53-45dd-9bf2-24934374293d/api_conversation_history.json
Once this happens, the user cannot type into the chat box without closing the task and reopening it.
Expected behavior
Cancelling a task should properly handle the race condition and not corrupt the conversation history file.
Steps to reproduce
- Start a task with the model
- While the model is responding (particularly during the 'thinking' phase)
- Click the 'cancel' button
- Observe that the task may hang and the chat box becomes unusable
- Check the logs for the empty conversation history error
Additional context
Suggested fix: Use safeWriteJson read-modify-write transactions from PR #5332 for files in GlobalFileNames to prevent file corruption during race conditions.
dosubot and m-marie1
Metadata
Metadata
Assignees
Labels
Issue - In ProgressSomeone is actively working on this. Should link to a PR soon.Someone is actively working on this. Should link to a PR soon.bugSomething isn't workingSomething isn't working
Type
Projects
Status
Done