Summary
warpgrep_codebase_search consistently fails through the OpenCode Morph plugin with:
Search failed: search returned no error details.
However, calling @morphllm/morphsdk directly with repoRoot set to the real workspace directory succeeds for the same queries. This suggests the plugin may be resolving the search root to OpenCode's snapshot git directory instead of the actual worktree.
Environment
@morphllm/opencode-morph-plugin: 2.0.13
- Plugin runtime log reports:
Plugin v2.0.0 loaded [edit, warpgrep, warpgrep-github, compact]
@morphllm/morphsdk: 0.2.173
- OpenCode:
1.16.2
- OS: macOS
- Node.js used for direct SDK test:
v24.13.0
MORPH_API_KEY: configured
Reproduction
In an OpenCode session inside a normal git repository, run:
warpgrep_codebase_search({
"search_term": "Find README.md and CHANGELOG.md files in this repository."
})
Observed result:
Search failed: search returned no error details.
I also tried several different query shapes, all with the same result:
Find README.md and CHANGELOG.md files in this repository.
Find package version 0.7.0.
Find documentation describing supported Dynamic Workflows executors: codex, claude, and opencode.
Find the acp_opencode executor implementation and validation rules.
Find the scheduler implementation for workflow task dependencies and foreach.
All failed identically through the tool.
Control checks
Normal local search tools can see the files:
README.md
CHANGELOG.md
- plugin source files
- docs
Direct SDK usage also works when repoRoot is set to the real workspace directory:
import { WarpGrepClient } from "@morphllm/morphsdk";
const client = new WarpGrepClient({
morphApiKey: process.env.MORPH_API_KEY,
timeout: 60000,
debug: true,
});
const gen = client.execute({
searchTerm: "Find README.md and CHANGELOG.md files in this repository.",
repoRoot: process.cwd(),
streamSteps: true,
});
let final;
for (;;) {
const r = await gen.next();
if (r.done) {
final = r.value;
break;
}
console.log(r.value);
}
console.log(final);
This succeeds and returns contexts for README.md and CHANGELOG.md.
Relevant logs / findings
OpenCode logs show the session has:
cwd=<REAL_WORKSPACE_PATH>
git=<OPENCODE_SNAPSHOT_GIT_PATH>
The git path points under OpenCode's snapshot storage, e.g.:
<HOME>/.local/share/opencode/snapshot/<project-id>/<snapshot-id>
That directory appears to be a git metadata directory, containing entries like:
config
description
HEAD
hooks/
index
info/
objects/
packed-refs
refs/
It is not the real source worktree.
The plugin code appears to prefer worktree over directory:
function resolveSessionRepoRoot(sessionDirectory, sessionWorktree) {
return sessionWorktree || sessionDirectory;
}
Then warpgrep_codebase_search calls:
warpGrep.execute({
searchTerm: args.search_term,
repoRoot: resolveSessionRepoRoot(directory, worktree),
streamSteps: true,
});
If OpenCode passes the snapshot git directory as worktree, WarpGrep searches the snapshot metadata instead of the real repository directory.
Expected behavior
warpgrep_codebase_search should search the actual source workspace, e.g. the session directory, not OpenCode's internal snapshot git directory.
For the query:
Find README.md and CHANGELOG.md files in this repository.
I would expect contexts for:
Actual behavior
The tool returns:
Search failed: search returned no error details.
OpenCode/Morph logs report:
WarpGrep: 0 contexts in N turns
Suspected cause
resolveSessionRepoRoot() may be using the wrong field. In this OpenCode version, worktree appears to refer to an internal snapshot git directory rather than the checked-out project worktree.
Possible fixes:
- Prefer
directory over worktree for local warpgrep_codebase_search.
- Detect OpenCode snapshot git directories and fall back to
directory.
- Validate that the selected
repoRoot contains normal source files, not only git metadata.
- Improve the error message when WarpGrep returns
success: false without an error.
Notes
This does not look like a missing API key or Morph API outage:
MORPH_API_KEY is configured.
- Direct SDK calls with the same key succeed.
- The failure only occurs through the OpenCode plugin tool path.
Summary
warpgrep_codebase_searchconsistently fails through the OpenCode Morph plugin with:However, calling
@morphllm/morphsdkdirectly withrepoRootset to the real workspace directory succeeds for the same queries. This suggests the plugin may be resolving the search root to OpenCode's snapshot git directory instead of the actual worktree.Environment
@morphllm/opencode-morph-plugin:2.0.13Plugin v2.0.0 loaded [edit, warpgrep, warpgrep-github, compact]@morphllm/morphsdk:0.2.1731.16.2v24.13.0MORPH_API_KEY: configuredReproduction
In an OpenCode session inside a normal git repository, run:
Observed result:
I also tried several different query shapes, all with the same result:
Find README.md and CHANGELOG.md files in this repository.Find package version 0.7.0.Find documentation describing supported Dynamic Workflows executors: codex, claude, and opencode.Find the acp_opencode executor implementation and validation rules.Find the scheduler implementation for workflow task dependencies and foreach.All failed identically through the tool.
Control checks
Normal local search tools can see the files:
README.mdCHANGELOG.mdDirect SDK usage also works when
repoRootis set to the real workspace directory:This succeeds and returns contexts for
README.mdandCHANGELOG.md.Relevant logs / findings
OpenCode logs show the session has:
The
gitpath points under OpenCode's snapshot storage, e.g.:That directory appears to be a git metadata directory, containing entries like:
It is not the real source worktree.
The plugin code appears to prefer
worktreeoverdirectory:Then
warpgrep_codebase_searchcalls:If OpenCode passes the snapshot git directory as
worktree, WarpGrep searches the snapshot metadata instead of the real repository directory.Expected behavior
warpgrep_codebase_searchshould search the actual source workspace, e.g. the sessiondirectory, not OpenCode's internal snapshot git directory.For the query:
I would expect contexts for:
Actual behavior
The tool returns:
OpenCode/Morph logs report:
Suspected cause
resolveSessionRepoRoot()may be using the wrong field. In this OpenCode version,worktreeappears to refer to an internal snapshot git directory rather than the checked-out project worktree.Possible fixes:
directoryoverworktreefor localwarpgrep_codebase_search.directory.repoRootcontains normal source files, not only git metadata.success: falsewithout anerror.Notes
This does not look like a missing API key or Morph API outage:
MORPH_API_KEYis configured.