Skip to content

Quick Migration Guide

Terminal window
npm install open-agent-sdk@alpha

Create a minimal parity test that runs your most common task end-to-end.

  • Replace your current session creation with createSession()
  • Replace resume/fork semantics with resumeSession() / forkSession()
  • Keep message streaming behavior under integration tests
  • Start with permissionMode: 'default'
  • Port custom allow/deny rules into canUseTool
  • Only use bypassPermissions where you can guarantee runtime safety
  • Codex OAuth: run codex login, then set provider: 'codex'
  • OpenAI: set provider: 'openai' and OPENAI_API_KEY
  • Google: set provider: 'google' and GEMINI_API_KEY
  • Anthropic: set provider: 'anthropic' and ANTHROPIC_API_KEY

If you used custom compatible endpoints, set baseURL explicitly.

Use exported types for options/results/tool IO instead of local ad-hoc interfaces.

Recommended smoke checks before full rollout:

  • one prompt path
  • one session resume path
  • one fork path
  • one sensitive tool permission denial path
  • one structured output path
import { createSession } from 'open-agent-sdk';
const session = await createSession({
model: 'gpt-5.4',
provider: 'codex',
permissionMode: 'default',
});
await session.send('Inspect repository and propose next steps.');
for await (const event of session.stream()) {
// consume output
}