OpenProgram Docs

Harness Engines

A conversation can be run by an outside coding agent instead of OpenProgram's own agent loop. The agent makes the model calls and runs its own tools in its own sandbox; OpenProgram shows what it does, asks the person its approvals and keeps the record.

The engines are Codex, Claude Code, DeepSeek Harness, Gemini CLI and Hermes (over ACP), Cursor's cursor-agent, and the Antigravity app; other ACP agents follow the same shape.

The person's messages reach the agent as typed. Messages that came through a channel, the owner's there included, keep OpenProgram's speaker envelope, so the agent can tell who spoke and no one passes for the owner; the agent's own app shows those as the envelope.

Chat turn admission, run slot Agent loop Harness: OpenProgram Codex engine Harness: Codex codex app-server one per conversation JSON-RPC same frames, cards, record
PartWhere
Hand-overTop of run_loop_blocking in runtime/conversation/turn_runtime/loop_runner.py; engines in openprogram/runtime/harnesses/__init__.py
Codexruntime/harnesses/codex/client.py (process and JSON-RPC), engine.py (one turn), items.py (cards)
Threads and handoffruntime/harnesses/handoff.py
Approvalsruntime/permissions/approvals/live.py
Listingruntime/harnesses/models.py, GET /api/harnesses; read as the Worker starts, and an old reading is answered at once and read again behind it
Webapps/web/components/chat/top-bar/menus/harness-menu.tsx, lib/models/harnesses.ts, lib/agents/session-harness.ts
Models through OpenProgramModel Gateway

Decisions and the peers they come from

QuestionT3 CodePaseoOpenProgram
Where the harness is chosenModel picker, by provider instanceCombined provider and model pickerIts own Harness chip before the model chip: a harness changes models, efforts, permission modes, tools and agents together, and every harness has agent-like settings of its own
Which CodexSetting, default codex on PATH; models are what that CLI lists, and newer ones show as needing an updateThe PATH lookup, with the desktop app taking the login shell's environmentTheirs: the user's own Codex (setting, PATH, login shell) and the models it lists; T3's update rows, from a model manifest kept in this repository
ProcessOne shared app-serverOne per agent; starts queued per Codex home and retriedOne per conversation, closed when its turn ends (the Codex app refuses a thread another app has open), starts serialised per CODEX_HOME and retried on the SQLite start error
SessionNative ids reusedNative ids reused; importNative ids reused, per branch; codex resume <id> continues it
Events26 item types, losslessSmaller timelineT3's item model mapped onto OpenProgram's existing cards
Permission modesNative, never emulatedNative per providerT3's rule: Codex's own four modes
Switching enginePortable handoffNot supportedT3's handoff of the turns the thread did not see

The chips

ChipOpenProgramCodex
HarnessDefaultOpenProgram shows its small mark (Brand marks in the icons page); Claude Code shows Claude's mark. Shown with its version; greyed with Not Installed, Would Not Start, Not Signed In or No Models on the conversation's machine, as the server refuses it. The listing is read again when the server says a harness was read
ModelUnchangedCodex's own models; when a newer Codex is out, the models only it lists (dimmed) and Update Codex; then Through OpenProgram with the provider rows (openprogram:<provider>/<model>)
EffortUnchangedThe model's supportedReasoningEfforts
AgentUnchangedDefault, the [profiles.*] of Codex's config, and personalities where the model supports them
PermissionUnchangedRead Only (untrusted, read-only sandbox), Ask for Approval (on-request, workspace-write), Auto (on-request with auto review), Full Access (never, full access); Plan is hidden and runs as Read Only
PointRule
Claude CodeModel lists its own aliases; a full id from a synced transcript shows as its alias. Through OpenProgram: --settings with a gateway file. Agent lists Default and its named agents. Permission offers Bypass permissions, Auto, Accept edits, Ask and Plan; approving its plan puts the menu back on the mode before Plan, as OpenProgram's own plan mode does.
DeepSeek HarnessModel lists its session's models without the provider prefix. No Through OpenProgram. Permission offers Full access and Ask.
Gemini CLIModel lists its session's models once a turn has seen them, Default before. No Through OpenProgram and no effort. Permission offers Full access and Ask.
EffortA harness model that lists no effort levels shows no effort control and is sent none. Before the harness is first read, the control waits; the reading refreshes every conversation's settings. Codex and DeepSeek Harness keep an effort with the thread, so Auto sends the model's default level; Codex's Default agent likewise sends the personality its config.toml sets.
OptionsWeb search and Sandbox are not offered, and the Options tip names only files: the agent searches and runs commands its own way. With Unattended on, a question the agent asks is answered that no one is there.
ChipsThe Agent chip carries the Agent icon; the harness's mark stays on the Harness chip. It names only a choice the model takes, and Default and Codex's personalities in the interface language. On a phone, the conversation's settings menu has a Harness row.
CardsClaude Code's tools show under the names OpenProgram's own take the same arguments under: Bash as a command, Edit as an edit, TodoWrite as a checklist. Approving its plan shows the plan as written.

