Files
hapi/cli/src/opencode
Junmo KimandGitHub b9880693a7 fix(opencode): describe display tools via Code Mode execute for OpenCode v2 (#2307)
* fix(opencode): describe display tools via Code Mode execute for OpenCode v2

OpenCode v2 can list MCP tools only in a Code Mode catalog whose entries
are callable as JavaScript inside the execute tool, so the hapi_display_*
names and aliases HAPI advertised may not exist there. Replace the three
per-tool display hints used by the OpenCode instructions with one block
that prefers a direct tool and otherwise calls tools.hapi.<tool>({ path })
through execute. The block appears once in both the ACP first prompt and
the local hapi-instructions.md. Hints for other agents are unchanged.

* fix(opencode): do not re-display user-provided files unless asked

Agents sometimes called the display tools on a file the user had just
attached or asked them to read, which only echoes it back. Say in the
display tools block that the tools are for files the user has not been
shown, and that files the user attached, pasted, or pointed to are not
displayed again unless the user asks.
2026-11-06 15:51:12 +08:00
..