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.3

Permissions in 0.2.3

  • 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.Read, once, the accounts the previous Codex provider keptPlaces: its own data folder

Files

children.ts2.5 KB
// What the Codex provider keeps about a subagent: its task, filled from its
// spawn call and its own thread record.

import type * as wire from "./wire.ts";
import type { Child, Facts } from "./types.ts";
import * as map from "./map.ts";

/// Moves a subagent's task to `status`, stamping the end of its work.
/// Returns whether anything changed.
export function setStatus(child: Child, status: import("divergence/protocol").TaskStatus) {
  if (child.task.status === status) return false;
  child.task.status = status;
  if (map.isLive(status)) {
    delete child.task.endedAt;
  } else {
    delete child.task.activity;
    child.task.endedAt = new Date().toISOString();
  }
  return true;
}

/// The thread that started a subagent.
export function parentOf(child: Child) {
  return child.task.parentTaskId ?? child.root;
}

/// What a subagent's own thread record says about it.
export function factsOfThread(thread: wire.Thread | null | undefined): Facts {
  const created =
    typeof thread?.createdAt === "number" && thread.createdAt > 0 ? map.timestamp(thread.createdAt) : null;
  return {
    prompt: typeof thread?.preview === "string" && thread.preview.trim() ? thread.preview : null,
    taskName: map.threadTaskName(thread),
    name: map.threadNickname(thread) ?? map.threadRole(thread),
    model: typeof thread?.model === "string" ? thread.model : null,
    effort: typeof thread?.reasoningEffort === "string" ? thread.reasoningEffort : null,
    startedAt: created,
  };
}

/// Adds what is known about a subagent to its snapshot. Every field fills
/// only what the snapshot does not have yet, except the name, which a
/// later `thread/started` knows better than a spawn path.
export function applyFacts(facts: Facts, child: Child) {
  const task = child.task;
  const fill = (key: "toolCallId" | "prompt" | "model" | "effort", value: string | null | undefined) => {
    if ((task[key] === undefined || task[key] === null) && typeof value === "string" && value) task[key] = value;
  };
  fill("toolCallId", facts.toolCallId);
  fill("prompt", facts.prompt);
  fill("model", facts.model);
  fill("effort", facts.effort);
  if (!child.taskName && typeof facts.taskName === "string" && facts.taskName) child.taskName = facts.taskName;
  if (typeof facts.name === "string" && facts.name) task.name = facts.name;
  if (facts.startedAt) {
    task.startedAt =
      task.startedAt && Date.parse(task.startedAt) <= Date.parse(facts.startedAt) ? task.startedAt : facts.startedAt;
  }
  task.title = map.taskTitle(task.prompt ?? null, child.taskName, task.name ?? null);
}

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.