Summary
The OpenCode plugin generated by cbm install (~/.config/opencode/plugins/cbm-augment.ts, produced by src/cli/client_adapter.c) never augments Grep/Glob results because it reads the tool arguments from the wrong place.
Version / Reproducible
- Installed: v0.10.5
- Confirmed still present in v0.10.8:
client_adapter.c is identical (git diff between the v0.10.5 and v0.10.8 tags is empty for this file), and the released v0.10.8 source still has the same line.
Root cause
The generated tool.execute.after hook calls:
const extra = await augment(tool, output?.args);
But the OpenCode plugin tool.execute.after hook signature is:
"tool.execute.after"?: (
input: { tool: string; sessionID: string; callID: string; args: any },
output: { title: string; output: string; ... },
) => Promise<void>
The tool arguments live in input.args, not output — output is the tool result and has no args field. So output?.args is always undefined, the payload sent to hook-augment is {"tool_input":{}}, the graph lookup matches nothing, and no [codebase-memory] context is ever appended. Real Grep/Glob results are never augmented, even though the hook and daemon are otherwise working.
Fix
Use input?.args instead:
const extra = await augment(tool, input?.args);
This is the location in the generator:
src/cli/client_adapter.c — the "tool.execute.after" template (const extra = await augment(tool, output?.args);).
I verified the fix locally: after switching to input?.args, Grep results are augmented with the expected [codebase-memory] N graph symbol(s) match ... block, in both a fresh index and existing indexes.
Summary
The OpenCode plugin generated by
cbm install(~/.config/opencode/plugins/cbm-augment.ts, produced bysrc/cli/client_adapter.c) never augmentsGrep/Globresults because it reads the tool arguments from the wrong place.Version / Reproducible
client_adapter.cis identical (git diffbetween the v0.10.5 and v0.10.8 tags is empty for this file), and the releasedv0.10.8source still has the same line.Root cause
The generated
tool.execute.afterhook calls:But the OpenCode plugin
tool.execute.afterhook signature is:The tool arguments live in
input.args, notoutput—outputis the tool result and has noargsfield. Sooutput?.argsis alwaysundefined, the payload sent tohook-augmentis{"tool_input":{}}, the graph lookup matches nothing, and no[codebase-memory]context is ever appended. RealGrep/Globresults are never augmented, even though the hook and daemon are otherwise working.Fix
Use
input?.argsinstead:This is the location in the generator:
src/cli/client_adapter.c— the"tool.execute.after"template (const extra = await augment(tool, output?.args);).I verified the fix locally: after switching to
input?.args,Grepresults are augmented with the expected[codebase-memory] N graph symbol(s) match ...block, in both a fresh index and existing indexes.