Skip to content
OAR Unifies 14 Coding Agent Runtimes with One API, Adopted by DeepSeek Harness

OAR Unifies 14 Coding Agent Runtimes with One API, Adopted by DeepSeek Harness

OAR (Open Agent Runtime) is an open-source library that provides a unified API to integrate and manage 14 different coding agent runtimes including Claude Code, Codex, and DeepSeek Harness, handling session management, unified event streaming, and runtime control, and has been adopted by DeepSeek Harness for delegating tasks to external agents.

SmartApe AI
SmartApe AI
SmartApe AI

Problem: Fragmented Agent Integration

Developers building AI-powered products often need to integrate multiple coding agents (e.g., Claude Code, Codex, DeepSeek Harness). Each agent runtime (or "Harness") has its own startup method, parameter configuration, session management, event format, and task control mechanism. Integrating a few agents is manageable, but supporting ten or more leads to significant code duplication and maintenance burden.

Solution: OAR (Open Agent Runtime)

OAR is an open-source programming interface library developed by former Kimi developer xxchan (now at Raft). It provides a single API to call and manage different agent harnesses, eliminating the need to reimplement integration logic for each tool. The project has been adopted by DeepSeek Harness, which now includes two experimental components ( subagent-oar and tool-subagent-oar) allowing DeepSeek Harness to delegate tasks to external agents like Claude Code and Codex.

Supported Runtimes

As of writing, OAR adapts 14 runtimes: Antigravity, Claude Code, CodeBuddy Code, Codex, Cursor, DeepSeek Harness, Devin, Factory Droid, Grok Build, Kimi Code, OpenCode, Pi, Qoder, and Qwen Code. For each runtime, OAR maintains dedicated adapter logic that handles the underlying differences in startup, configuration, session management, and event formats.

Core Abstractions

Runtime Registry

Developers select a runtime via defaultRuntimes (e.g., defaultRuntimes.require("claude")) and obtain an installation object. The same application logic can then be reused across runtimes by simply swapping the runtime identifier.

Session Management

A Session represents a continuous working session with an agent: the user assigns a task, the agent reads files, calls tools, executes commands over multiple turns. OAR unifies session creation, management, and resumption (when the underlying runtime permits). The example below shows creating a Claude Code session with model "sonnet" and working directory set to the current process directory.

Unified Event Stream

Agents often work for minutes before returning a final answer, making it hard to observe intermediate steps. OAR converts all agent outputs — text deltas, tool calls, execution progress, task completion, errors — into structured events. Each event carries a sequence number and an agentPath array (empty for the root agent) to distinguish events from sub-agents. Crucially, OAR also preserves the raw event data from the underlying runtime, enabling both high-level UI construction (chat windows, timelines) and low-level analysis of actual runtime behavior.

Control Operations

Beyond observation, OAR lets developers control a running agent: append instructions to adjust the current task, queue the next instruction, retract unexecuted input, or abort the task. Since runtimes differ in supported operations, OAR explicitly returns whether an operation was accepted and provides error details when unsupported.

Bidirectional Tool Calling

OAR enables not only the application layer to invoke different agents, but also agents to invoke other agents and to use tools provided by the application layer. This turns previously isolated agents into interchangeable execution units under a unified runtime layer.

Usage Examples

TypeScript Library

Requires Node.js 24+. Install with npm install @botiverse/oar. The following snippet demonstrates creating a session, subscribing to events, sending a prompt with a timeout, delivering an additional instruction, and resuming the session later:

import { defaultRuntimes, promptAndWait } from "@botiverse/oar";

const claude = defaultRuntimes.require("claude");
const installation = await claude.installation?.();
if (installation?.kind !== "available") throw new Error("claude is not installed");

const session = await claude.session(installation, { cwd: process.cwd(), model: "sonnet" });

session.events((event) => {
  // Each event indicates which agent it came from: empty array `[]` means root agent.
  if (event.kind === "text_delta" && event.agentPath.length === 0) process.stdout.write(event.text);
  if (event.kind === "tool_call_started") console.log(event.tool);
});

const run = promptAndWait(session, "Find and fix the flaky test", { timeoutMs: 600_000 });
// When user appends an instruction, OAR first tries to adjust the agent's current task;
// if the underlying runtime doesn't support that, it queues the instruction for later execution.
await session.deliver("Leave the snapshots alone.");
console.log(await run);
await session.dispose();

// Even from another process, the same conversation can be resumed.
const resumed = await claude.session(installation, { cwd: process.cwd(), resume: session.id });

Switching to Codex only requires changing the runtime identifier; the main calling logic remains identical.

CLI

OAR also provides a standalone CLI for running agent tasks and recording execution traces:

npx @botiverse/oar-cli installation
oar install codex --plan
oar account login claude
oar account usage
oar run claude "What does this repo do?" --record run.jsonl

DeepSeek Harness Integration

DeepSeek Harness (DSH) officially includes two experimental components — subagent-oar and tool-subagent-oar — that work together to let DSH invoke configured external agents via OAR. This demonstrates OAR's viability as a cross-agent interoperability layer.

OAR architecture diagram
OAR architecture diagram
DeepSeek Harness integration with OAR
DeepSeek Harness integration with OAR
Supported 14 agent runtimes
Supported 14 agent runtimes
OAR unified interface illustration
OAR unified interface illustration
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Codexunified APIClaude Codecoding agentsagent integrationOARDeepSeek HarnessOpen Agent Runtime
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.