Skip to content

swarm_complete fails: plugin bridge missing start_time parameter (template drift) #177

Description

@mrm007

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions