Summary
submit_plan appears broken when invoked through the allowed plan agent path from Opencode.
Direct orchestrator calls are correctly blocked in plan-agent mode, but once the request is routed through the plan agent, the initial submit still fails before the review flow starts.
This seems related to Opencode integration and started after the 0.19.18 changes in Plannotator.
What works
- Direct orchestrator call is rejected as expected in plan-agent mode:
submit_plan can only be called by: plan
- Invoking the flow through a
plan agent does reach submit_plan
What fails
The first submit_plan call fails against an empty backing file with:
Error: end (1) exceeds file length (0)
We also retried using the documented first-call payload shape:
{
"edits": [
{
"start": 1,
"content": "# Smoke Test Plan\n\n1. Verify initial submit works.\n2. Confirm whether the review flow responds.\n"
}
]
}
That still behaved as if end: 1 were present and failed with the same error:
Error: end (1) exceeds file length (0)
Expected behavior
For the first submit_plan call on a new backing file, a single edit with start=1 and content only should succeed and start the normal review/approval flow.
Actual behavior
The plan-agent path appears to inject or normalize the payload in a way that behaves as though end is set on the initial call, causing validation to fail before the review flow appears.
Repro notes
- Environment: Opencode
- Workflow: Plannotator plan-agent mode
- No repo files or Plannotator config were changed during testing
- This did not look like a permission/configuration issue; it looked like a wrapper/serialization issue in the plan-agent path
Suspected regression window
Started after the 0.19.18 changes in Plannotator.
OpenCode 1.15.4
Summary
submit_planappears broken when invoked through the allowedplanagent path from Opencode.Direct orchestrator calls are correctly blocked in plan-agent mode, but once the request is routed through the
planagent, the initial submit still fails before the review flow starts.This seems related to Opencode integration and started after the
0.19.18changes in Plannotator.What works
submit_plan can only be called by: planplanagent does reachsubmit_planWhat fails
The first
submit_plancall fails against an empty backing file with:Error: end (1) exceeds file length (0)We also retried using the documented first-call payload shape:
{ "edits": [ { "start": 1, "content": "# Smoke Test Plan\n\n1. Verify initial submit works.\n2. Confirm whether the review flow responds.\n" } ] }That still behaved as if
end: 1were present and failed with the same error:Error: end (1) exceeds file length (0)Expected behavior
For the first
submit_plancall on a new backing file, a single edit withstart=1andcontentonly should succeed and start the normal review/approval flow.Actual behavior
The plan-agent path appears to inject or normalize the payload in a way that behaves as though
endis set on the initial call, causing validation to fail before the review flow appears.Repro notes
Suspected regression window
Started after the
0.19.18changes in Plannotator.OpenCode
1.15.4Patch is released,
@plannotator/opencode@0.19.19(latest should updated for opencode)