Merge pull request #1322 from gsd-build/fix/opencode-task-tool-1316

fix: list OpenCode as runtime with Task tool support in map-codebase
This commit is contained in:
Tom Boucher
2026-03-22 11:29:59 -04:00
committed by GitHub
2 changed files with 17 additions and 4 deletions

View File

@@ -85,10 +85,10 @@ Continue to spawn_agents.
<step name="detect_runtime_capabilities">
Before spawning agents, detect whether the current runtime supports the `Task` tool for subagent delegation.
**Runtimes with Task tool:** Claude Code, Cursor (native subagent support)
**Runtimes WITHOUT Task tool:** Antigravity, Gemini CLI, OpenCode, Codex, and others
**Runtimes with Task tool:** Claude Code, Cursor, OpenCode (native subagent support via `Task` or `task`)
**Runtimes WITHOUT Task tool:** Antigravity, Gemini CLI, Codex, and others
**How to detect:** Check if you have access to a `Task` tool. If you do NOT have a `Task` tool (or only have tools like `browser_subagent` which is for web browsing, NOT code analysis):
**How to detect:** Check if you have access to a `Task` or `task` tool (either casing counts). If you do NOT have a Task/task tool (or only have tools like `browser_subagent` which is for web browsing, NOT code analysis):
**Skip `spawn_agents` and `collect_confirmations`** — go directly to `sequential_mapping` instead.
@@ -218,7 +218,7 @@ If any agent failed, note the failure and continue with successful documents.
Continue to verify_output.
</step>
<step name="sequential_mapping" condition="Task tool is NOT available (e.g. Antigravity, Gemini CLI, Codex)">
<step name="sequential_mapping" condition="Task/task tool is NOT available (e.g. Antigravity, Gemini CLI, Codex)">
When the `Task` tool is unavailable, perform codebase mapping sequentially in the current context. This replaces `spawn_agents` and `collect_confirmations`.
**IMPORTANT:** Do NOT use `browser_subagent`, `Explore`, or any browser-based tool. Use only file system tools (Read, Bash, Write, Grep, Glob, list_dir, view_file, grep_search, or equivalent tools available in your runtime).

View File

@@ -950,6 +950,19 @@ describe('cmdInitMapCodebase', () => {
assert.deepStrictEqual(output.existing_maps, []);
assert.strictEqual(output.codebase_dir_exists, true);
});
test('map-codebase workflow lists OpenCode as having Task tool support (#1316)', () => {
const workflow = fs.readFileSync(
path.join(__dirname, '..', 'get-shit-done', 'workflows', 'map-codebase.md'), 'utf8'
);
// OpenCode must appear in the "with Task tool" line, not the "WITHOUT" line
const withLine = workflow.split('\n').find(l => l.includes('Runtimes with Task tool'));
const withoutLine = workflow.split('\n').find(l => l.includes('WITHOUT Task tool'));
assert.ok(withLine, 'workflow should have a "Runtimes with Task tool" line');
assert.ok(withoutLine, 'workflow should have a "WITHOUT Task tool" line');
assert.ok(withLine.includes('OpenCode'), 'OpenCode must be listed under runtimes WITH Task tool');
assert.ok(!withoutLine.includes('OpenCode'), 'OpenCode must NOT be listed under runtimes WITHOUT Task tool');
});
});
// ─────────────────────────────────────────────────────────────────────────────