Skip to content

prompt is too long when replacing in a file. #5478

@nachose

Description

@nachose

Description

When trying to get some output into a file, seems like the generated output is too long:

~ Preparing edit...
The edit tool was called with invalid arguments: [
{
"expected": "string",
"code": "invalid_type",
"path": [
"filePath"
],
"message": "Invalid input: expected string, received undefined"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"oldString"
],
"message": "Invalid input: expected string, received undefined"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"newString"
],
"message": "Invalid input: expected string, received undefined"
}
].
Please rewrite the input so it satisfies the expected schema.
I need to provide both oldString and newString parameters. Let me fix this error by providing both.
Let me fix the error by providing both oldString and newString parameters in the edit function call.
prompt is too long: 211846 tokens > 200000 maximum

OpenCode version

1.0.151

Steps to reproduce

  1. Ask about some subject (programming generates longer outputs).
  2. Ask to write the results to a file.

Screenshot and/or share link

No response

Operating System

Ubuntu

Terminal

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentui

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions