Commit d5b6bc7
fix: single submit_plan with text/path auto-detect for OpenCode (#333)
* fix: restore uniform submit_plan and add submit_plan_file for OpenCode
PR #318 replaced the original text-based submit_plan with a file-path-only
version and split prompt injection between plan/non-plan agents. This caused
regressions: the agent couldn't figure out file paths from non-plan agents,
and the 80+ line prompt with TodoWrite replacements was fragile against
OpenCode upstream changes.
This restores the original submit_plan(plan) that accepts markdown text
directly — the contract that worked uniformly across all agents — and keeps
the file-based workflow as submit_plan_file(path) for users who want
persistent plan files.
Key changes:
- Two tools: submit_plan (text) + submit_plan_file (path)
- Unified prompt for all primary agents (not just plan mode)
- Removed aggressive TodoWrite string replacements and system-reminder
- Kept adversarial stripping of OpenCode's STRICTLY FORBIDDEN rules
- Extracted shared server helpers to reduce duplication
Addresses #328
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: single submit_plan with auto-detect text/path for OpenCode
Collapses submit_plan + submit_plan_file back into one tool that
auto-detects whether the argument is plan text or a file path.
First submission: agent passes markdown text (simple, works from any agent).
On deny: response includes the history path where the plan was saved, so the
agent can Edit the file for targeted revisions and resubmit with the path.
Key changes:
- One tool: submit_plan(plan) accepts text or absolute .md file path
- Server surfaces historyPath through waitForDecision (already saved by
saveToHistory, just not returned before)
- Deny response includes file path hint for Edit-based revision workflow
- Unified prompt for all primary agents (~25 lines, no TodoWrite warfare)
- Still strips OpenCode's STRICTLY FORBIDDEN rules and suppresses plan_exit
Addresses #328 and rcdailey's feedback on PR #333
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: remove historyPath leak, error on missing file paths, restore two-tier prompt
- Remove historyPath from deny flow — internal history directory should not
be exposed to agents. Text submissions get text feedback; file submissions
get file feedback. No crossover.
- Error when agent passes an absolute .md path that doesn't exist instead of
silently treating it as plan text.
- Restore two-tier prompt: plan agent gets full planning instructions, other
primary agents get a minimal reminder (matching pre-v0.13.0 behavior).
- Clean up stale prompt copy referencing historyPath-based revision flow.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: restore todowrite override, strengthen planning prompt, remove noisy logs
- Override todowrite description to defer to submit_plan during active planning
- Tool description now instructs agent to explore and ask questions before submitting
- Sequenced planning prompt: explore, ask, then write
- Remove success logs from integration saves (stderr was bleeding through)
- Append resubmit reminder to OpenCode deny feedback
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 9056e18 commit d5b6bc7
4 files changed
Lines changed: 105 additions & 178 deletions
0 commit comments