Skip to content

fix(opencode): recognize todowrite in V2 mapping when experimental.todo is enabled (#2701) - #2719

Open
Aniketchavan7 wants to merge 1 commit into
obra:mainfrom
Aniketchavan7:fix/opencode-v2-todowrite-mapping
Open

Aniketchavan7 wants to merge 1 commit into
obra:mainfrom
Aniketchavan7:fix/opencode-v2-todowrite-mapping

Conversation

@Aniketchavan7

Copy link
Copy Markdown

Resolves #2701

Summary

In OpenCode v2.x, the \ odowrite\ tool exists and is exposed when \�xperimental.todo: true\ is configured in \opencode.json\ (per OpenCode Todo Docs).

Previously, \V2_MAPPING\ asserted:
- Create or update todos → OpenCode v2 has no todo tool; track the plan in a markdown file (or the harness's plan facility) instead\

As reported in #2701, this caused models to distrust or ignore the native \ odowrite\ tool present in their tool list and drift into hallucinatory pseudo-tool syntax.

Changes

  1. **.opencode/plugins/superpowers.js**:
    • Updated \V2_MAPPING\ to teach \ odowrite\ when available with \�xperimental.todo: true\ (passing a JSON array of {content, status}\ items), while preserving plan markdown file tracking as a fallback.
  2. Docs:
    • Updated \docs/README.opencode.md\ and .opencode/INSTALL.md\ to reflect that \ odowrite\ is gated behind \�xperimental.todo: true\ rather than omitted entirely.
  3. Tests:
    • Updated \ ests/opencode/test-bootstrap-caching.mjs\ to verify that \V2_MAPPING\ accurately teaches \ odowrite\ when available and avoids treating \ odowrite\ as an obsolete V1-only tool. Verified all checks pass with exit code 0.

Co-authored-by: yalongwastaken yalongwastaken@users.noreply.github.com

…al.todo is enabled (obra#2701)

In OpenCode v2.x, todowrite is available when experimental.todo: true is configured. Previously, the V2 tool mapping asserted that V2 had no todo tool, causing models to distrust the available tool or emit unparseable pseudo-tool text. Update the V2 mapping, documentation, and bootstrap tests to teach todowrite usage when available while retaining markdown tracking fallback. Closes obra#2701

Co-authored-by: yalongwastaken <yalongwastaken@users.noreply.github.com>

@danishkumar26 danishkumar26 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review of #2719 — fix(opencode): recognize todowrite in V2 mapping when experimental.todo is enabled (#2701) (by Aniketchavan7)

What this change does:

  • Rewrites the OpenCode V2 tool mapping in .opencode/INSTALL.md, .opencode/plugins/superpowers.js and docs/README.opencode.md: V2's todo tool is todowrite, available only when experimental.todo: true is set in opencode.json, taking {content, status} items. Previously the docs said V2 has no todo tool.
  • tests/opencode/test-bootstrap-caching.mjs: replaces mapsV2NoTodoTool with mapsV2TodoTool, drops todowrite from the stale-V1-tools check, and updates the asserted needles.

Findings:

  1. Internally consistent. All four files say the same thing about todowrite and experimental.todo, and the test assertions match the doc text.
  2. Unverifiable external claim. Whether OpenCode V2 really exposes todowrite behind experimental.todo depends on the OpenCode 2.0.4/2.0.7 host contracts cited in the docs; I can't check that here. If the contract differs, the mapping teaches a tool that does not exist — the one real risk, and it sits outside this repo.

Verdict: Ship, with the caveat noted in finding 2.

Verification context: this repo has no CI workflows in this clone and no node_modules installed, so I could not run tests or CI here. Review is based on reading the full diff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

opencode-v2 tool mapping wrongly claims "no todo tool" — todowrite exists with experimental.todo

2 participants