Skip to content

aider not writing file contents to disk #3007

Open
@codescalar

Description

@codescalar

Issue

aider v0.70.0
Cmd: aider --sonnet --verbose

I noticed while running in verbose mode that aider was receiving responses containing SEARCH/REPLACE blocks, which were not being written to the filesystem even though they appear to be formatted correctly. Both times I saw this behavior, the LLM response didn't end until it asked to add another file in the chat. At that point, aider prompted me to add files to the chat but the edits were never written to disk.

Below is a snippet from the second time it happened to me.

ASSISTANT Ok, any changes I propose will be to those files.

USER Let's work on the chat command and chat panel files

USER I added these files to the chat: src/commands/chat.ts, src/panels/chatPanel.ts
...
...<omitted for brevity>
...
USER ONLY EVER RETURN CODE IN A *SEARCH/REPLACE BLOCK*!
USER 
USER Examples of when to suggest shell commands:
USER 
USER - If you changed a self-contained html file, suggest an OS-appropriate command to open a browser to view it to see the updated content.
USER - If you changed a CLI program, suggest the command to run it to see the new behavior.
USER - If you added a test, suggest how to run it with the testing tool used by the project.
USER - Suggest OS-appropriate commands to delete or rename files/directories, or other file system operations.
USER - If your code changes add new dependencies, suggest the command to install them.
USER - Etc.
USER 
I'll help implement the chat functionality based on the implementation plan. We'll need to:

1. Create the ChatPanel class to handle the UI
2. Implement the chat commands
3. Wire everything together

Here are the changes:

src/panels/chatPanel.ts
<source>typescript
<<<<<<< SEARCH
=======
import * as vscode from 'vscode'
import { LLMProvider } from '../providers/types'
import { Message } from '../providers/types'

export class ChatPanel {
    ...<omitted for brevity>
}
>>>>>>> REPLACE
</source>

src/commands/chat.ts
<source>typescript
<<<<<<< SEARCH
=======
import * as vscode from 'vscode'
import { LLMProvider } from '../providers/types'
import { ChatPanel } from '../panels/chatPanel'

export function registerChatCommands(
        context: vscode.ExtensionContext,
        provider: LLMProvider
) {
        let disposable = vscode.commands.registerCommand(
                'multi-llm-assistant.openChat',
                () => {
                        ChatPanel.createOrShow(provider)
                }
        )

        context.subscriptions.push(disposable)
}
>>>>>>> REPLACE
</source>

These changes implement:
1. A ChatPanel class that manages a webview-based chat interface
2. Basic chat UI with message history and input field
3. Command registration to open the chat panel
4. Message handling between the webview and extension

The chat interface supports:
- Sending messages with Send button or Enter key
- Scrollable message history
- Error handling for failed requests
- Persistent panel state

You'll need to add the command to package.json. Would you like me to help with that?
Tokens: 4.9k sent, 1.3k received. Cost: $0.03 message, $0.08 session.
Add package.json to the chat? (Y)es/(N)o/(D)on't ask again [Yes]:

Version and model info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions