Skip to content

Can not write files #18151

@dctr

Description

@dctr

Description

I am consistently seeing write failures when trying to write new files. (Small patches usually work.)

Most of the time, I see the tool just having {} arguments, and the return is `Write Failed: Tool execution aborted.

One out of the 10+ attempts looked like this:

The write tool was called with invalid arguments: [
  {
    "expected": "string",
    "code": "invalid_type",
    "path": [
      "content"
    ],
    "message": "Invalid input: expected string, received undefined"
  },
  {
    "expected": "string",
    "code": "invalid_type",
    "path": [
      "filePath"
    ],
    "message": "Invalid input: expected string, received undefined"
  }
].
Please rewrite the input so it satisfies the expected schema.

Plugins

None

OpenCode version

Desktop, Version 1.2.27

Steps to reproduce

  1. Tell AI to come up with "something", and have it write it to a file.
  2. AI uses write tool call
  3. ???
  4. Repeats several times and fails

Screenshot and/or share link

No response

Operating System

macOS 26.3.1

Terminal

Desktop app, but also happens on iTerm

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions