What you are migrating

OpenAI's official Agents SDK path is Python and TypeScript. Autohand supports those same host languages and also gives native SDKs for Go, Java, Swift, Rust, C++, C#, and Ruby. That removes the extra service boundary when your backend, desktop app, or internal platform is not Python or Node.

Existing OpenAI appUse this Autohand pathWhy
TypeScript app using Agent and run()@autohandai/agent-sdk with Agent and RunClosest match for Node, Bun, CLIs, dashboards, and web backends.
Python app using Agent and Runnerautohand-sdk with AutohandSDKClosest match for async Python services and automation.
App that uses OpenAI tools for file, shell, or repo workAutohand's CLI-backed tool and permission runtimeThe code-agent operations live in the local Autohand runtime instead of custom function-tool glue.

Install the target SDK

Autohand SDKs call the local Autohand Code CLI over JSON-RPC. Install the SDK in your app, then configure the CLI once for the developer machine, CI runner, or deployment user.

TypeScript

Python

API mapping

OpenAI separates agent definition from runner execution. Autohand keeps that split, but the agent session is attached to a real workspace and emits code-agent events from the CLI runtime.

OpenAI Agents SDKAutohand TypeScriptAutohand PythonHow to port it
new Agent(...) / Agent(...)Agent.create(...)AutohandSDK(...)Move name/instructions into Autohand instructions and set the workspace with cwd.
run(agent, input)agent.run(input)sdk.stream_prompt(input)Use one-shot result handling when the app does not need progress events.
Runner.run(agent, input)agent.run(input)AutohandSDK.stream_prompt(input)Autohand does not need a separate runner object in application code.
run(..., { stream: true }) / Runner.run_streamed()agent.send(), run.stream()async for event in sdk.stream_prompt(...)Map raw model deltas to Autohand runtime events.
Function toolsBuilt-in code tools, MCP servers, hooksBuilt-in code tools, MCP servers, hooksMove repository side effects to Autohand's file, shell, git, and MCP runtime.
Guardrails and human reviewpermissionMode, permission_request, validationpermission_mode, permission_request, validationUse permissions for side effects and keep app-level validation around inputs and final outputs.
finalOutput / final_outputresult.text, run.json()Accumulated message_update text plus app validationUse text for user output and JSON validation for application contracts.
conversation_id, previous_response_id, sessionLive Agent, persistSession, sessionId, resumeLive AutohandSDK context and session configKeep the SDK session open for a user workflow. Persist only when work crosses process boundaries.

TypeScript port

Replace OpenAI's `run(agent, input)` call with an Autohand `Agent`. Autohand creation is async because it starts a CLI-backed session.

Before: OpenAI Agents SDK

After: Autohand Code Agent SDK

Python port

Replace OpenAI's `Runner.run()` with an Autohand async client. Stream `message_update` events for the UI and respond to `permission_request` when the runtime pauses before an edit or command.

Before: OpenAI Agents SDK

After: Autohand Code Agent SDK

Streaming and tools

OpenAI streaming is usually centered on model output and tool calls. Autohand streaming gives you the whole code-agent execution path: assistant text, tool starts, tool completions, approval pauses, file changes, and errors.

TypeScript

Python

Guardrails, permissions, and output

Keep OpenAI-style input and output guardrails as application validation. Move side-effect control to Autohand permissions. That means edits, shell commands, and other workspace actions can pause in your product before they run.

  • Use `permissionMode: 'interactive'` or `permission_mode="interactive"` during migration.
  • Log `permission_request` events and decide which tools or command patterns can run unattended.
  • Use `agent.runJson()` or `run.json()` in TypeScript for typed output contracts.
  • Use Pydantic or your existing Python validation around streamed final text for Python output contracts.

Native language upgrade

OpenAI's official Agents SDK is centered on Python and TypeScript. Autohand supports both, then adds native packages for Go, Java, Swift, Rust, C++, C#, and Ruby. If your product is a Go service, JVM backend, Swift desktop app, Rust CLI, .NET platform, C++ tool, or Rails app, migrate to the native Autohand package instead of adding a Python or Node sidecar.

  • TypeScript and Python for direct OpenAI SDK replacements.
  • Go, Java, Swift, and Rust for native host integrations.
  • Ruby, C#, and C++ packages use the same CLI-backed model for teams already committed to those stacks.

Cutover checklist

  • Pick the Autohand package for the host runtime, not just the old OpenAI SDK language.
  • Move agent instructions and workspace path into Autohand configuration.
  • Replace `run()` or `Runner.run()` with `agent.run()` in TypeScript or `sdk.stream_prompt()` in Python.
  • Move repository side effects out of custom function tools and into Autohand's runtime tools, MCP servers, and permissions.
  • Keep guardrail logic as explicit validation before prompts and after final output.
  • Add tests for streaming text, permission pauses, denied commands, JSON parsing, aborts, and session continuation.

Source context: OpenAI Agents SDK guide, OpenAI TypeScript running agents, OpenAI Python running agents, and the Autohand TypeScript API reference.