Skip to content

read_file、edit_file失败导致一轮对话中的修改丢失 #1445

@tktkku

Description

@tktkku

What happened
A clear and concise description.
Problem
当在桌面端开启YOLO模式时,会发现read_file、edit_file这些tool调用经常失败(原因未知,猜测可能与文件编码有关),在失败之后模型会尝试通过powershell去读取和修改代码。edit_file和通过powershell都可能失败,而在失败之后,模型的解决方法是从git提取上次commit的代码,然后再根据历史对话记录重新应用修改。这种机制会浪费token,并且也不能完全恢复到和之前一样,有一些细节和之前的不同,而且如果中间自己手动修改了代码,这部分修改也丢失了。

Image

Expected
What you expected to happen.
增加一种容错(灾)机制,缓存每一轮对话后的更改(无论reasonix做的还是用户做的),让用户至少可以撤销某一prompts后的所有修改。

Reproduction
Steps or minimal code that reproduces it.

Environment

  • Reasonix version (reasonix --version): 0.47.1
  • Node version (node --version): v22.19.0
  • OS (Windows 11 / macOS 14 / Ubuntu 24.04 / …): Windows 11
  • Shell (bash, zsh, fish, PowerShell 7, PowerShell 5.1, cmd, …): reasonix desktop
  • Terminal app (Windows Terminal, iTerm2, Alacritty, kitty, WezTerm, VSCode integrated, Cursor integrated, Hyper, …): reasonix desktop
  • DeepSeek model (e.g. deepseek-v4-flash, deepseek-v4-pro): deepseek-v4-flash

Logs / transcript
If using the CLI, attach the relevant chunk of --transcript, or run
reasonix doctor and paste the output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions