Fusion Harness: How to combine a more expensive main model and a sidekick model A developer built a fusion-style delegation harness using the OpenHands SDK that combines a high-capability main LLM agent with a cheaper sidekick agent. The harness allows the main agent to issue multiple parallel task-tool calls to the sidekick, which can escalate back to the main agent when work exceeds its budget. This approach aims to reduce costs by delegating read-only investigation and small tasks to the sidekick while reserving complex decisions for the main model. | """Fusion-style delegation harness built with the OpenHands SDK. | | | Install: | | | uv pip install openhands-sdk openhands-tools | | | Run: | | | export LLM API KEY="..." or export OPENHANDS API KEY="..." | | | export MAIN MODEL="openhands/gpt-5.5" | | | export SIDEKICK MODEL="openhands/minimax-m2.7" | | | uv run python fusion harness example.py "Find and fix the failing tests in this repo." | | | What this demonstrates: | | | - the main agent keeps one high-capability LLM profile for the whole task | | | - the cheap sidekick is registered as a sub-agent with its own LLM profile | | | - the main agent can issue several task-tool calls in one response | | | - tool concurrency limit lets those sidekick calls run concurrently | | | - sidekick returns ESCALATE TO MAIN when work exceeds its budget | | | """ | | | from future import annotations | | | import os | | | import sys | | | import tempfile | | | from pathlib import Path | | | from pydantic import SecretStr | | | from openhands.sdk import Agent, AgentContext, Conversation, LLM, LLMProfileStore, Tool | | | from openhands.sdk.context import Skill | | | from openhands.sdk.subagent import register agent | | | from openhands.sdk.subagent.schema import AgentDefinition | | | from openhands.tools.delegate import DelegationVisualizer | | | from openhands.tools.file editor import FileEditorTool | | | from openhands.tools.task import TaskToolSet | | | from openhands.tools.terminal import TerminalTool | | | DEFAULT MAIN MODEL = "openhands/gpt-5.5" | | | DEFAULT SIDEKICK MODEL = "openhands/minimax-m2.7" | | | SIDEKICK SKILL = """ | | | You are a fast, low-cost sidekick agent. Your job is to help the main agent, | | | not to complete the whole user request on your own. | | | Rules: | | | 1. Prefer read-only investigation: inspect files, locate relevant code, propose | | | small plans, and draft patch sketches. Do not edit files unless the prompt | | | explicitly asks you to. | | | 2. Keep output compact and structured. Use at most three tool calls unless the | | | prompt explicitly allows more. Prefer broad signals over exhaustive reading. | | | 3. If the task requires broad architecture decisions, many-file edits, unknown | | | product judgement, security-sensitive changes, or you are not confident, | | | stop and return exactly: | | | ESCALATE TO MAIN: