submit_plan with missing edits aborts with "Tool execution interrupted" instead of returning a recoverable error
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- tooling
Research direction
Read apps/opencode-plugin/index.ts where the submit_plan arguments are declared, then check apps/opencode-plugin/submit-plan-executor.ts and its tests for the existing missing-edits guard. Make the registered tool accept omitted edits and confirm a call with {} returns the friendly error without opening the review flow.
Written by the indexing model from the issue text.
Description
What happened?
When submit_plan is called without the required edits argument (for example, the model emits an empty/malformed tool call), OpenCode reports the tool call as interrupted instead of returning the existing friendly "No edits provided" error. No Plannotator review window opens, no plan backing file is created, and the agent gets no actionable error to recover from.
This is easy for a model to hit because submit_plan is an edit-based tool and a malformed call can omit edits entirely.
Plannotator version
0.28.32
OS
macOS 27.0.1
Agent
OpenCode
Where did it happen?
Plan review
Steps to reproduce
- Use OpenCode 2.1.4 with
@plannotator/[email protected]and theplan-agentworkflow. - In Plan mode, call
submit_planwith{}(missingedits), or any malformed arguments object withoutedits. - Observe the tool result:
Tool execution interrupted. - Observe that no Plannotator review UI opens and no
~/.plannotator/active/<project>/_active-plan.mdis created.
Calling submit_plan with {"edits":[]} is different: it reaches executeSubmitPlan and returns Error: No edits provided..., which the agent can recover from. The problem is specifically the missing field being rejected before execute.
Expected behavior
The tool should return a normal, recoverable tool result such as:
Error: No edits provided. Pass at least one edit with start and content.
The agent can then retry with a valid edits array. No review UI should open for an invalid call.
Actual behavior
OpenCode aborts the tool call with a generic Tool execution interrupted, so the agent does not know why it failed and cannot correct the call. The user sees no review window and no useful error either.
Root cause
apps/opencode-plugin/index.tsdeclareseditsas a required tool argument:args: { edits: tool.schema.array(...) }- OpenCode validates tool arguments before calling
execute, soexecuteSubmitPlannever runs. - The friendly guard already exists in
apps/opencode-plugin/submit-plan-executor.ts:
but it is unreachable when the schema rejects the missing field first.if (!invocation.edits || invocation.edits.length === 0) { return "Error: No edits provided. Pass at least one edit with start and content."; } - OpenCode then surfaces the validation failure as an interrupted tool call rather than a tool error the model can read.
Suggested fix
Plugin-side, make edits optional in the tool argument schema and let the existing executor guard handle it:
args: {
edits: tool.schema
.array(
tool.schema.object({
start: tool.schema.number(),
end: tool.schema.number().optional(),
content: tool.schema.string(),
}),
)
.optional(),
},
Alternatively use .default([]) if OpenCode applies schema defaults before execute. Keep the executor guard as the single source of the friendly error.
Add a regression test for missing/empty edits:
executeSubmitPlan({ edits: undefined, ... })returns the friendly error.- Ideally an integration test that calls the registered tool with
{}and asserts it does not throw/abort.
Broader fix (OpenCode side): schema validation failures should be returned as recoverable tool errors with the validation message, rather than as Tool execution interrupted. That would make any tool with invalid arguments self-correctable.
Additional context
- The tool result was the only signal:
Tool execution interrupted. - No
submit_planentry reached the Plannotator plan review flow, and no active plan file was created for the project. - This is not the same as the existing OpenCode TUI rendering bug in #1893; the TUI itself is not involved here.
- Dominant language
- TypeScript
- Stars
- 8.7k
- Forks
- 649
- Avg merge
- 8h 39m
- Merged PRs (30d)
- 680
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from backnotprop/plannotator
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
backnotprop/plannotator#2317 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
backnotprop/plannotator#2290 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
backnotprop/plannotator#2243 · 2 comments · 2 reactions ·
Maintainers usually reply within 1 day
-
Annotate documentation omits per-file version history and privacy controlsMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
backnotprop/plannotator#1086 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 50/100
backnotprop/plannotator#2508 ·
Maintainers usually reply within 1 day
All issues in backnotprop/plannotator
Similar issues
-
Remove unused dependenciesPossibly taken @alastair-smith claimed this today. Openchore other
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
alastair-smith/card-games#384 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
code-yeongyu/senpi#5571 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nexu-io/open-design#9262 · 1 comment ·
Maintainers usually reply within 1 day
-
friction
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
kentcdodds/kody#4753 ·
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 62/100
lingdojo/kana-dojo#33508 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day