The harness is a run setting of the branch beside model, effort and permission. Switching to Codex takes its default model and agent and remembers the OpenProgram model and effort; switching back restores them.

One Codex turn

CodexOpenProgram
agentMessage deltas, reasoning deltasText and thinking stream events
commandExecutionbash card, output as its result
fileChangeapply_patch card with a patch built from the diffs
webSearch, mcpToolCallProvider-run web_search; mcp__<server>__<tool>
turn/plan/updatedtodo_write checklist
thread/tokenUsage/updatedContext meter; not added to Token Usage, since the Third-Party Harnesses page already counts Codex's calls from its own files
Approval requestsA live wait shown as the usual question card; Allow → accept, for the chat → acceptForSession, Deny → decline. A request for more access (network, folders) is asked the same way; Codex's own questions go on the question card and answer by question id. Requests with no card are declined, so a turn never hangs
Stop, steeringturn/interrupt (queued if the turn id is not known yet); steers taken from the execution and sent with turn/steer

The events go through the same stream tap as the agent loop's, so a reload shows the turn, and a channel that relays questions relays Codex's approvals too.

An approval card shows the agent's reason above what it asks. For a Codex patch it also names the folder that allowing it for the chat opens for writing. When the agent stops, or settles a request itself (an interrupt in the Codex app, a request Claude Code withdraws), the card is taken back.

Threads, machines and switching

PointRule
MachineThe engine runs on the conversation's machine, with that machine's Codex and sign-in; a paired machine's list comes from that machine. The Environment and Channel chips do not change.
Which CodexThe one the user installed: harnesses.codex.binary when set, else codex on PATH, else what the login shell finds. Codex lists only the models its version can run, so updating Codex brings its newest models.
FolderEach turn/start carries the conversation's current folder.
BranchEach branch keeps its own Codex thread and the id of the last message it saw.
HandoffWhen a thread starts on a conversation with history, or resumes after turns it did not run, it first gets those turns as a budgeted transcript, newest kept. Switching back to OpenProgram needs nothing: Codex's turns are stored as ordinary messages and tool calls.
CrashA process that exits fails the running turn; the next turn starts a process and resumes the thread. A second turn while one runs gets a process of its own, closed when it ends; the kept process then reloads the thread before its next turn.
Keeping it currentHow
Newest versionnpm for an npm, bun or pnpm install, else OpenAI's release channel; read hourly (runtime/harnesses/codex/maintenance.py)
Models it would bringThose in model-manifest.json the installed Codex does not list. Bundled, refreshed hourly from this repository's main; add a model there when Codex ships one
UpdateThe installer the file belongs to: npm/bun/pnpm global add of @openai/codex@latest, brew upgrade [--cask] codex, mise upgrade codex or codex update. Any other install shows the models without the Update row

DeepSeek Harness over ACP

