Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Sub-agent Delegation not triggering separate API calls in OpenRouter (OpenCode) #34

@Milor123

Description

@Milor123

Description

When using the sdd-orchestrator with OpenCode, the orchestrator reports that it is "launching a sub-agent" and appears to execute tasks in a separate process. However, when checking the OpenRouter API statistics, 100% of the activity is attributed to the orchestrator model (Kimi 2.5). No activity is recorded for the sub-agent model (Minimax M2.5), suggesting that the execution is happening inline or inheriting the parent's model/session despite the command configuration.

Environment

  • Tool: OpenCode
  • Orchestrator Model: openrouter/moonshotai/kimi-k2.5
  • Sub-agent Model (Intended): openrouter/minimax/minimax-m2.5
  • OS: Windows 11

Configuration Details

1. Directory Structure

The setup follows the standard agent-teams-lite installation for OpenCode:

  • Global Config: ~/.config/opencode/opencode.json
  • Commands: ~/.config/opencode/commands/sdd-*.md
  • Skills: ~/.config/opencode/skills/sdd-*

2. Orchestrator Configuration (opencode.json)

{
    "agent": {
        "sdd-orchestrator": {
            "description": "Agent Teams Orchestrator",
            "model": "openrouter/moonshotai/kimi-k2.5",
            "mode": "all"
        }
    }
}

3. Command Definition (sdd-apply.md)

The command file used for implementation tasks:

---
description: Implement SDD tasks — writes code following specs and design
agent: sdd-orchestrator
subtask: true
model: "openrouter/minimax/minimax-m2.5"
---
You are an SDD sub-agent. Read the skill file at ~/.config/opencode/skills/sdd-apply/SKILL.md FIRST...

How to Reproduce

  1. Start OpenCode and select the sdd-orchestrator agent.
  2. Initialize a project with /sdd-init.
  3. Run a command that triggers a sub-agent, for example:
    /sdd-apply create a small calculator that adds 8 and 8
  4. Observe the OpenCode UI showing a sub-process execution.
  5. Check OpenRouter activity/statistics for the API key used.

Observed Behavior

  • OpenCode UI indicates a sub-task is running.
  • The output appears to follow the sdd-apply skill.
  • OpenRouter Stats: Only kimi-k2.5 shows token usage. minimax-m2.5 remains at zero usage.

Expected Behavior

The orchestrator should delegate the task via the Task tool, and OpenCode should initiate a new session/request using the model specified in the sdd-apply.md frontmatter (minimax-m2.5).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions