Official

codex

Codex agent provider: runs the Codex CLI's app-server for each account.

The app opens the listing; nothing installs until an agent in your Plugins workspace has read the files and you enable the plugin. In a terminal: dvg install divergence/codex@0.2.5

Permissions in 0.2.5

  • Provide agents agents.provideMediumAdds agents to the app.Provide the Codex agent and pass its tool calls to plugin tools
  • Run named programs processMediumStarts the listed programs.Run the Codex CLI, and ask or tell the installer that owns it (npm or Homebrew) about a newer versionPrograms: codexnpmbrew
  • Environment variables envMediumReads the listed environment variables.Find each account's Codex home, and pass extra app-server arguments set in CODEX_ARGSVariables: HOMECODEX_HOMECODEX_ARGS
  • Read files fs.readMediumReads files in the listed places.Notice a conversation started in the Codex app or CLI, so it shows up at once, and read, once, the accounts the previous Codex provider keptPlaces: its own data folder~/.codex/sessions~/.codex/sessions/**~/.codex*/sessions~/.codex*/sessions/**

Files

errors.ts2.1 KB
// What the app-server's error replies mean for the Codex provider.

import * as z from "zod";
import { TransportFailed } from "../sdk/effect.ts";
import { RpcError } from "../sdk/jsonrpc.ts";
import { ProviderError, errorMessage } from "../sdk/errors.ts";

// These native JSON-RPC validation/precondition replies prove no admission.
// INTERNAL_ERROR is also used for locally lost writes/timeouts: never replay it.
export function nativeRejection(error: unknown) {
  const wrapped = z.object({ cause: z.unknown() }).safeParse(error);
  const cause = wrapped.success ? wrapped.data.cause : null;
  return cause instanceof RpcError && [-32600, -32601, -32602].includes(cause.code);
}

/// Codex has neither a record of `thread` nor the thread loaded.
export function threadGone(thread: string, error: unknown) {
  return (
    error instanceof TransportFailed &&
    error.cause instanceof RpcError &&
    error.cause.code === -32600 &&
    error.cause.message === `thread/read failed: thread not loaded: ${thread}`
  );
}

/// Why `thread/resume` of `thread` failed. Another program writing the
/// thread is a state the user can end, so it is said in their words.
export function resumeFailure(thread: string, error: unknown) {
  if (
    error instanceof TransportFailed &&
    error.cause instanceof RpcError &&
    error.cause.message.endsWith(`thread ${thread} already has an active writer`)
  )
    return new ProviderError({
      message:
        "Another Codex program, such as the Codex app or the CLI, has this conversation open, and Codex lets only one program continue a conversation at a time. Close it there, then send again.",
    });
  return new ProviderError({ message: `thread/resume failed: ${errorMessage(error)}` });
}

/// A newly started thread has no native turns until its first user message.
export function threadUnmaterialized(thread: string, error: unknown) {
  return error instanceof TransportFailed && error.cause instanceof RpcError && error.cause.code === -32600 &&
    error.cause.message === `thread/turns/list failed: thread ${thread} is not materialized yet; thread/turns/list is unavailable before first user message`;
}

Versions

VersionPublishedPlugin APISizePermissionsStatus
0.2.5latestNov 21, 2026>=5 <6121.1 KB4 permissionsListed
0.2.4Nov 16, 2026>=5 <6120.2 KB4 permissionsListed
0.2.3Nov 11, 2026>=5 <695.2 KB4 permissionsListed
0.2.2Nov 9, 2026>=5 <688.9 KB4 permissionsListed
0.2.1Oct 27, 2026>=2 <484.1 KB4 permissionsListed

Reviews and comments

0 threads · 0 reviews

No comments yet.