Skip to content

Modifications to the code buffer seem to happen twice #660

@bronger

Description

@bronger

Checklist

  • I agree to communicate with the author myself (not AI-generated).
  • I've read the README's Filing issues section.
  • I'm running the latest versions (fill in below).
    • agent-shell version: v0.51.1
    • acp.el version: 0.11.3
    • ACP package (e.g. claude-agent-acp) version: ~/.emacs.d/elpa/agent-shell-20260512.1559/agent-shell-opencode.el
    • Agent CLI (e.g. claude, gemini) version: I don’t know
  • For requesting new agent support, I'm including a link to the ACP-capable agent or related ACP package.
  • For issues, I'm including ACP traffic (as per README).

I use opencode with locally running LLMs. Here is a fraction of my opencode configuration:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["@tarquinen/opencode-dcp@latest"],
  "model": "blablador/alias-fast",
  "small_model": "blablador/alias-fast",
  "permission": {
    "edit": "ask",
    "bash": "ask",
    "webfetch": "allow"
  },

When the agent is supposed to modify a code buffer, the following happens: (Taken from *Messages*.)

Press RET or y to Allow once
Allow once
Reverting buffer ‘controllers.go’
controllers.go changed on disk; really edit the buffer? (y, n, r or C-h) r
LSP :: Disconnected
Press RET or y to Allow once
Allow once

(I use gopls as my Go LSP server.)

This seems to mean that the source code file is changed twice: Once directly in the file system, and then by patching the buffer contents. Funny enough, there is a second edit which happened without issues.

The traffic is here: https://wilson.bronger.org/traffic

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions