You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
prompt is too long when replacing in a file. #5478
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
Ask about some subject (programming generates longer outputs).
All of these appear to address the same root cause: the prompt context growing too large and exceeding the model's token limit. Your issue specifically mentions this happens when asking the edit tool to replace content in a file when the generated output is too long.
Feel free to ignore if your specific case with file replacement is distinct from these other reports.
Activity
github-actions commentedon Dec 13, 2025
This issue might be a duplicate of existing issues. Please check:
All of these appear to address the same root cause: the prompt context growing too large and exceeding the model's token limit. Your issue specifically mentions this happens when asking the edit tool to replace content in a file when the generated output is too long.
Feel free to ignore if your specific case with file replacement is distinct from these other reports.