DeepSeek Harness is the second engine (runtime/harnesses/deepseek/). It is driven as an Agent Client Protocol client: dsh --profile acp, one process per conversation, the same line protocol and process pool as Codex, closed when its turn ends: a running one holds the session's session.lock, which keeps the app from writing it.

Its sessions are saved with the DeepSeek Harness app's own and use the app's sign-in.

When the person's own dsh is on OpenProgram's gateway, each process is started with a --patch overlay holding their own llm-pi-ai routes, start model and web-search rows, read from the gateway's stash (web search as dsh ships it where they had none of their own).

A model on OpenProgram's routes is never offered or picked: these chats never go through the gateway.

ACPOpenProgram
Harness chipDeepSeek Harness with its app version; Not Installed without the app or dsh, Not Signed In without saved credentials of its own (OpenProgram's gateway key in its key store does not count)
Model, EffortWhat a session's configOptions offer (model, reasoning_effort), set per turn with session/set_config_option. A model is <provider>:<model>; an effort the session lacks becomes the nearest it has. The list is read once from a session opened and removed again, then from each turn's session
agent_thought_chunk, agent_message_chunkThinking and text; each message is a passage of its own
tool_call, tool_call_updateA card named by the tool, its rawInput as input and its content as result
usage_updateContext meter
session/request_permissionFull Access allows it; any other mode asks with the usual question card (Allow → allow-once, Deny → reject-once)
Stopsession/cancel, sent once the prompt is out; the process is stopped when the turn does not end within a few seconds
ErrorsA failed prompt is the turn's error with DeepSeek's message (an empty balance reads as a rate limit)
PointRule
BranchKeeps its session id, folder, the last message the session saw and the ids of the messages it wrote here.
New branchACP has no fork, so it starts a session with the handoff transcript, as does a session that no longer resumes. A session resumes only in the folder it was made in.
In the appSessions started here are saved by DeepSeek Harness but not listed in its app, which lists only those its own workspaces made.
ImagesSent as image blocks when DeepSeek Harness says at initialize that it reads them. Otherwise the message says how many images could not be passed on, so the agent can tell the person.

Gemini CLI over ACP

Google's Gemini CLI runs the turn in its own ACP mode (runtime/harnesses/gemini_cli/): gemini --acp, the interface Google documents for editors, with DeepSeek Harness's ACP client and turn. Gemini CLI signs in and calls Gemini itself; OpenProgram never reads its credentials, calls Google's endpoints for it or scrapes its terminal output.

ACPOpenProgram
Which Gemini CLIGEMINI_CLI_BINARY, else gemini on PATH or in the login shell; started with the folders of gemini and node on its PATH. Its version is read from its npm package without starting it
Sign-inThe person's own setup always wins: an auth type chosen in any settings layer (a key its /auth dialog saved included) or their GEMINI_API_KEY (environment or ~/.gemini/.env). With neither, the Google API key in Model Services goes in as GEMINI_API_KEY. A key with no auth type chosen also gets a system-defaults file of OpenProgram's (GEMINI_CLI_SYSTEM_DEFAULTS_PATH, existing defaults kept) choosing gemini-api-key. Checked at every turn
ProcessOne per conversation branch, closed when its turn ends, so the person's own gemini can go on with the session
Sessionsession/new, reopened with session/load in the folder it was made in; the history it replays is dropped. A session that no longer loads starts another with the handoff. A turn that fails once its prompt was sent leaves the message in the session, which records it as the prompt starts
ModelThe models its sessions offer, set with session/set_model. Only a session lists them, and opening one for the listing would write into the person's ~/.gemini and start their MCP servers, so the listing starts no process: Default (its own choice) until a turn has seen the models, which are kept across restarts. No effort levels
tool_call, tool_call_updateA card named by its title, the files it touches as input, its text and the files it changed as result. A permission request that comes before its tool_call opens the card
session/request_permissionAs DeepSeek Harness's: Full Access allows (proceed_once), Ask asks; Deny is cancel. Always-allow options are not offered
Usageusage_update for the context meter; the prompt's usage for the turn's tokens
ErrorsA missing sign-in reads as one and says how to sign in (gemini in a terminal, or a Google API key); a rate limit reads as a rate limit
PointRule
Why a defaults fileIts ACP server loads a saved session only with an auth type chosen. ACP authenticate would write the choice into the person's ~/.gemini/settings.json (and clear a cached Google login when it switches), so it is not used; the lowest settings layer chooses it instead, and the person's own files stay as they are.
ReplayFrom 0.71 the replay comes before the load's answer, earlier after it. The prompt waits until updates are quiet a moment, and the person's messages and finished tool calls, which only a replay sends, are dropped.
Terminal on the gatewayWhile the terminal's Gemini CLI is on OpenProgram's gateway (Model Gateway), chats here keep the person's earlier setup: the process gets their own base URL and key back, and a system-settings file of OpenProgram's (GEMINI_CLI_SYSTEM_SETTINGS_PATH) puts back their auth type and model.
Its own conversationsGemini CLI documents where it saves sessions but not their format, so they are not synced here.

The Antigravity app

A chat on Antigravity is answered by the person's own Antigravity app (runtime/harnesses/antigravity/), through the local server the app runs for its own agents. The app signs in and calls its models itself; OpenProgram reads none of its credentials.

PointRule
The app's serverIts address and token from ~/.gemini/antigravity/daemon/hub_<port>.json (a live process only); Connect JSON posts with the token in x-antigravity-csrf-token. A closed app is opened in the background
SendingA new conversation: an empty one from ConversationService/CreateConversation, whose prompt takes no pictures. Every message, the first with the handoff: SendUserCascadeMessage, written as the person's own; the agentapi send-message command writes a system note instead, so it is not used
PicturesSaved in the conversation's .user_uploaded folder and named in the message's media, as the app keeps its own; inline data is accepted and never reaches the model
The replyRead from the conversation's transcript as the app writes it, step by step: thinking and text as frames, calls as cards under OpenProgram's tool names, each result paired in order. A reply with no call ends the turn; the app's error message fails it
StopCancelCascadeInvocation; open cards end as stopped
Kept apartEach turn run here is kept by the step of the person's message (step:<n>), so the sync does not write it twice; turns made in the app later come to the conversation that started it
ModelA new conversation starts on Flash, Pro or Flash Lite; a synced one goes on with the model the app has
PermissionThe app's own setting (GetPermissionSettings) applies to every conversation: a message's permissionsConfig or preset override was tried and is not applied. The menu shows the one choice, As set in Antigravity

Cursor and Hermes

Both run in the person's own install with its own sign-in, as magpie resumes them.

PointRule
CursorA turn is cursor-agent -p --output-format stream-json --resume <chat> in the chat's folder (runtime/harnesses/cursor/); a new conversation first makes a chat with create-chat. Its lines become frames and cards under OpenProgram's tool names. Only its own chats: the editor's cannot be resumed by it
Cursor's permission and sign-inFull access adds --force; otherwise a command it may not run is refused, and the card says so. Without a sign-in (no CURSOR_API_KEY, keychain item or saved login, values never read) the turn says to run cursor-agent login. Stop ends its process. Pictures are not passed on, and the message says so
Hermeshermes acp (runtime/harnesses/hermes/), with DeepSeek Harness's ACP turn. A saved conversation reopens with session/load, which also restores one from state.db after a restart; session/resume would start a new one silently for an unknown id. Its permission requests are answered as DeepSeek Harness's. Pictures go when its initialize says it reads them
Kept apartCursor's turns by the id of the person's message in the chat's store.db, Hermes's by its row in state.db, so the sync writes neither twice

Claude Code

The person's own Claude Code runs the turn (runtime/harnesses/claude_code/): claude -p in stream-JSON mode, the protocol Anthropic's Agent SDK speaks to it. Claude Code signs in and calls the model itself; OpenProgram never reads its credentials or calls Anthropic for it.

Without a sign-in of its own, it is started with the Anthropic API key set in Model Services, billed to that API account. This is checked at every turn: after a claude auth login, or when the key changes, the conversation's Claude Code starts again without it or with the new one.

QuestionT3 CodePaseomagpieOpenProgram
Way inAgent SDKAgent SDKCLI stream-JSONCLI stream-JSON (no Node SDK in a Python server); the same messages and control requests
Which Claude Codeclaude on PATHclaude on PATHFound or downloadedOPENPROGRAM_CLAUDE_BINARY, the newest build the Claude app installed, ~/.claude/local, ~/.local/bin, PATH
Sign-inThe user's ownThe user's ownReads and switches loginsT3 and Paseo: the user's own; Not Signed In until claude auth login or an Anthropic API key in Model Services. The Claude app's own sign-in is never taken; a refused sign-in says how to sign in, not to check a key
ProcessOne per conversation, 2 idle minutesOne per agent, 60 idle minutesOne per callerOne per conversation branch, closed when its turn ends: a running one holds the session in ~/.claude/sessions, and the Claude app refuses a session another process holds; another session, folder or agent starts another
Model, effort, modesetModel, applyFlagSettings; restart for policySame, plus setPermissionModeSettings filePaseo's: all three change in the running process; started with full access allowed
Models, agentsManifest plus initializesupportedModels() plus manifestNot applicableThe initialize answer, which runs no turn: models, their efforts, and agents for the Agent chip (--agent)
ThinkingAdaptive, summarisedAdaptive, summarisedNot applicableThe same
SessionsessionId, resume, fork at a messageSame; fork only for rewindclaude --resume in a terminal--session-id, --resume from the session's folder; a new branch forks with --fork-session and gets the handoff
Permission promptOnce, for the session, deny, cancelSameNot applicableThe same as live waits; for the session adds Claude Code's own suggestions. Its questions (AskUserQuestion) show on OpenProgram's question card, and the answers go back as the tool's answers
Stop, steeringinterrupt, 10 s, then force; priority: nextSameNot applicableT3's
StreamPartial deltas, snapshots fill gaps; subagents apartSameNot applicablePartial deltas, snapshots for what did not stream; a subagent's steps stay in its tool card
Outside turnsRestart a live process the transcript moved pastManual reloadRe-reads changed filesT3's restart, after the app sync wrote them
PointRule
App threadsOnce an engine went on in an app's thread on one branch, the app's record of it is neither resumed nor forked by another branch; that branch starts a session with the handoff.
Two turns at onceA branch's process runs one turn. A second turn on the same branch gets a process of its own, closed when it ends; the kept process then resumes the session again.
ImagesAttached images go in with the message as image blocks.
Lost sessionWhen Claude Code says it has no such session, the turn starts a new one with the handoff, and later turns go on in it once it begins. Any other failure keeps the old session's record.
SteeringA message sent mid-turn may be answered as a turn of its own, and the turn waits for that one's result. A process that took steering is not reused, so nothing queued in it reaches a later turn.
EffortNo request unsets an effort, so going back to Claude Code's own default starts another process. A model change sets the effort again.
Written turnsThe person's message goes in with a uuid of its own. That uuid and the record uuids a turn writes are kept while it runs and when it fails, so the app sync never copies them back, even after a Stop. Claude Code's interruption note is not a message.
Unanswered messagesA DeepSeek Harness message stopped before any answer has no id. The sync skips such a message when the conversation here already shows it. An app's last unanswered message waits a minute for an answer, then is written as stopped.
Earlier readingsWhen an earlier reading counted turns this one does not, the sync finds the newest turn it wrote that the app still has and numbers new turns after it.
A process that endedA kept process that ended between turns is replaced, and the turn is sent to the new one.

The Codex app's conversations

Every conversation the person has in the Codex app or the Codex CLI is a conversation in OpenProgram too, mixed with OpenProgram's own and linked to the same Codex thread both ways (state/store/session/external_import/codex_sync.py).

QuestionDecisionFrom
Which threadsCodex's state database (state_<n>.sqlite, table threads): app and terminal threads that are not archived and have a user message; exec, MCP and subagent threads are left out. Read again whenever the database changesmagpie, Paseo's import
Opening oneIts turns written as OpenProgram messages and tool cards; the conversation's harness is Codex with the thread's model, filed under its folder's project, made like an import's when there is none; a folder the app made for one chat or a temporary one stays in the default projectPaseo's import
Keep it in CodexThe next turn resumes the same thread (a shared thread record), so the app shows it; turns the app adds later arrive here. Turns OpenProgram ran are known by their Codex turn id and not written twice; a loaded thread the app moved on is reloaded firstT3 Code's native ids
Move it to OpenProgramSwitch its Harness chip to OpenProgram. What is said in the app later still arrives, after what was said hereT3 Code's handoff
The app's historyCodex lists and resumes a thread only on the provider it was saved with, so turning on Also in the Terminal moves the app's threads to the OpenProgram provider and turning it off moves them back; a single thread follows the model of the turn run on itmagpie's provider move
SidebarThe status dot and a channel's logo stay as they are; the agent's own logo at the row's end (Codex shows ChatGPT's, the app it now lives in) says the conversation runs in that agent now, and it gives way to the ⋯ button on hover. A hover card names the model and agent, the project, the time and the app a synced conversation is also in. OpenProgram's own conversations have no markT3 Code's provider mark
The Claude app and DeepSeek HarnessTheir conversations come in the same way (app_sync.py): the Claude app's Code tab list (claude-code-sessions/**/local_*.json, each naming a Claude Code transcript) and DeepSeek Harness's workspaces (~/.dsh, a zstd event log per conversation), archived ones left out. Conversations started with claude in a terminal come in too; those run through the SDK or claude -p stay out, as Codex's exec threads do. Each continues in its own session on its agent's enginePaseo's import
AntigravityThe Antigravity app's and its agy command's conversations come in too (antigravity.py, read as magpie reads them). Each continues in its own conversation in the app (Antigravity)magpie
Cursor and HermesCursor's agent chats (the editor's and cursor-agent's, cursor.py) and Hermes Agent's (hermes.py) come in the same way, read as magpie reads them. A cursor-agent chat and a Hermes conversation go on in their agent (Cursor and Hermes); an editor chat, which cursor-agent cannot resume, goes on in OpenProgram's ownmagpie
Kept apartA session an engine started or forked here is not imported as another conversation. A session with an engine turn running is read once the turn ends, and one still being written once it rests a few seconds. A rewind in the app leaves what is here unchanged. The app's later title replaces the first one unless the conversation was renamed hereCodex's own-turn ids
Where app turns goTurns made in DeepSeek Harness, Antigravity, Hermes or cursor-agent in a conversation its engine started here go to the conversation that holds it; a Claude Code fork, which starts with copies of turns already here, is not read. When another branch is shown, they follow the thread's own branch and the shown one staysCodex's started-here threads
History pageMixed with OpenProgram's chats, the same mark on each row, and a Source filter that appears once another agent has conversations hereT3 Code

Implementation status

Codex runs chats, natively or through OpenProgram's models, and the Codex app's conversations are synced both ways. DeepSeek Harness runs chats over ACP and its app's conversations continue in their sessions. Gemini CLI runs chats over ACP with its own sign-in or a Model Services key; checked against a stand-in ACP server, not yet against a signed-in Gemini CLI.

Claude Code runs chats with the person's own sign-in, and the Claude app's and terminal's conversations continue in their sessions.

Antigravity runs chats in the person's own app, checked against the signed-in app. Cursor's CLI and Hermes run chats, checked against stand-ins: cursor-agent is not signed in on the test computer and Hermes is not installed. Next, with the same engine shape: other ACP agents (OpenCode).

Last updated · 2026-11-30