Bug
swarm_complete always fails with Missing required parameters: start_time when called through the OpenCode plugin bridge.
Workers complete their work successfully but can't mark tasks done — they fall back to hive_close instead, breaking swarm tracking.
Root Cause
Schema drift between the CLI tool implementation and the plugin wrapper template.
| Layer |
start_time |
File |
| CLI tool implementation |
Required (line 1001, validated line 1038) |
packages/opencode-swarm-plugin/src/swarm-orchestrate.ts |
| MCP schema (swarm-tools) |
Required in required: [...] |
packages/swarm-tools/index.ts:368 |
| Plugin bridge template |
Missing entirely |
packages/opencode-swarm-plugin/examples/plugin-wrapper-template.ts:1196 |
start_time was added as required to swarm-orchestrate.ts and the MCP schema in swarm-tools/index.ts was updated, but the plugin wrapper template was never synced.
Reproduction
⚙ swarm_complete [project_key=/path/to/project, agent_name=worker-1, bead_id=cell-abc123, summary=Did the work, skip_verification=true]
Error: Missing required parameters: start_time
Suggested Fix
Add start_time to the template's swarm_complete args (line ~1203 of plugin-wrapper-template.ts):
start_time: tool.schema
.number()
.optional()
.describe("Task start timestamp (Unix ms) for duration calculation"),
And auto-inject a default in execTool or the tool's execute wrapper so workers that don't track start time still succeed:
execute: (args, ctx) => execTool("swarm_complete", { start_time: Date.now(), ...args }, ctx),
This is the same class of bug as #176 (Drizzle .default() quoting) — the core implementation changes but the surface layer doesn't get updated.
Affected Version
opencode-swarm-plugin@0.63.2
Environment
- OpenCode with swarm plugin
- macOS, Node 24.12.0
Bug
swarm_completealways fails withMissing required parameters: start_timewhen called through the OpenCode plugin bridge.Workers complete their work successfully but can't mark tasks done — they fall back to
hive_closeinstead, breaking swarm tracking.Root Cause
Schema drift between the CLI tool implementation and the plugin wrapper template.
start_timepackages/opencode-swarm-plugin/src/swarm-orchestrate.tsrequired: [...]packages/swarm-tools/index.ts:368packages/opencode-swarm-plugin/examples/plugin-wrapper-template.ts:1196start_timewas added as required toswarm-orchestrate.tsand the MCP schema inswarm-tools/index.tswas updated, but the plugin wrapper template was never synced.Reproduction
Suggested Fix
Add
start_timeto the template'sswarm_completeargs (line ~1203 ofplugin-wrapper-template.ts):And auto-inject a default in
execToolor the tool's execute wrapper so workers that don't track start time still succeed:This is the same class of bug as #176 (Drizzle
.default()quoting) — the core implementation changes but the surface layer doesn't get updated.Affected Version
opencode-swarm-plugin@0.63.2Environment