Bug Description
checkAgentsInstalled() in the SDK only checks for agents in the global runtime config directory (~/.config/opencode/agents/ for opencode runtime), but does not check or consider agents installed in the project-local .opencode/agents/ directory.
Steps to Reproduce
- Install GSD agents in a project's
.opencode/agents/ directory
- Run
gsd-sdk query init.new-project
- Observe
agents_installed: false and a full list of missing_agents, even though the agent files exist
Expected Behavior
Both global (~/.config/opencode/agents/) and project-local (.opencode/agents/) directories should be checked. If agents exist in either location, agents_installed should be true.
Root Cause
In sdk/dist/query/helpers.js, resolveAgentsDir() returns the global config path only:
export function resolveAgentsDir(runtime = 'claude') {
if (process.env.GSD_AGENTS_DIR)
return process.env.GSD_AGENTS_DIR;
return join(getRuntimeConfigDir(runtime), 'agents'); // ~/.config/opencode/agents/
}
And checkAgentsInstalled() only probes that single directory.
Suggested Fix
Modify checkAgentsInstalled() to also check for agents in the project directory (.opencode/agents/) in addition to the global agents directory. The agent files in the local directory should be treated as valid installations.
Environment
- Runtime: opencode
- Agents location:
local_repo/.opencode/agents/ (project-local)
- Global agents dir:
~/.config/opencode/agents/ (does not exist)
- SDK version: v1.38.5
Bug Description
checkAgentsInstalled()in the SDK only checks for agents in the global runtime config directory (~/.config/opencode/agents/for opencode runtime), but does not check or consider agents installed in the project-local.opencode/agents/directory.Steps to Reproduce
.opencode/agents/directorygsd-sdk query init.new-projectagents_installed: falseand a full list ofmissing_agents, even though the agent files existExpected Behavior
Both global (
~/.config/opencode/agents/) and project-local (.opencode/agents/) directories should be checked. If agents exist in either location,agents_installedshould betrue.Root Cause
In
sdk/dist/query/helpers.js,resolveAgentsDir()returns the global config path only:And
checkAgentsInstalled()only probes that single directory.Suggested Fix
Modify
checkAgentsInstalled()to also check for agents in the project directory (.opencode/agents/) in addition to the global agents directory. The agent files in the local directory should be treated as valid installations.Environment
local_repo/.opencode/agents/(project-local)~/.config/opencode/agents/(does not exist)