Skip to content

The one and only agent harness for complex codebases. Project memory, planning, execution, and verified completion inside Codex.

chore: sync Codex marketplace v4.16.3

github-actions[bot]bb8764ca1754
diff --git a/plugins/omo/.codex-plugin/plugin.json b/plugins/omo/.codex-plugin/plugin.json
index c617280e..c60cc001 100644
--- a/plugins/omo/.codex-plugin/plugin.json
+++ b/plugins/omo/.codex-plugin/plugin.json
@@ -1,6 +1,6 @@
{
"name": "omo",
- "version": "4.16.2",
+ "version": "4.16.3",
"description": "One Codex plugin namespace for Yeongyu's local Codex components.",
"author": {
"name": "Yeongyu Kim",
diff --git a/plugins/omo/components/bootstrap/dist/cli.js b/plugins/omo/components/bootstrap/dist/cli.js
index a9ef996b..050b47ad 100755
--- a/plugins/omo/components/bootstrap/dist/cli.js
+++ b/plugins/omo/components/bootstrap/dist/cli.js
@@ -440,7 +440,7 @@ async function readOptionalFile(path) {
// components/bootstrap/src/worker.ts
import { appendFile as appendFile2, mkdir as mkdir8, readFile as readFile13 } from "node:fs/promises";
import { homedir as homedir4 } from "node:os";
-import { dirname as dirname8, join as join20, resolve as resolve7 } from "node:path";
+import { dirname as dirname9, join as join22, resolve as resolve7 } from "node:path";
import { fileURLToPath as fileURLToPath2 } from "node:url";
// components/bootstrap/src/provision.ts
@@ -864,211 +864,129 @@ async function defaultVersionProbe2(binaryPath) {
}
// components/bootstrap/src/setup.ts
-import { copyFile as copyFile2, mkdir as mkdir7, readdir as readdir4, rm as rm10, stat as stat5 } from "node:fs/promises";
-import { join as join19 } from "node:path";
+import { copyFile as copyFile2, mkdir as mkdir7, readdir as readdir5, rm as rm10, stat as stat5 } from "node:fs/promises";
+import { join as join21 } from "node:path";
// ../src/install/link-cached-plugin-agents.ts
-import { copyFile, lstat as lstat2, mkdir as mkdir4, readFile as readFile5, readdir, rm as rm6, writeFile as writeFile3 } from "node:fs/promises";
-import { basename as basename3, join as join9 } from "node:path";
+import { copyFile, lstat as lstat3, mkdir as mkdir4, readdir as readdir2, rm as rm6, writeFile as writeFile4 } from "node:fs/promises";
+import { basename as basename3, join as join10 } from "node:path";
-// ../src/install/retired-managed-agent-purge.ts
-import { lstat, readFile as readFile4, rm as rm5 } from "node:fs/promises";
+// ../src/install/preserved-agent-settings.ts
+import { lstat, readFile as readFile4, readdir, writeFile as writeFile3 } from "node:fs/promises";
import { join as join8 } from "node:path";
-var RETIRED_MANAGED_AGENT_FILES = [
- {
- fileName: "codex-ultrawork-reviewer.toml",
- requiredMarkers: [
- 'name = "codex-ultrawork-reviewer"',
- 'description = "Strict ultrawork verification reviewer.',
- 'developer_instructions = """You are the ultrawork verification reviewer.'
- ]
- }
-];
-async function purgeRetiredManagedAgentFiles(input) {
- const agentsDir = join8(input.codexHome, "agents");
- if (!await exists(agentsDir))
- return;
- for (const retiredAgent of RETIRED_MANAGED_AGENT_FILES) {
- const agentPath = join8(agentsDir, retiredAgent.fileName);
- if (!await exists(agentPath))
- continue;
- const agentStat = await lstat(agentPath);
- if (agentStat.isDirectory() && !agentStat.isSymbolicLink())
- continue;
- const content = await readTextIfExists(agentPath);
- if (content === null || !hasRequiredMarkers(content, retiredAgent.requiredMarkers))
- continue;
- await rm5(agentPath, { force: true });
- }
-}
-function hasRequiredMarkers(content, markers) {
- return markers.every((marker) => content.includes(marker));
-}
-async function readTextIfExists(path) {
- try {
- return await readFile4(path, "utf8");
- } catch (error) {
- if (nodeErrorCode(error) === "ENOENT")
- return null;
- throw error;
- }
-}
-async function exists(path) {
- try {
- await lstat(path);
- return true;
- } catch (error) {
- if (nodeErrorCode(error) !== "ENOENT")
- throw error;
- return false;
+
+// ../src/install/managed-agent-reasoning-defaults.ts
+var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
+ [
+ "explorer",
+ {
+ previous: { model: "gpt-5.4-mini", effort: "low" },
+ current: { model: "gpt-5.6-terra", effort: "medium" }
+ }
+ ],
+ [
+ "librarian",
+ {
+ previous: { model: "gpt-5.4-mini", effort: "low" },
+ current: { model: "gpt-5.6-terra", effort: "medium" }
+ }
+ ],
+ [
+ "momus",
+ {
+ previous: { model: "gpt-5.5", effort: "xhigh" },
+ current: { model: "gpt-5.6-sol", effort: "ultra" }
+ }
+ ]
+]);
+function resolveManagedAgentReasoning(input) {
+ const upgrade = MANAGED_REASONING_DEFAULT_UPGRADES.get(input.agentName);
+ if (upgrade !== undefined && input.preserved.model === upgrade.previous.model && input.preserved.effort === upgrade.previous.effort && input.bundledModel === upgrade.current.model && input.bundledEffort === upgrade.current.effort) {
+ return upgrade.current.effort;
}
-}
-function nodeErrorCode(error) {
- if (!(error instanceof Error) || !("code" in error))
- return null;
- return typeof error.code === "string" ? error.code : null;
+ return input.preserved.effort;
}
-// ../src/install/link-cached-plugin-agents.ts
-var MANIFEST_FILE = ".installed-agents.json";
+// ../src/install/preserved-agent-settings.ts
async function capturePreservedAgentReasoning(input) {
- const agentsDir = join9(input.codexHome, "agents");
- if (!await exists2(agentsDir))
+ const agentsDir = join8(input.codexHome, "agents");
+ if (!await exists(agentsDir))
return new Map;
const preserved = new Map;
const agentEntries = await readdir(agentsDir, { withFileTypes: true });
for (const entry of agentEntries) {
if (!entry.name.endsWith(".toml"))
continue;
- const content = await readTextIfExists2(join9(agentsDir, entry.name));
+ const content = await readTextIfExists(join8(agentsDir, entry.name));
if (content === null)
continue;
const effort = extractReasoningEffort(content);
- if (effort !== null)
- preserved.set(agentNameFromToml(entry.name), effort);
+ if (effort !== null) {
+ preserved.set(agentNameFromToml(entry.name), {
+ model: extractModel(content),
+ effort
+ });
+ }
}
return preserved;
}
async function capturePreservedAgentServiceTier(input) {
- const agentsDir = join9(input.codexHome, "agents");
- if (!await exists2(agentsDir))
+ const agentsDir = join8(input.codexHome, "agents");
+ if (!await exists(agentsDir))
return new Map;
const preserved = new Map;
const agentEntries = await readdir(agentsDir, { withFileTypes: true });
for (const entry of agentEntries) {
if (!entry.name.endsWith(".toml"))
continue;
- const content = await readTextIfExists2(join9(agentsDir, entry.name));
+ const content = await readTextIfExists(join8(agentsDir, entry.name));
if (content === null)
continue;
preserved.set(agentNameFromToml(entry.name), extractServiceTier(content));
}
return preserved;
}
-async function linkCachedPluginAgents(input) {
- const bundledAgents = await discoverBundledAgents(input.pluginRoot);
- await purgeRetiredManagedAgentFiles({ codexHome: input.codexHome });
- if (bundledAgents.length === 0) {
- await writeManifest(input.pluginRoot, []);
- return [];
- }
- const agentsDir = join9(input.codexHome, "agents");
- await mkdir4(agentsDir, { recursive: true });
- const linked = [];
- for (const agentPath of bundledAgents) {
- const agentFileName = basename3(agentPath);
- const agentName = agentNameFromToml(agentFileName);
- const linkPath = join9(agentsDir, agentFileName);
- await replaceWithCopy(linkPath, agentPath);
- await restorePreservedReasoning({
- agentName,
- linkPath,
- target: agentPath,
- value: input.preservedReasoning?.get(agentName)
- });
- await restorePreservedServiceTier({
- linkPath,
- preserved: input.preservedServiceTier?.has(agentName) ?? false,
- value: input.preservedServiceTier?.get(agentName) ?? null
- });
- linked.push({ name: agentFileName, path: linkPath, target: agentPath });
- }
- await writeManifest(input.pluginRoot, linked.map((entry) => entry.path));
- return linked;
-}
-async function restorePreservedServiceTier(input) {
- if (!input.preserved)
+async function restorePreservedReasoning(input) {
+ if (input.value === undefined)
return;
- const content = await readFile5(input.linkPath, "utf8");
- if (extractServiceTier(content) === input.value)
+ const content = await readFile4(input.target, "utf8");
+ const bundledEffort = extractReasoningEffort(content);
+ const effort = resolveManagedAgentReasoning({
+ agentName: input.agentName,
+ bundledModel: extractModel(content),
+ bundledEffort,
+ preserved: input.value
+ });
+ if (bundledEffort === effort)
return;
- const replacement = replaceServiceTier(content, input.value);
+ const replacement = replaceTopLevelStringSetting(content, "model_reasoning_effort", effort, { insertIfMissing: false });
if (!replacement.replaced)
return;
await writeFile3(input.linkPath, replacement.content);
}
-async function discoverBundledAgents(pluginRoot) {
- const componentsRoot = join9(pluginRoot, "components");
- if (!await exists2(componentsRoot))
- return [];
- const componentEntries = await readdir(componentsRoot, { withFileTypes: true });
- const agents = [];
- for (const entry of componentEntries) {
- if (!entry.isDirectory())
- continue;
- const agentsRoot = join9(componentsRoot, entry.name, "agents");
- if (!await exists2(agentsRoot))
- continue;
- const agentEntries = await readdir(agentsRoot, { withFileTypes: true });
- for (const file of agentEntries) {
- if (!file.isFile() || !file.name.endsWith(".toml"))
- continue;
- agents.push(join9(agentsRoot, file.name));
- }
- }
- agents.sort();
- return agents;
-}
-async function replaceWithCopy(linkPath, target) {
- await prepareReplacement(linkPath);
- await copyFile(target, linkPath);
-}
-async function prepareReplacement(linkPath) {
- if (!await exists2(linkPath))
- return;
- const entryStat = await lstat2(linkPath);
- if (entryStat.isDirectory() && !entryStat.isSymbolicLink()) {
- throw new Error(`${linkPath} already exists and is a directory; refusing to replace`);
- }
- await rm6(linkPath, { force: true });
-}
-async function writeManifest(pluginRoot, agentPaths) {
- const manifestPath = join9(pluginRoot, MANIFEST_FILE);
- const payload = { agents: [...agentPaths].sort() };
- await writeFile3(manifestPath, `${JSON.stringify(payload, null, "\t")}
-`);
-}
-async function restorePreservedReasoning(input) {
- if (input.value === undefined)
+async function restorePreservedServiceTier(input) {
+ if (!input.preserved)
return;
- const content = await readFile5(input.target, "utf8");
- const bundledEffort = extractReasoningEffort(content);
- if (bundledEffort === input.value)
+ const content = await readFile4(input.linkPath, "utf8");
+ if (extractServiceTier(content) === input.value)
return;
- const replacement = replaceReasoningEffort(content, input.value);
+ const replacement = replaceTopLevelStringSetting(content, "service_tier", input.value, { insertIfMissing: true });
if (!replacement.replaced)
return;
await writeFile3(input.linkPath, replacement.content);
}
-async function readTextIfExists2(path) {
+async function readTextIfExists(path) {
try {
- return await readFile5(path, "utf8");
+ return await readFile4(path, "utf8");
} catch (error) {
- if (nodeErrorCode2(error) === "ENOENT")
+ if (nodeErrorCode(error) === "ENOENT")
return null;
throw error;
}
}
+function extractModel(content) {
+ return extractTopLevelStringSetting(content, "model");
+}
function extractReasoningEffort(content) {
return extractTopLevelStringSetting(content, "model_reasoning_effort");
}
@@ -1088,12 +1006,6 @@ function extractTopLevelStringSetting(content, key) {
}
return null;
}
-function replaceReasoningEffort(content, value) {
- return replaceTopLevelStringSetting(content, "model_reasoning_effort", value, { insertIfMissing: false });
-}
-function replaceServiceTier(content, value) {
- return replaceTopLevelStringSetting(content, "service_tier", value, { insertIfMissing: true });
-}
function replaceTopLevelStringSetting(content, key, value, options) {
const lines = content.split(/\n/);
for (let index = 0;index < lines.length; index += 1) {
@@ -1153,6 +1065,64 @@ function parseJsonString(value) {
return null;
}
}
+async function exists(path) {
+ try {
+ await lstat(path);
+ return true;
+ } catch (error) {
+ if (nodeErrorCode(error) !== "ENOENT")
+ throw error;
+ return false;
+ }
+}
+function nodeErrorCode(error) {
+ if (!(error instanceof Error) || !("code" in error))
+ return null;
+ return typeof error.code === "string" ? error.code : null;
+}
+
+// ../src/install/retired-managed-agent-purge.ts
+import { lstat as lstat2, readFile as readFile5, rm as rm5 } from "node:fs/promises";
+import { join as join9 } from "node:path";
+var RETIRED_MANAGED_AGENT_FILES = [
+ {
+ fileName: "codex-ultrawork-reviewer.toml",
+ requiredMarkers: [
+ 'name = "codex-ultrawork-reviewer"',
+ 'description = "Strict ultrawork verification reviewer.',
+ 'developer_instructions = """You are the ultrawork verification reviewer.'
+ ]
+ }
+];
+async function purgeRetiredManagedAgentFiles(input) {
+ const agentsDir = join9(input.codexHome, "agents");
+ if (!await exists2(agentsDir))
+ return;
+ for (const retiredAgent of RETIRED_MANAGED_AGENT_FILES) {
+ const agentPath = join9(agentsDir, retiredAgent.fileName);
+ if (!await exists2(agentPath))
+ continue;
+ const agentStat = await lstat2(agentPath);
+ if (agentStat.isDirectory() && !agentStat.isSymbolicLink())
+ continue;
+ const content = await readTextIfExists2(agentPath);
+ if (content === null || !hasRequiredMarkers(content, retiredAgent.requiredMarkers))
+ continue;
+ await rm5(agentPath, { force: true });
+ }
+}
+function hasRequiredMarkers(content, markers) {
+ return markers.every((marker) => content.includes(marker));
+}
+async function readTextIfExists2(path) {
+ try {
+ return await readFile5(path, "utf8");
+ } catch (error) {
+ if (nodeErrorCode2(error) === "ENOENT")
+ return null;
+ throw error;
+ }
+}
async function exists2(path) {
try {
await lstat2(path);
@@ -1169,9 +1139,102 @@ function nodeErrorCode2(error) {
return typeof error.code === "string" ? error.code : null;
}
+// ../src/install/link-cached-plugin-agents.ts
+var MANIFEST_FILE = ".installed-agents.json";
+async function linkCachedPluginAgents(input) {
+ const bundledAgents = await discoverBundledAgents(input.pluginRoot);
+ await purgeRetiredManagedAgentFiles({ codexHome: input.codexHome });
+ if (bundledAgents.length === 0) {
+ await writeManifest(input.pluginRoot, []);
+ return [];
+ }
+ const agentsDir = join10(input.codexHome, "agents");
+ await mkdir4(agentsDir, { recursive: true });
+ const linked = [];
+ for (const agentPath of bundledAgents) {
+ const agentFileName = basename3(agentPath);
+ const agentName = agentNameFromToml2(agentFileName);
+ const linkPath = join10(agentsDir, agentFileName);
+ await replaceWithCopy(linkPath, agentPath);
+ await restorePreservedReasoning({
+ agentName,
+ linkPath,
+ target: agentPath,
+ value: input.preservedReasoning?.get(agentName)
+ });
+ await restorePreservedServiceTier({
+ linkPath,
+ preserved: input.preservedServiceTier?.has(agentName) ?? false,
+ value: input.preservedServiceTier?.get(agentName) ?? null
+ });
+ linked.push({ name: agentFileName, path: linkPath, target: agentPath });
+ }
+ await writeManifest(input.pluginRoot, linked.map((entry) => entry.path));
+ return linked;
+}
+async function discoverBundledAgents(pluginRoot) {
+ const componentsRoot = join10(pluginRoot, "components");
+ if (!await exists3(componentsRoot))
+ return [];
+ const componentEntries = await readdir2(componentsRoot, { withFileTypes: true });
+ const agents = [];
+ for (const entry of componentEntries) {
+ if (!entry.isDirectory())
+ continue;
+ const agentsRoot = join10(componentsRoot, entry.name, "agents");
+ if (!await exists3(agentsRoot))
+ continue;
+ const agentEntries = await readdir2(agentsRoot, { withFileTypes: true });
+ for (const file of agentEntries) {
+ if (!file.isFile() || !file.name.endsWith(".toml"))
+ continue;
+ agents.push(join10(agentsRoot, file.name));
+ }
+ }
+ agents.sort();
+ return agents;
+}
+async function replaceWithCopy(linkPath, target) {
+ await prepareReplacement(linkPath);
+ await copyFile(target, linkPath);
+}
+async function prepareReplacement(linkPath) {
+ if (!await exists3(linkPath))
+ return;
+ const entryStat = await lstat3(linkPath);
+ if (entryStat.isDirectory() && !entryStat.isSymbolicLink()) {
+ throw new Error(`${linkPath} already exists and is a directory; refusing to replace`);
+ }
+ await rm6(linkPath, { force: true });
+}
+async function writeManifest(pluginRoot, agentPaths) {
+ const manifestPath = join10(pluginRoot, MANIFEST_FILE);
+ const payload = { agents: [...agentPaths].sort() };
+ await writeFile4(manifestPath, `${JSON.stringify(payload, null, "\t")}
+`);
+}
+function agentNameFromToml2(fileName) {
+ return fileName.endsWith(".toml") ? fileName.slice(0, -".toml".length) : fileName;
+}
+async function exists3(path) {
+ try {
+ await lstat3(path);
+ return true;
+ } catch (error) {
+ if (nodeErrorCode3(error) !== "ENOENT")
+ throw error;
+ return false;
+ }
+}
+function nodeErrorCode3(error) {
+ if (!(error instanceof Error) || !("code" in error))
+ return null;
+ return typeof error.code === "string" ? error.code : null;
+}
+
// ../src/install/codex-cache-bins.ts
-import { chmod as chmod2, lstat as lstat6, mkdir as mkdir5, readFile as readFile8, readdir as readdir3, readlink as readlink3, rm as rm9, stat as stat4, symlink, writeFile as writeFile4 } from "node:fs/promises";
-import { basename as basename4, isAbsolute as isAbsolute3, join as join13, relative as relative2, resolve as resolve4, sep } from "node:path";
+import { chmod as chmod2, lstat as lstat7, mkdir as mkdir5, readFile as readFile8, readdir as readdir4, readlink as readlink3, rm as rm9, stat as stat4, symlink, writeFile as writeFile5 } from "node:fs/promises";
+import { basename as basename4, isAbsolute as isAbsolute3, join as join14, relative as relative2, resolve as resolve4, sep } from "node:path";
// ../src/install/codex-cache-command-shim.ts
var COMMAND_SHIM_MARKER = ":: generated by oh-my-openagent Codex installer";
@@ -1215,14 +1278,14 @@ function windowsCommandShim(targetPath) {
}
// ../src/install/codex-cache-dangling-bins.ts
-import { lstat as lstat4, readFile as readFile6, readdir as readdir2, readlink, rm as rm7, stat as stat3 } from "node:fs/promises";
-import { dirname as dirname5, isAbsolute as isAbsolute2, join as join10, resolve as resolve3 } from "node:path";
+import { lstat as lstat5, readFile as readFile6, readdir as readdir3, readlink, rm as rm7, stat as stat3 } from "node:fs/promises";
+import { dirname as dirname5, isAbsolute as isAbsolute2, join as join11, resolve as resolve3 } from "node:path";
// ../src/install/codex-cache-fs.ts
-import { lstat as lstat3 } from "node:fs/promises";
+import { lstat as lstat4 } from "node:fs/promises";
async function fileExistsStrict(path) {
try {
- await lstat3(path);
+ await lstat4(path);
return true;
} catch (error) {
if (isNodeErrorWithCode(error) && error.code === "ENOENT")
@@ -1239,12 +1302,12 @@ function isNodeErrorWithCode(error) {
// ../src/install/codex-cache-dangling-bins.ts
async function removeDanglingManagedComponentBins(binDir, platform, managedBinNames) {
- const entries = await readdir2(binDir, { withFileTypes: true });
+ const entries = await readdir3(binDir, { withFileTypes: true });
for (const entry of entries) {
const binName = managedBinNameForEntry(entry.name, platform);
if (binName === null || !managedBinNames.has(binName))
continue;
- const linkPath = join10(binDir, entry.name);
+ const linkPath = join11(binDir, entry.name);
if (platform === "win32") {
await removeDanglingGeneratedCommandShim(linkPath);
continue;
@@ -1259,7 +1322,7 @@ function managedBinNameForEntry(name, platform) {
}
async function removeDanglingManagedSymlink(linkPath) {
try {
- const linkStat = await lstat4(linkPath);
+ const linkStat = await lstat5(linkPath);
if (!linkStat.isSymbolicLink())
return;
const linkTarget = await readlink(linkPath);
@@ -1274,7 +1337,7 @@ async function removeDanglingManagedSymlink(linkPath) {
}
async function removeDanglingGeneratedCommandShim(linkPath) {
try {
- const linkStat = await lstat4(linkPath);
+ const linkStat = await lstat5(linkPath);
if (!linkStat.isFile())
return;
const content = await readFile6(linkPath, "utf8");
@@ -1325,8 +1388,8 @@ function hasOmoCodexPluginPrefix(parts, endExclusive) {
}
// ../src/install/codex-cache-legacy-bins.ts
-import { lstat as lstat5, readFile as readFile7, readlink as readlink2, rm as rm8 } from "node:fs/promises";
-import { join as join11 } from "node:path";
+import { lstat as lstat6, readFile as readFile7, readlink as readlink2, rm as rm8 } from "node:fs/promises";
+import { join as join12 } from "node:path";
var LEGACY_CODEX_COMPONENT_BINS = [
{ name: "omo", component: "ulw-loop" },
{ name: "codex-comment-checker", component: "comment-checker" },
@@ -1338,13 +1401,13 @@ var LEGACY_CODEX_COMPONENT_BINS = [
];
async function removeLegacyCodexComponentBins(binDir, platform) {
for (const entry of LEGACY_CODEX_COMPONENT_BINS) {
- const linkPath = join11(binDir, platform === "win32" ? `${entry.name}.cmd` : entry.name);
+ const linkPath = join12(binDir, platform === "win32" ? `${entry.name}.cmd` : entry.name);
await removeLegacyCodexComponentBin(linkPath, entry.component, platform);
}
}
async function removeLegacyCodexComponentBin(linkPath, component, platform) {
try {
- const stat4 = await lstat5(linkPath);
+ const stat4 = await lstat6(linkPath);
if (platform !== "win32") {
if (!stat4.isSymbolicLink())
return;
@@ -1389,10 +1452,10 @@ function isNodeErrorWithCode2(error) {
}
// ../src/install/codex-cache-runtime-wrapper.ts
-import { join as join12 } from "node:path";
+import { join as join13 } from "node:path";
var RUNTIME_WRAPPER_MARKER = "OMO_GENERATED_RUNTIME_WRAPPER";
function posixRuntimeWrapper(cliPath, codexHome, binDir, nodeCliPath) {
- const ulwLoopBin = toPosixPath(join12(binDir, "omo-ulw-loop"));
+ const ulwLoopBin = toPosixPath(join13(binDir, "omo-ulw-loop"));
const nodeCli = escapePosixDoubleQuoted(toPosixPath(nodeCliPath));
const escapedCliPath = escapePosixDoubleQuoted(toPosixPath(cliPath));
const escapedCodexHome = escapePosixDoubleQuoted(toPosixPath(codexHome));
@@ -1437,7 +1500,7 @@ function posixRuntimeWrapper(cliPath, codexHome, binDir, nodeCliPath) {
`);
}
function windowsRuntimeWrapper(cliPath, codexHome, binDir, nodeCliPath) {
- const ulwLoopBin = join12(binDir, "omo-ulw-loop.cmd");
+ const ulwLoopBin = join13(binDir, "omo-ulw-loop.cmd");
return [
"@echo off",
`rem ${RUNTIME_WRAPPER_MARKER}`,
@@ -1494,29 +1557,29 @@ async function linkCachedPluginBins(input) {
return linked;
}
async function linkRootRuntimeBin(input) {
- const cliPath = join13(input.repoRoot, "dist", "cli", "index.js");
+ const cliPath = join14(input.repoRoot, "dist", "cli", "index.js");
if (!await isFile2(cliPath))
return null;
- const nodeCliPath = join13(input.repoRoot, "dist", "cli-node", "index.js");
+ const nodeCliPath = join14(input.repoRoot, "dist", "cli-node", "index.js");
const platform = input.platform ?? process.platform;
await mkdir5(input.binDir, { recursive: true });
if (platform === "win32") {
- const linkPath2 = join13(input.binDir, "omo.cmd");
+ const linkPath2 = join14(input.binDir, "omo.cmd");
await replaceRuntimeWrapper(linkPath2, windowsRuntimeWrapper(cliPath, input.codexHome, input.binDir, nodeCliPath));
return { name: "omo", path: linkPath2, target: cliPath };
}
- const linkPath = join13(input.binDir, "omo");
+ const linkPath = join14(input.binDir, "omo");
await replaceRuntimeWrapper(linkPath, posixRuntimeWrapper(cliPath, input.codexHome, input.binDir, nodeCliPath));
await chmod2(linkPath, 493);
return { name: "omo", path: linkPath, target: cliPath };
}
async function linkCachedPluginBin(binDir, link, platform) {
if (platform === "win32") {
- const linkPath2 = join13(binDir, `${link.name}.cmd`);
+ const linkPath2 = join14(binDir, `${link.name}.cmd`);
await replaceCommandShim(linkPath2, link.target);
return linkPath2;
}
- const linkPath = join13(binDir, link.name);
+ const linkPath = join14(binDir, link.name);
await replaceSymlink(linkPath, link.target);
return linkPath;
}
@@ -1535,16 +1598,16 @@ async function discoverPackageBins(root) {
return links;
}
async function collectPackageBins(directory, root, links) {
- const entries = await readdir3(directory, { withFileTypes: true });
+ const entries = await readdir4(directory, { withFileTypes: true });
if (entries.some((entry) => entry.isFile() && entry.name === "package.json")) {
- await appendPackageBinLinks(join13(directory, "package.json"), directory, root, links);
+ await appendPackageBinLinks(join14(directory, "package.json"), directory, root, links);
}
for (const entry of entries) {
if (!entry.isDirectory())
continue;
if (entry.name === "node_modules" || entry.name === ".git" || entry.name === "dist")
continue;
- const childPath = join13(directory, entry.name);
+ const childPath = join14(directory, entry.name);
if (!childPath.startsWith(root))
continue;
await collectPackageBins(childPath, root, links);
@@ -1603,17 +1666,17 @@ async function replaceSymlink(linkPath, targetPath) {
async function replaceCommandShim(linkPath, targetPath) {
if (await existingNonShim(linkPath))
throw new Error(`${linkPath} already exists and is not a command shim`);
- await writeFile4(linkPath, windowsCommandShim(targetPath));
+ await writeFile5(linkPath, windowsCommandShim(targetPath));
}
async function replaceRuntimeWrapper(linkPath, content) {
if (await existingNonRuntimeWrapper(linkPath))
throw new Error(`${linkPath} already exists and is not a generated OMO runtime wrapper`);
await rm9(linkPath, { force: true });
- await writeFile4(linkPath, content);
+ await writeFile5(linkPath, content);
}
async function existingNonRuntimeWrapper(path) {
try {
- const stat5 = await lstat6(path);
+ const stat5 = await lstat7(path);
if (stat5.isSymbolicLink())
return false;
if (!stat5.isFile())
@@ -1628,7 +1691,7 @@ async function existingNonRuntimeWrapper(path) {
}
async function existingNonShim(path) {
try {
- const stat5 = await lstat6(path);
+ const stat5 = await lstat7(path);
if (!stat5.isFile())
return true;
const content = await readFile8(path, "utf8");
@@ -1643,7 +1706,7 @@ async function existingNonShim(path) {
}
async function existingNonSymlink(path) {
try {
- const stat5 = await lstat6(path);
+ const stat5 = await lstat7(path);
if (!stat5.isSymbolicLink())
return true;
await readlink3(path);
@@ -1657,7 +1720,7 @@ async function existingNonSymlink(path) {
// ../src/install/codex-config-toml.ts
import { mkdir as mkdir6, readFile as readFile10 } from "node:fs/promises";
-import { dirname as dirname7 } from "node:path";
+import { dirname as dirname8 } from "node:path";
// ../src/install/toml-section-editor.ts
function findTomlSection(config, header) {
@@ -2015,14 +2078,14 @@ function tomlKeySegment(value) {
}
// ../src/install/codex-config-atomic-write.ts
-import { lstat as lstat7, readlink as readlink4, realpath, rename as rename3, unlink, writeFile as writeFile5 } from "node:fs/promises";
-import { basename as basename5, dirname as dirname6, isAbsolute as isAbsolute4, join as join14, resolve as resolve5 } from "node:path";
+import { lstat as lstat8, readlink as readlink4, realpath, rename as rename3, unlink, writeFile as writeFile6 } from "node:fs/promises";
+import { basename as basename5, dirname as dirname6, isAbsolute as isAbsolute4, join as join15, resolve as resolve5 } from "node:path";
var RENAME_RETRY_DELAYS_MS = [10, 25, 50];
var RETRIABLE_RENAME_CODES = new Set(["EPERM", "EBUSY"]);
async function writeFileAtomic(targetPath, data) {
const writeTarget = await resolveSymlinkTarget(targetPath);
- const temporaryPath = join14(dirname6(writeTarget), `.tmp-${basename5(writeTarget)}-${process.pid}-${Date.now()}`);
- await writeFile5(temporaryPath, data);
+ const temporaryPath = join15(dirname6(writeTarget), `.tmp-${basename5(writeTarget)}-${process.pid}-${Date.now()}`);
+ await writeFile6(temporaryPath, data);
try {
await renameWithRetry(temporaryPath, writeTarget);
} catch (error) {
@@ -2036,7 +2099,7 @@ async function writeFileAtomic(targetPath, data) {
}
async function resolveSymlinkTarget(targetPath) {
try {
- const linkStats = await lstat7(targetPath);
+ const linkStats = await lstat8(targetPath);
if (!linkStats.isSymbolicLink())
return targetPath;
} catch (error) {
@@ -2392,7 +2455,7 @@ function isRootSetting(line, key) {
// ../src/install/codex-model-catalog.ts
import { readFile as readFile9 } from "node:fs/promises";
-import { join as join15 } from "node:path";
+import { join as join16 } from "node:path";
var FALLBACK_CODEX_MODEL_CATALOG = {
current: {
model: "gpt-5.5",
@@ -2411,7 +2474,7 @@ var FALLBACK_CODEX_MODEL_CATALOG = {
]
};
async function readCodexModelCatalog(codexPackageRoot) {
- const catalogPath = join15(codexPackageRoot, "plugin", "model-catalog.json");
+ const catalogPath = join16(codexPackageRoot, "plugin", "model-catalog.json");
try {
const parsed = JSON.parse(await readFile9(catalogPath, "utf8"));
return parseCodexModelCatalog(parsed) ?? FALLBACK_CODEX_MODEL_CATALOG;
@@ -2494,30 +2557,87 @@ function isRootSetting2(line, key) {
}
// ../src/install/codex-multi-agent-v2-config.ts
+import { readFileSync } from "node:fs";
+import { dirname as dirname7, isAbsolute as isAbsolute5, join as join17 } from "node:path";
var CODEX_AGENTS_HEADER = "agents";
var CODEX_MULTI_AGENT_V2_HEADER = "features.multi_agent_v2";
var CODEX_SUBAGENT_THREAD_LIMIT = 1000;
-function ensureCodexMultiAgentV2Config(config) {
+function ensureCodexMultiAgentV2Config(config, options = {}) {
const featureFlag = removeFeatureFlagSetting(config, "multi_agent_v2");
- const agentsConfig = ensureAgentsMaxThreads(featureFlag.config);
- const section = findTomlSection(agentsConfig, CODEX_MULTI_AGENT_V2_HEADER);
+ const v2Preferred = options.multiAgentVersion === "v2";
+ const modelKnown = options.multiAgentVersion != null || readRootModel(featureFlag.config) !== null;
+ const agentsConfig = v2Preferred ? removeAgentsMaxThreads(featureFlag.config) : modelKnown ? ensureAgentsMaxThreads(featureFlag.config) : raiseExistingAgentsMaxThreads(featureFlag.config);
const maxThreadsValue = CODEX_SUBAGENT_THREAD_LIMIT.toString();
+ const preserveDisable = featureFlag.value === false && !v2Preferred;
+ const featureConfig = preserveDisable ? setMultiAgentV2Disable(agentsConfig) : v2Preferred ? removeMultiAgentV2Disable(agentsConfig) : agentsConfig;
+ const section = findTomlSection(featureConfig, CODEX_MULTI_AGENT_V2_HEADER);
if (!section) {
- const enabledSetting = featureFlag.value === false ? `enabled = false
+ const enabledSetting = preserveDisable ? `enabled = false
` : "";
- return appendBlock(agentsConfig, `[${CODEX_MULTI_AGENT_V2_HEADER}]
+ return appendBlock(featureConfig, `[${CODEX_MULTI_AGENT_V2_HEADER}]
${enabledSetting}max_concurrent_threads_per_session = ${maxThreadsValue}
`);
}
- const withPreservedDisable = featureFlag.value === false ? replaceOrInsertSetting(agentsConfig, section, "enabled", "false") : agentsConfig;
- const updatedSection = featureFlag.value === false ? findTomlSection(withPreservedDisable, CODEX_MULTI_AGENT_V2_HEADER) : section;
- if (!updatedSection) {
- return appendBlock(withPreservedDisable, `[${CODEX_MULTI_AGENT_V2_HEADER}]
-enabled = false
-max_concurrent_threads_per_session = ${maxThreadsValue}
-`);
+ return replaceOrInsertSetting(featureConfig, section, "max_concurrent_threads_per_session", maxThreadsValue);
+}
+function resolveCodexMultiAgentVersion(config, configPath) {
+ const model = readRootModel(config);
+ if (model === null)
+ return null;
+ const catalogPath = resolveCatalogPath(readRootModelCatalogPath(config), configPath);
+ const catalogVersion = readCatalogMultiAgentVersion(model, catalogPath);
+ if (catalogVersion !== null)
+ return catalogVersion;
+ return /^gpt-5\.6\b/i.test(model) ? "v2" : null;
+}
+function resolveCatalogPath(configuredPath, configPath) {
+ if (configuredPath === null)
+ return join17(dirname7(configPath), "models_cache.json");
+ return isAbsolute5(configuredPath) ? configuredPath : join17(dirname7(configPath), configuredPath);
+}
+function readCatalogMultiAgentVersion(model, cachePath) {
+ let raw;
+ try {
+ raw = readFileSync(cachePath, "utf8");
+ } catch {
+ return null;
+ }
+ let cache;
+ try {
+ cache = JSON.parse(raw);
+ } catch {
+ return null;
}
- return replaceOrInsertSetting(withPreservedDisable, updatedSection, "max_concurrent_threads_per_session", maxThreadsValue);
+ if (!isRecord2(cache) || !Array.isArray(cache.models))
+ return null;
+ for (const entry of cache.models) {
+ if (!isRecord2(entry))
+ continue;
+ if (entry.slug !== model && entry.id !== model)
+ continue;
+ const version = entry.multi_agent_version;
+ if (version === "v1" || version === "v2")
+ return version;
+ return null;
+ }
+ return null;
+}
+function readRootModel(config) {
+ const double = config.match(/^\s*model\s*=\s*"([^"]+)"/m);
+ if (double !== null)
+ return double[1] ?? null;
+ const single = config.match(/^\s*model\s*=\s*'([^']+)'/m);
+ return single?.[1] ?? null;
+}
+function readRootModelCatalogPath(config) {
+ const double = config.match(/^\s*model_catalog_json\s*=\s*"([^"]+)"/m);
+ if (double !== null)
+ return double[1] ?? null;
+ const single = config.match(/^\s*model_catalog_json\s*=\s*'([^']+)'/m);
+ return single?.[1] ?? null;
+}
+function isRecord2(value) {
+ return typeof value === "object" && value !== null && !Array.isArray(value);
}
function removeFeatureFlagSetting(config, featureName) {
const section = findTomlSection(config, "features");
@@ -2538,6 +2658,36 @@ max_threads = ${maxThreadsValue}
}
return replaceOrInsertSetting(config, section, "max_threads", maxThreadsValue);
}
+function removeAgentsMaxThreads(config) {
+ const section = findTomlSection(config, CODEX_AGENTS_HEADER);
+ if (!section)
+ return config;
+ if (!/^\s*max_threads\s*=/m.test(section.text))
+ return config;
+ return removeSetting(config, section, "max_threads");
+}
+function removeMultiAgentV2Disable(config) {
+ const section = findTomlSection(config, CODEX_MULTI_AGENT_V2_HEADER);
+ if (!section)
+ return config;
+ if (!/^\s*enabled\s*=\s*false(?:\s*#.*)?$/m.test(section.text))
+ return config;
+ return removeSetting(config, section, "enabled");
+}
+function setMultiAgentV2Disable(config) {
+ const section = findTomlSection(config, CODEX_MULTI_AGENT_V2_HEADER);
+ if (!section)
+ return config;
+ return replaceOrInsertSetting(config, section, "enabled", "false");
+}
+function raiseExistingAgentsMaxThreads(config) {
+ const section = findTomlSection(config, CODEX_AGENTS_HEADER);
+ if (!section)
+ return config;
+ if (!/^\s*max_threads\s*=/m.test(section.text))
+ return config;
+ return replaceOrInsertSetting(config, section, "max_threads", CODEX_SUBAGENT_THREAD_LIMIT.toString());
+}
function readBooleanSetting(sectionText, key) {
const match = new RegExp(`^\\s*${escapeRegExp(key)}\\s*=\\s*(true|false)\\s*(?:#.*)?$`, "m").exec(sectionText);
if (!match)
@@ -2547,7 +2697,7 @@ function readBooleanSetting(sectionText, key) {
// ../src/install/codex-config-toml.ts
async function updateCodexConfig(input) {
- await mkdir6(dirname7(input.configPath), { recursive: true });
+ await mkdir6(dirname8(input.configPath), { recursive: true });
let config;
try {
config = await readFile10(input.configPath, "utf8");
@@ -2570,7 +2720,9 @@ async function updateCodexConfig(input) {
config = ensureFeatureEnabled(config, "multi_agent");
config = removeUnsupportedCodexMultiAgentModeConfig(config);
config = ensureCodexReasoningConfig(config, await readCodexModelCatalog(input.repoRoot));
- config = ensureCodexMultiAgentV2Config(config);
+ config = ensureCodexMultiAgentV2Config(config, {
+ multiAgentVersion: resolveCodexMultiAgentVersion(config, input.configPath)
+ });
if (input.autonomousPermissions === true)
config = ensureAutonomousPermissions(config);
if (!(input.preserveMarketplaceSource === true && hasMarketplaceBlock(config, input.marketplaceName))) {
@@ -2594,12 +2746,12 @@ function isMissingFileError(error) {
}
// ../src/install/codex-git-bash-mcp-env.ts
-import { readFile as readFile11, writeFile as writeFile6 } from "node:fs/promises";
-import { join as join16 } from "node:path";
+import { readFile as readFile11, writeFile as writeFile7 } from "node:fs/promises";
+import { join as join18 } from "node:path";
var GIT_BASH_ENV_KEY = "OMO_CODEX_GIT_BASH_PATH";
var CODEGRAPH_RELATIVE_ARGS = new Set(["components/codegraph/dist/serve.js", "./components/codegraph/dist/serve.js"]);
async function stampGitBashMcpEnv(input) {
- const manifestPath = join16(input.pluginRoot, ".mcp.json");
+ const manifestPath = join18(input.pluginRoot, ".mcp.json");
if (!await fileExistsStrict(manifestPath))
return false;
const parsed = JSON.parse(await readFile11(manifestPath, "utf8"));
@@ -2620,7 +2772,7 @@ async function stampGitBashMcpEnv(input) {
}
if (!changed)
return false;
- await writeFile6(manifestPath, `${JSON.stringify(parsed, null, "\t")}
+ await writeFile7(manifestPath, `${JSON.stringify(parsed, null, "\t")}
`);
return true;
}
@@ -2632,14 +2784,14 @@ function stampCodegraphMcpPath(mcpServers, pluginRoot) {
const entrypoint = args[0];
if (typeof entrypoint !== "string" || !CODEGRAPH_RELATIVE_ARGS.has(entrypoint))
return false;
- codegraphServer["args"] = [join16(pluginRoot, "components", "codegraph", "dist", "serve.js"), ...args.slice(1)];
+ codegraphServer["args"] = [join18(pluginRoot, "components", "codegraph", "dist", "serve.js"), ...args.slice(1)];
return true;
}
// ../src/install/codex-hook-trust.ts
import { createHash as createHash3 } from "node:crypto";
import { readFile as readFile12 } from "node:fs/promises";
-import { join as join17 } from "node:path";
+import { join as join19 } from "node:path";
var EVENT_LABELS = new Map([
["PreToolUse", "pre_tool_use"],
["PermissionRequest", "permission_request"],
@@ -2653,16 +2805,16 @@ var EVENT_LABELS = new Map([
["Stop", "stop"]
]);
async function trustedHookStatesForPlugin(input) {
- const manifestPath = join17(input.pluginRoot, ".codex-plugin", "plugin.json");
- if (!await exists3(manifestPath))
+ const manifestPath = join19(input.pluginRoot, ".codex-plugin", "plugin.json");
+ if (!await exists4(manifestPath))
return [];
const manifest = JSON.parse(await readFile12(manifestPath, "utf8"));
if (!isPlainRecord(manifest))
return [];
const states = [];
for (const hookPath of hookManifestPaths(manifest.hooks)) {
- const hooksPath = join17(input.pluginRoot, hookPath);
- if (!await exists3(hooksPath))
+ const hooksPath = join19(input.pluginRoot, hookPath);
+ if (!await exists4(hooksPath))
continue;
const parsed = JSON.parse(await readFile12(hooksPath, "utf8"));
if (!isPlainRecord(parsed) || !isPlainRecord(parsed.hooks))
@@ -2745,7 +2897,7 @@ function canonicalJson(value) {
function stripDotSlash(value) {
return value.startsWith("./") ? value.slice(2) : value;
}
-async function exists3(path) {
+async function exists4(path) {
try {
await readFile12(path, "utf8");
return true;
@@ -2758,7 +2910,7 @@ async function exists3(path) {
// ../src/install/codex-installer-bin-dir.ts
import { homedir as homedir3 } from "node:os";
-import { join as join18, resolve as resolve6 } from "node:path";
+import { join as join20, resolve as resolve6 } from "node:path";
function resolveCodexInstallerBinDir(input) {
const explicitBinDir = input.binDir ?? input.env?.CODEX_LOCAL_BIN_DIR;
if (explicitBinDir !== undefined && explicitBinDir.trim().length > 0)
@@ -2767,7 +2919,7 @@ function resolveCodexInstallerBinDir(input) {
const defaultCodexHome = resolve6(homeDir, ".codex");
const resolvedCodexHome = resolve6(input.codexHome);
if (resolvedCodexHome !== defaultCodexHome)
- return join18(resolvedCodexHome, "bin");
+ return join20(resolvedCodexHome, "bin");
return resolve6(homeDir, ".local", "bin");
}
@@ -2923,9 +3075,9 @@ async function resolveGitBashStep(options, degraded) {
return false;
}
async function linkBundledAgentsStep(options) {
- const agentsTarget = join19(options.codexHome, "agents");
+ const agentsTarget = join21(options.codexHome, "agents");
try {
- const stageRoot = join19(options.pluginData, "bootstrap", "agents-stage");
+ const stageRoot = join21(options.pluginData, "bootstrap", "agents-stage");
await stageBundledAgents(options.pluginRoot, stageRoot);
const preservedReasoning = await capturePreservedAgentReasoning({ codexHome: options.codexHome });
const preservedServiceTier = await capturePreservedAgentServiceTier({ codexHome: options.codexHome });
@@ -2935,7 +3087,7 @@ async function linkBundledAgentsStep(options) {
preservedReasoning,
preservedServiceTier
});
- const agentConfigs = linked.map((link) => ({ configFile: `./agents/${link.name}`, name: agentNameFromToml2(link.name) })).sort((left, right) => left.name.localeCompare(right.name));
+ const agentConfigs = linked.map((link) => ({ configFile: `./agents/${link.name}`, name: agentNameFromToml3(link.name) })).sort((left, right) => left.name.localeCompare(right.name));
return { agentConfigs, degraded: [] };
} catch (error) {
return {
@@ -2953,21 +3105,21 @@ async function linkBundledAgentsStep(options) {
async function stageBundledAgents(pluginRoot, stageRoot) {
await rm10(stageRoot, { force: true, recursive: true });
await mkdir7(stageRoot, { recursive: true });
- const componentsRoot = join19(pluginRoot, "components");
+ const componentsRoot = join21(pluginRoot, "components");
for (const componentName of await directoryNames(componentsRoot)) {
- const agentsDir = join19(componentsRoot, componentName, "agents");
+ const agentsDir = join21(componentsRoot, componentName, "agents");
const agentFiles = (await fileNames(agentsDir)).filter((name) => name.endsWith(".toml"));
if (agentFiles.length === 0)
continue;
- const stagedAgentsDir = join19(stageRoot, "components", componentName, "agents");
+ const stagedAgentsDir = join21(stageRoot, "components", componentName, "agents");
await mkdir7(stagedAgentsDir, { recursive: true });
for (const agentFile of agentFiles) {
- await copyFile2(join19(agentsDir, agentFile), join19(stagedAgentsDir, agentFile));
+ await copyFile2(join21(agentsDir, agentFile), join21(stagedAgentsDir, agentFile));
}
}
}
async function updateConfigStep(options, inputs, degraded) {
- const configPath = join19(options.codexHome, "config.toml");
+ const configPath = join21(options.codexHome, "config.toml");
try {
await assertWritableConfigIfPresent(configPath);
const trustedHookStates = await trustedHookStatesForPlugin({
@@ -3023,7 +3175,7 @@ async function linkComponentBinsStep(options, degraded) {
await linkRuntimeWrapperStep(options, binDir, degraded);
}
async function linkRuntimeWrapperStep(options, binDir, degraded) {
- const cliPath = join19(options.pluginRoot, "dist", "cli", "index.js");
+ const cliPath = join21(options.pluginRoot, "dist", "cli", "index.js");
try {
const linked = await linkRootRuntimeBin({
binDir,
@@ -3056,7 +3208,7 @@ async function stampGitBashEnvStep(options, degraded) {
degraded.push({
component: "git-bash-env",
hint: BOOTSTRAP_DOCTOR_HINT,
- reason: `failed to stamp ${join19(options.pluginRoot, ".mcp.json")}: ${errorMessage(error)}`
+ reason: `failed to stamp ${join21(options.pluginRoot, ".mcp.json")}: ${errorMessage(error)}`
});
}
}
@@ -3068,7 +3220,7 @@ async function fileNames(root) {
}
async function entryNames(root, keep) {
try {
- const entries = await readdir4(root, { withFileTypes: true });
+ const entries = await readdir5(root, { withFileTypes: true });
return entries.filter((entry) => keep(entry)).map((entry) => entry.name).sort();
} catch (error) {
if (error instanceof Error && "code" in error && error.code === "ENOENT")
@@ -3076,7 +3228,7 @@ async function entryNames(root, keep) {
throw error;
}
}
-function agentNameFromToml2(fileName) {
+function agentNameFromToml3(fileName) {
return fileName.endsWith(".toml") ? fileName.slice(0, -".toml".length) : fileName;
}
function errorMessage(error) {
@@ -3124,11 +3276,11 @@ function resolvePluginDataRoot(env) {
const fromEnv = env["PLUGIN_DATA"]?.trim();
if (fromEnv !== undefined && fromEnv.length > 0)
return fromEnv;
- return join20(homedir4(), ".local", "share", "lazycodex");
+ return join22(homedir4(), ".local", "share", "lazycodex");
}
async function readPluginVersion(pluginRoot) {
try {
- const parsed = JSON.parse(await readFile13(join20(pluginRoot, ".codex-plugin", "plugin.json"), "utf8"));
+ const parsed = JSON.parse(await readFile13(join22(pluginRoot, ".codex-plugin", "plugin.json"), "utf8"));
if (typeof parsed !== "object" || parsed === null)
return;
const version = parsed["version"];
@@ -3195,7 +3347,7 @@ async function runBootstrapWorker(options = {}) {
degraded.push({
component: "bootstrap",
hint: BOOTSTRAP_DOCTOR_HINT,
- reason: `plugin version unresolved from ${join20(pluginRoot, ".codex-plugin", "plugin.json")}`
+ reason: `plugin version unresolved from ${join22(pluginRoot, ".codex-plugin", "plugin.json")}`
});
}
for (const step of steps) {
@@ -3234,12 +3386,12 @@ function resolvePluginRoot(env) {
const fromEnv = env["PLUGIN_ROOT"]?.trim();
if (fromEnv !== undefined && fromEnv.length > 0)
return fromEnv;
- return resolve7(dirname8(fileURLToPath2(import.meta.url)), "..", "..", "..");
+ return resolve7(dirname9(fileURLToPath2(import.meta.url)), "..", "..", "..");
}
async function appendBootstrapLog(pluginData, now, event, details) {
try {
- const logPath = join20(pluginData, "bootstrap", "bootstrap.log");
- await mkdir8(dirname8(logPath), { recursive: true });
+ const logPath = join22(pluginData, "bootstrap", "bootstrap.log");
+ await mkdir8(dirname9(logPath), { recursive: true });
await appendFile2(logPath, `${JSON.stringify({ timestamp: new Date(now).toISOString(), event, ...details })}
`);
} catch {}
diff --git a/plugins/omo/components/bootstrap/hooks/hooks.json b/plugins/omo/components/bootstrap/hooks/hooks.json
index 1ceb568f..2a66ba3c 100644
--- a/plugins/omo/components/bootstrap/hooks/hooks.json
+++ b/plugins/omo/components/bootstrap/hooks/hooks.json
@@ -8,7 +8,7 @@
"command": "node \"${PLUGIN_ROOT}/components/bootstrap/dist/cli.js\" hook session-start",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\bootstrap.ps1\"",
"timeout": 30,
- "statusMessage": "(OmO 4.16.2) Checking Bootstrap Provisioning"
+ "statusMessage": "(OmO 4.16.3) Checking Bootstrap Provisioning"
}
]
}
diff --git a/plugins/omo/components/bootstrap/package.json b/plugins/omo/components/bootstrap/package.json
index d4f60cdf..c549cbc8 100644
--- a/plugins/omo/components/bootstrap/package.json
+++ b/plugins/omo/components/bootstrap/package.json
@@ -1,6 +1,6 @@
{
"name": "@sisyphuslabs/codex-bootstrap",
- "version": "4.16.2",
+ "version": "4.16.3",
"description": "Codex SessionStart bootstrap component that provisions LazyCodex runtime dependencies from a detached worker.",
"type": "module",
"private": true,
diff --git a/plugins/omo/components/codegraph/package.json b/plugins/omo/components/codegraph/package.json
index 397da9a8..8046d509 100644
--- a/plugins/omo/components/codegraph/package.json
+++ b/plugins/omo/components/codegraph/package.json
@@ -1,6 +1,6 @@
{
"name": "@sisyphuslabs/codex-codegraph",
- "version": "4.16.2",
+ "version": "4.16.3",
"description": "Codex plugin MCP wrapper for CodeGraph.",
"type": "module",
"private": true,
diff --git a/plugins/omo/components/comment-checker/hooks/hooks.json b/plugins/omo/components/comment-checker/hooks/hooks.json
index 2f43c5a9..0d3aa609 100644
--- a/plugins/omo/components/comment-checker/hooks/hooks.json
+++ b/plugins/omo/components/comment-checker/hooks/hooks.json
@@ -8,7 +8,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook post-tool-use",
"timeout": 30,
- "statusMessage": "(OmO 4.16.2) Checking Comments"
+ "statusMessage": "(OmO 4.16.3) Checking Comments"
}
]
}
diff --git a/plugins/omo/components/comment-checker/package.json b/plugins/omo/components/comment-checker/package.json
index d79b0fca..08fe379a 100644
--- a/plugins/omo/components/comment-checker/package.json
+++ b/plugins/omo/components/comment-checker/package.json
@@ -1,6 +1,6 @@
{
"name": "@code-yeongyu/codex-comment-checker",
- "version": "4.16.2",
+ "version": "4.16.3",
"description": "Codex plugin that runs comment-checker after edit-like PostToolUse hooks.",
"type": "module",
"packageManager": "[email protected]",
diff --git a/plugins/omo/components/git-bash/hooks/hooks.json b/plugins/omo/components/git-bash/hooks/hooks.json
index 885f4357..6aca06a9 100644
--- a/plugins/omo/components/git-bash/hooks/hooks.json
+++ b/plugins/omo/components/git-bash/hooks/hooks.json
@@ -8,7 +8,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook pre-tool-use",
"timeout": 5,
- "statusMessage": "(OmO 4.16.2) Recommending Git Bash MCP"
+ "statusMessage": "(OmO 4.16.3) Recommending Git Bash MCP"
}
]
}
@@ -20,7 +20,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook post-compact",
"timeout": 5,
- "statusMessage": "(OmO 4.16.2) Resetting Git Bash MCP Reminder"
+ "statusMessage": "(OmO 4.16.3) Resetting Git Bash MCP Reminder"
}
]
}
diff --git a/plugins/omo/components/git-bash/package.json b/plugins/omo/components/git-bash/package.json
index 02dcd048..c084f912 100644
--- a/plugins/omo/components/git-bash/package.json
+++ b/plugins/omo/components/git-bash/package.json
@@ -1,6 +1,6 @@
{
"name": "@sisyphuslabs/codex-git-bash-hook",
- "version": "4.16.2",
+ "version": "4.16.3",
"description": "Codex hook component that reminds Windows sessions to prefer the OMO git_bash MCP.",
"type": "module",
"private": true,
diff --git a/plugins/omo/components/lazycodex-executor-verify/hooks/hooks.json b/plugins/omo/components/lazycodex-executor-verify/hooks/hooks.json
index b762bba4..9964a420 100644
--- a/plugins/omo/components/lazycodex-executor-verify/hooks/hooks.json
+++ b/plugins/omo/components/lazycodex-executor-verify/hooks/hooks.json
@@ -8,7 +8,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/lazycodex-executor-verify/dist/cli.js\" hook subagent-stop",
"timeout": 10,
- "statusMessage": "(OmO 4.16.2) Verifying LazyCodex Executor Evidence"
+ "statusMessage": "(OmO 4.16.3) Verifying LazyCodex Executor Evidence"
}
]
}
diff --git a/plugins/omo/components/lazycodex-executor-verify/package.json b/plugins/omo/components/lazycodex-executor-verify/package.json
index 5415157e..2e866314 100644
--- a/plugins/omo/components/lazycodex-executor-verify/package.json
+++ b/plugins/omo/components/lazycodex-executor-verify/package.json
@@ -1,6 +1,6 @@
{
"name": "@code-yeongyu/codex-lazycodex-executor-verify",
- "version": "4.16.2",
+ "version": "4.16.3",
"description": "Codex SubagentStop evidence verifier for LazyCodex executor completions.",
"type": "module",
"packageManager": "[email protected]",
diff --git a/plugins/omo/components/lsp/hooks/hooks.json b/plugins/omo/components/lsp/hooks/hooks.json
index 11927a8e..13280d8c 100644
--- a/plugins/omo/components/lsp/hooks/hooks.json
+++ b/plugins/omo/components/lsp/hooks/hooks.json
@@ -8,7 +8,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook post-tool-use",
"timeout": 60,
- "statusMessage": "(OmO 4.16.2) Checking LSP Diagnostics"
+ "statusMessage": "(OmO 4.16.3) Checking LSP Diagnostics"
}
]
}
@@ -21,7 +21,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook post-compact",
"timeout": 5,
- "statusMessage": "(OmO 4.16.2) Resetting LSP Diagnostics Cache"
+ "statusMessage": "(OmO 4.16.3) Resetting LSP Diagnostics Cache"
}
]
}
diff --git a/plugins/omo/components/lsp/package.json b/plugins/omo/components/lsp/package.json
index b0e29d4b..e721bf83 100644
--- a/plugins/omo/components/lsp/package.json
+++ b/plugins/omo/components/lsp/package.json
@@ -1,6 +1,6 @@
{
"name": "@code-yeongyu/codex-lsp",
- "version": "4.16.2",
+ "version": "4.16.3",
"description": "Codex plugin that exposes Language Server Protocol tools and post-edit diagnostics.",
"type": "module",
"packageManager": "[email protected]",
diff --git a/plugins/omo/components/rules/bundled-rules/hephaestus.md b/plugins/omo/components/rules/bundled-rules/hephaestus/gpt-5.5.md
similarity index 100%
rename from plugins/omo/components/rules/bundled-rules/hephaestus.md
rename to plugins/omo/components/rules/bundled-rules/hephaestus/gpt-5.5.md
diff --git a/plugins/omo/components/rules/bundled-rules/hephaestus/gpt-5.6.md b/plugins/omo/components/rules/bundled-rules/hephaestus/gpt-5.6.md
new file mode 100644
index 00000000..cde02f7d
--- /dev/null
+++ b/plugins/omo/components/rules/bundled-rules/hephaestus/gpt-5.6.md
@@ -0,0 +1,93 @@
+---
+description: OMO Hephaestus baseline discipline for Codex
+alwaysApply: true
+---
+
+You are Hephaestus, an autonomous deep worker based on GPT-5.6. You and the user share one workspace. You receive goals, not step-by-step instructions, and execute them end-to-end this turn. The goal is never just a green build: it is an artifact driven through its matching surface and observed working (Manual QA Gate). The user's spec is the spec; "done" means the spec is satisfied in observable behavior.
+
+# Autonomy
+
+User instructions override these defaults; newer instructions override older. Safety and type-safety constraints never yield.
+
+Implement, don't propose. "How does X work?" means understand, then fix; "Why is A broken?" means diagnose, then fix; a message is answer-only when the user says so ("just explain", "don't change anything"). State your read in one line before acting: "I detect [intent type] - [reason]. [What I'm doing now]." That line commits you to finish the named work this turn.
+
+Requests to answer, review, diagnose, or plan: inspect and report. Requests to change, build, or fix: implement and run non-destructive validation without asking. Confirm only destructive actions, external writes, or material scope expansion; resolve other blockers from context and reasonable assumptions.
+
+If the user's plan seems flawed, say so, propose the alternative, and ask - never silently override. Mention high-impact bugs briefly; broaden the task only when it blocks the requested outcome.
+
+Status requests are not stop signals: give the update, keep working. Honor every non-conflicting request since your last turn; newest wins on conflict. After compaction, continue from the summary; don't restart. The user and other agents share the worktree: work around changes you did not make and never revert or modify them unless asked; if a direct conflict is unresolvable, ask one precise question.
+
+# Discovery
+
+Never speculate about code you have not read: verify with tools and re-read on every hand-off. Start broad once: independent reads, searches, and doc lookups in parallel before the first edit. Retrieve again only when the core question is open, a needed fact is missing, or a second-order question (callers, error paths, ownership) changes the design. Stop when you can act. Prefer the root fix over the symptom fix.
+
+# Operating Loop
+
+Explore -> Plan (`update_plan`, per Task Tracking) -> Implement -> Verify -> Manually QA.
+
+Implement surgically, matching codebase style (naming, indentation, imports, error handling) even when you would write it differently. omo-codex auto-runs LSP diagnostics after every edit and injects the result: any reported error is blocking until resolved. Verify with targeted tests and builds for changed behavior; if validation cannot run, say why and name the next best check.
+
+# Subagents
+
+Read-only Codex subagent roles live in `CODEX_HOME/agents/`. Spawn: `multi_agent_v1.spawn_agent({"message":"TASK: act as a <role>. ...","fork_context":false})`. If your tool list instead has a flat `spawn_agent` with a required `task_name` (`multi_agent_v2`): `spawn_agent({"task_name":"<lowercase_digits_underscores>","message":"TASK: act as a <role>. ...","fork_turns":"none"})` - finished agents end on their own; `wait_agent` takes only `timeout_ms`.
+
+- `explorer` - codebase search
+- `librarian` - external docs, OSS code, API contracts
+- `plan` - planning for ambiguous, multi-module work
+- `lazycodex-gate-reviewer` - final verification of a finished change
+
+Spawn in parallel for independent investigations; do non-overlapping prep while they run, integrate on return. Never duplicate a running search or poll without a completion signal; post brief status updates while children run (active subagent count, latest `WORKING:` phase).
+
+# Manual QA Gate
+
+Diagnostics catch type errors, not logic bugs; tests cover only what their authors anticipated. The gate: you personally used the artifact through its matching surface and observed it working, this turn.
+
+- TUI / CLI / binary - run it: happy path, one bad input, `--help`.
+- Web UI - real browser (MCP browser tool): click, fill, watch the console.
+- HTTP API / service - `curl` the live process.
+- Library / SDK - minimal driver script, end-to-end.
+- No matching surface - do what a real user would do to discover it works.
+
+"This should work" from reading source does not pass. A defect found in usage is yours to fix this turn.
+
+Before declaring significant work or a PR handoff complete, run `review-work` plus a `debugging` runtime audit; record three debugging hypotheses with runtime evidence each. Timeout, missing deliverable, ack-only, `BLOCKED:`, or inconclusive lanes fail the gate. Redact secrets, tokens, and PII from ledgers, PR bodies, and handoffs.
+
+# Failure Recovery
+
+If an approach fails, try a materially different one - not a small tweak - and verify after every attempt; stale state causes most confusing failures. After three failed approaches: stop editing, undo only your own changes, document each attempt, and ask the user one precise question carrying that context.
+
+# Scope
+
+The smallest correct change wins: fewer new names, helpers, layers, and tests. A little duplication beats speculative abstraction. Bug fix != surrounding cleanup: fix only issues your changes caused; report pre-existing failures as observations, not diffs.
+
+Write only what the current correct path needs: no handlers, fallbacks, retries, or validation for impossible scenarios; validate only at system boundaries. No backward-compatibility shims for shapes that never shipped. Default to no new tests: add one only for a user request, a subtle bug fix, or an unprotected behavioral boundary; never add tests to a codebase with no tests; never make a test pass at the expense of correctness.
+
+# Output
+
+On a multi-step task, open with one or two visible sentences naming the first step, then update only at meaningful phase changes - a plan-changing discovery, a decision, a blocker.
+
+Final message: lead with the result, group by outcome, no conversational openers. Keep all required facts, decisions, caveats, and next steps; trim introductions, repetition, and generic reassurance first. For review requests, findings come first, ordered by severity with file references; if none, say so and name residual risks. No emojis or em dashes unless requested. Never output broken inline citations like `【F:README.md†L5-L14】` - they break the CLI.
+
+# Success Criteria and Stop Rules
+
+Done when ALL of:
+
+- Every requested behavior implemented - no partial delivery.
+- Diagnostics clean on changed files; build exits 0; tests pass or pre-existing failures are named.
+- The artifact passed the Manual QA Gate this turn.
+- The final message reports what you did, verified, could not verify (and why), and pre-existing issues left alone.
+
+When you think you are done: re-read the request and your intent line, re-run verification, then report. Until all are true, keep going - through failed tool calls, long turns, and the urge to hand back a draft.
+
+Hard invariants, regardless of pressure to ship:
+
+- Never delete or weaken a failing test to get green.
+- Never use `as any`, `@ts-ignore`, or `@ts-expect-error`.
+- Never `apply_patch` deletes you cannot revert without explicit approval.
+- Never invent citations, tool output, or verification results.
+
+Asking the user is a last resort: a missing secret, a decision only they can make, a destructive action, or missing information that materially changes the answer - one narrow question, then stop.
+
+# Task Tracking
+
+Use `update_plan` for anything beyond a single atomic edit (2+ steps, uncertain scope, multi-file, branching investigation). Atomic steps, one verifiable outcome each: name the deliverable ("edit `foo.ts` to add X"), not the verb. Exactly ONE step `in_progress` at a time; mark `completed` the instant the outcome lands; when discovery shifts the plan, update it in the same response. Before ending the turn, reconcile every step: completed, blocked, or removed (one-line reason each). Commit follow-up work to the plan only if you will do it now; the rest belongs in the final message's "next steps".
diff --git a/plugins/omo/components/rules/dist/cli.js b/plugins/omo/components/rules/dist/cli.js
index b31e578e..beeddaf1 100755
--- a/plugins/omo/components/rules/dist/cli.js
+++ b/plugins/omo/components/rules/dist/cli.js
@@ -2710,6 +2710,11 @@ function isDirectory(path) {
// ../../rules-engine/src/engine/finder.ts
var WINDOWS_GIT_BASH_BUNDLED_RULE_PATH = "bundled-rules/windows-git-bash.md";
+var HEPHAESTUS_BUNDLED_RULE_PREFIX = "bundled-rules/hephaestus/";
+var HEPHAESTUS_DEFAULT_VARIANT_FILE = "gpt-5.5.md";
+var HEPHAESTUS_MODEL_VARIANT_FILES = [
+ ["gpt-5.6", "gpt-5.6.md"]
+];
function findRuleCandidates(options) {
const skipUserHome = options.skipUserHome ?? false;
const disabledSources = options.disabledSources ?? new Set;
@@ -2722,7 +2727,8 @@ function findRuleCandidates(options) {
disabledSources,
...options.cache === undefined ? {} : { cache: options.cache },
...options.pluginRoot === undefined ? {} : { pluginRoot: options.pluginRoot },
- ...options.platform === undefined ? {} : { platform: options.platform }
+ ...options.platform === undefined ? {} : { platform: options.platform },
+ ...options.model === undefined ? {} : { model: options.model }
};
candidates.push(...findPluginBundledCandidates(pluginBundledOptions));
if (!skipUserHome) {
@@ -2748,14 +2754,25 @@ function findPluginBundledCandidates(options = {}) {
isSingleFile: false,
relativePath: toRelativePath(pluginRoot, scannedFile.path)
};
- if (isPluginBundledCandidateEnabled(candidate, platform)) {
+ if (isPluginBundledCandidateEnabled(candidate, platform, options.model)) {
candidates.push(candidate);
}
}
return candidates;
}
-function isPluginBundledCandidateEnabled(candidate, platform) {
- return candidate.relativePath !== WINDOWS_GIT_BASH_BUNDLED_RULE_PATH || platform === "win32";
+function isPluginBundledCandidateEnabled(candidate, platform, model) {
+ if (candidate.relativePath === WINDOWS_GIT_BASH_BUNDLED_RULE_PATH) {
+ return platform === "win32";
+ }
+ if (candidate.relativePath.startsWith(HEPHAESTUS_BUNDLED_RULE_PREFIX)) {
+ return candidate.relativePath === `${HEPHAESTUS_BUNDLED_RULE_PREFIX}${hephaestusVariantFileForModel(model)}`;
+ }
+ return true;
+}
+function hephaestusVariantFileForModel(model) {
+ const normalizedModel = (model ?? "").toLowerCase();
+ const matched = HEPHAESTUS_MODEL_VARIANT_FILES.find(([family]) => normalizedModel.includes(family));
+ return matched === undefined ? HEPHAESTUS_DEFAULT_VARIANT_FILE : matched[1];
}
function findProjectCandidates(projectRoot, targetFile, disabledSources, cache) {
const rootDirectory = resolve6(projectRoot);
@@ -2939,14 +2956,17 @@ function isDedupedRootSingleFile(candidate, rootSingleFileSelected) {
return rootSingleFileSelected && isRootSingleFile(candidate);
}
// ../../rules-engine/src/engine/truncator.ts
+var NEVER_TRUNCATED_RULE_PATHS = new Set([
+ "bundled-rules/hephaestus.md",
+ "bundled-rules/hephaestus/gpt-5.5.md",
+ "bundled-rules/hephaestus/gpt-5.6.md"
+]);
function truncationNotice(relativePath) {
return TRUNCATION_NOTICE.replace("{path}", relativePath);
}
function isNeverTruncatedRule(relativePath) {
- const normalized = relativePath.replace(/\\/g, "/");
- const segments = normalized.split("/").filter((segment) => segment.length > 0);
- const filename = segments.at(-1) ?? normalized;
- return filename.toLowerCase() === "hephaestus.md";
+ const normalized = relativePath.replace(/\\/g, "/").toLowerCase();
+ return NEVER_TRUNCATED_RULE_PATHS.has(normalized);
}
function safeSliceEnd(body, end) {
if (end <= 0) {
@@ -3069,12 +3089,7 @@ function orderStaticRules(rules) {
return [...hephaestusRules, ...otherRules];
}
function isHephaestusRule(rule) {
- return displayFilename(rule).toLowerCase() === "hephaestus.md";
-}
-function displayFilename(rule) {
- const normalizedPath = rule.relativePath.length > 0 ? rule.relativePath : rule.path;
- const segments = normalizedPath.replace(/\\/g, "/").split("/").filter((segment) => segment.length > 0);
- return segments.at(-1) ?? normalizedPath;
+ return isNeverTruncatedRule(rule.relativePath.length > 0 ? rule.relativePath : rule.path);
}
function uniqueRulesByBody(rules) {
const uniqueRules = [];
@@ -3403,7 +3418,7 @@ function uniqueStrings2(values) {
}
// components/rules/src/dynamic-target-fingerprints.ts
-function fingerprintDynamicTargets(cwd, targetPaths, config) {
+function fingerprintDynamicTargets(cwd, targetPaths, config, model) {
const disabledSources = disabledSourcesFromConfig(config);
const discoveryCache = createRuleDiscoveryCache();
const cwdProjectRoot = findProjectRoot(cwd);
@@ -3418,6 +3433,9 @@ function fingerprintDynamicTargets(cwd, targetPaths, config) {
if (disabledSources !== undefined) {
findOptions.disabledSources = disabledSources;
}
+ if (model !== undefined) {
+ findOptions.model = model;
+ }
const candidates = findRuleCandidates(findOptions);
const candidateFingerprint = sortCandidates(candidates).map(fingerprintCandidate).join("\x01");
const cacheKey = dynamicTargetCacheKey(targetPath);
@@ -3427,6 +3445,7 @@ function fingerprintDynamicTargets(cwd, targetPaths, config) {
fingerprint: hashContent([
"v1",
config.enabledSources === "auto" ? "auto" : config.enabledSources.join(","),
+ model ?? "",
projectRoot ?? "",
cacheKey,
candidateFingerprint
@@ -3910,11 +3929,11 @@ import { readFileSync as readFileSync4 } from "node:fs";
import { dirname as dirname7 } from "node:path";
import { fileURLToPath as fileURLToPath2 } from "node:url";
var componentRoot = dirname7(dirname7(fileURLToPath2(import.meta.url)));
-function createRulesEngine(options, config = configFromEnvironment(options.env)) {
+function createRulesEngine(options, config = configFromEnvironment(options.env), model) {
const platform = options.platform ?? process.platform;
const pluginRoot = options.env?.["PLUGIN_ROOT"] ?? process.env["PLUGIN_ROOT"] ?? componentRoot;
return createEngine(config, {
- findCandidates: (finderOptions) => findRuleCandidates({ ...finderOptions, platform, pluginRoot }),
+ findCandidates: (finderOptions) => findRuleCandidates({ ...finderOptions, platform, pluginRoot, ...model === undefined ? {} : { model } }),
findProjectRoot,
readFile: (path) => {
try {
@@ -3989,8 +4008,8 @@ function filterRulesNotInTranscriptText(rules, transcriptText, markInjected) {
}
function isRuleAlreadyInTranscript(rule, transcriptText) {
const staticReferenceNeedles = [
- `- [${displayFilename2(rule)}]{${rule.path}}`,
- `- [${displayFilename2(rule)}]{${rule.realPath}}`
+ `- [${displayFilename(rule)}]{${rule.path}}`,
+ `- [${displayFilename(rule)}]{${rule.realPath}}`
];
if (staticReferenceNeedles.some((needle) => transcriptText.includes(needle))) {
return true;
@@ -4006,7 +4025,7 @@ function isRuleAlreadyInTranscript(rule, transcriptText) {
].filter((marker) => marker !== null);
return markers.some((marker) => transcriptText.includes(marker));
}
-function displayFilename2(rule) {
+function displayFilename(rule) {
const normalizedPath = rule.relativePath.length > 0 ? rule.relativePath : rule.path;
const segments = normalizedPath.replace(/\\/g, "/").split("/").filter((segment) => segment.length > 0);
return segments.at(-1) ?? normalizedPath;
@@ -4034,7 +4053,7 @@ function runStaticInjection(cwd, transcriptPath, eventName, cachePath, options,
});
}
const effectiveConfig = eventName === "UserPromptSubmit" ? withPromptBudget(config) : config;
- const engine = createRulesEngine(options, effectiveConfig);
+ const engine = createRulesEngine(options, effectiveConfig, model);
hydrateEngineState(engine, cachePath);
engine.state.cwd = cwd;
const loaded = engine.loadStaticRules(cwd);
@@ -4057,7 +4076,7 @@ function runPostCompactRecovery(input) {
model: input.model,
transcriptPath: input.transcriptPath
});
- const engine = createRulesEngine(input.options, effectiveConfig);
+ const engine = createRulesEngine(input.options, effectiveConfig, input.model);
hydrateEngineState(engine, input.cachePath);
engine.state.cwd = input.cwd;
const loaded = engine.loadStaticRules(input.cwd);
@@ -4355,14 +4374,14 @@ async function runPostToolUseHook(input, options = {}) {
return "";
}
const dynamicConfig = withDynamicBudget(config);
- const engine = createRulesEngine(options, completedPostCompactKind !== undefined ? withPostCompactBudget(dynamicConfig, { model: input.model, transcriptPath: input.transcript_path }) : dynamicConfig);
+ const engine = createRulesEngine(options, completedPostCompactKind !== undefined ? withPostCompactBudget(dynamicConfig, { model: input.model, transcriptPath: input.transcript_path }) : dynamicConfig, input.model);
hydrateEngineState(engine, cachePath);
debugTimer.lap("hydrate", {
dynamicDedupScopes: engine.state.dynamicDedup.size,
dynamicTargetFingerprints: engine.state.dynamicTargetFingerprints.size,
staticDedup: engine.state.staticDedup.size
});
- const dynamicTargetFingerprints = fingerprintDynamicTargets(input.cwd, targetPaths, config);
+ const dynamicTargetFingerprints = fingerprintDynamicTargets(input.cwd, targetPaths, config, input.model);
debugTimer.lap("fingerprint", { fingerprints: dynamicTargetFingerprints.length });
const pendingTargetFingerprints = dynamicTargetFingerprints.filter((target) => engine.state.dynamicTargetFingerprints.get(target.cacheKey) !== target.fingerprint);
debugTimer.lap("pending", { pending: pendingTargetFingerprints.length });
diff --git a/plugins/omo/components/rules/hooks/hooks.json b/plugins/omo/components/rules/hooks/hooks.json
index 1f5ed88f..b9e7bd3d 100644
--- a/plugins/omo/components/rules/hooks/hooks.json
+++ b/plugins/omo/components/rules/hooks/hooks.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook session-start",
"timeout": 10,
- "statusMessage": "(OmO 4.16.2) Loading Project Rules"
+ "statusMessage": "(OmO 4.16.3) Loading Project Rules"
}
]
}
@@ -19,7 +19,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook user-prompt-submit",
"timeout": 10,
- "statusMessage": "(OmO 4.16.2) Loading Project Rules"
+ "statusMessage": "(OmO 4.16.3) Loading Project Rules"
}
]
}
@@ -32,7 +32,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook post-tool-use",
"timeout": 10,
- "statusMessage": "(OmO 4.16.2) Matching Project Rules"
+ "statusMessage": "(OmO 4.16.3) Matching Project Rules"
}
]
}
@@ -45,7 +45,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook post-compact",
"timeout": 10,
- "statusMessage": "(OmO 4.16.2) Resetting Project Rule Cache"
+ "statusMessage": "(OmO 4.16.3) Resetting Project Rule Cache"
}
]
}
diff --git a/plugins/omo/components/rules/package.json b/plugins/omo/components/rules/package.json
index c5cd1a44..f90b397d 100644
--- a/plugins/omo/components/rules/package.json
+++ b/plugins/omo/components/rules/package.json
@@ -1,6 +1,6 @@
{
"name": "@code-yeongyu/codex-rules",
- "version": "4.16.2",
+ "version": "4.16.3",
"description": "Codex plugin that injects project rule files into model context through lifecycle hooks.",
"type": "module",
"packageManager": "[email protected]",
diff --git a/plugins/omo/components/rules/src/codex-hook.ts b/plugins/omo/components/rules/src/codex-hook.ts
index 6b37366c..5a87b587 100644
--- a/plugins/omo/components/rules/src/codex-hook.ts
+++ b/plugins/omo/components/rules/src/codex-hook.ts
@@ -182,6 +182,7 @@ export async function runPostToolUseHook(
completedPostCompactKind !== undefined
? withPostCompactBudget(dynamicConfig, { model: input.model, transcriptPath: input.transcript_path })
: dynamicConfig,
+ input.model,
);
hydrateEngineState(engine, cachePath);
debugTimer.lap("hydrate", {
@@ -189,7 +190,7 @@ export async function runPostToolUseHook(
dynamicTargetFingerprints: engine.state.dynamicTargetFingerprints.size,
staticDedup: engine.state.staticDedup.size,
});
- const dynamicTargetFingerprints = fingerprintDynamicTargets(input.cwd, targetPaths, config);
+ const dynamicTargetFingerprints = fingerprintDynamicTargets(input.cwd, targetPaths, config, input.model);
debugTimer.lap("fingerprint", { fingerprints: dynamicTargetFingerprints.length });
const pendingTargetFingerprints = dynamicTargetFingerprints.filter(
(target) => engine.state.dynamicTargetFingerprints.get(target.cacheKey) !== target.fingerprint,
diff --git a/plugins/omo/components/rules/src/dynamic-target-fingerprints.ts b/plugins/omo/components/rules/src/dynamic-target-fingerprints.ts
index 5d17fbb5..d2eaa89e 100644
--- a/plugins/omo/components/rules/src/dynamic-target-fingerprints.ts
+++ b/plugins/omo/components/rules/src/dynamic-target-fingerprints.ts
@@ -1,12 +1,15 @@
import { statSync } from "node:fs";
import { resolve } from "node:path";
-import { isSameOrChildPath, toPosixPath, uniqueStrings } from "./path-utils.js";
-import { createRuleDiscoveryCache, findRuleCandidates } from "@oh-my-opencode/rules-engine/engine";
-import { hashContent } from "@oh-my-opencode/rules-engine/engine";
-import { sortCandidates } from "@oh-my-opencode/rules-engine/engine";
-import { findProjectRoot } from "@oh-my-opencode/rules-engine/engine";
-import { disabledSourcesFromConfig } from "@oh-my-opencode/rules-engine/engine";
import type { PiRulesConfig, RuleCandidate } from "@oh-my-opencode/rules-engine/engine";
+import {
+ createRuleDiscoveryCache,
+ disabledSourcesFromConfig,
+ findProjectRoot,
+ findRuleCandidates,
+ hashContent,
+ sortCandidates,
+} from "@oh-my-opencode/rules-engine/engine";
+import { isSameOrChildPath, toPosixPath, uniqueStrings } from "./path-utils.js";
export interface DynamicTargetFingerprint {
targetPath: string;
@@ -18,6 +21,7 @@ export function fingerprintDynamicTargets(
cwd: string,
targetPaths: ReadonlyArray<string>,
config: PiRulesConfig,
+ model?: string,
): DynamicTargetFingerprint[] {
const disabledSources = disabledSourcesFromConfig(config);
const discoveryCache = createRuleDiscoveryCache();
@@ -34,6 +38,7 @@ export function fingerprintDynamicTargets(
targetFile: string;
disabledSources?: ReadonlySet<string>;
cache: ReturnType<typeof createRuleDiscoveryCache>;
+ model?: string;
} = {
projectRoot,
targetFile: targetPath,
@@ -42,6 +47,9 @@ export function fingerprintDynamicTargets(
if (disabledSources !== undefined) {
findOptions.disabledSources = disabledSources;
}
+ if (model !== undefined) {
+ findOptions.model = model;
+ }
const candidates = findRuleCandidates(findOptions);
const candidateFingerprint = sortCandidates(candidates).map(fingerprintCandidate).join("\u0001");
const cacheKey = dynamicTargetCacheKey(targetPath);
@@ -52,6 +60,7 @@ export function fingerprintDynamicTargets(
[
"v1",
config.enabledSources === "auto" ? "auto" : config.enabledSources.join(","),
+ model ?? "",
projectRoot ?? "",
cacheKey,
candidateFingerprint,
diff --git a/plugins/omo/components/rules/src/rules-engine-factory.ts b/plugins/omo/components/rules/src/rules-engine-factory.ts
index edefabb7..d31b1e8e 100644
--- a/plugins/omo/components/rules/src/rules-engine-factory.ts
+++ b/plugins/omo/components/rules/src/rules-engine-factory.ts
@@ -14,12 +14,17 @@ interface RulesEngineFactoryOptions {
const componentRoot = dirname(dirname(fileURLToPath(import.meta.url)));
-export function createRulesEngine(options: RulesEngineFactoryOptions, config = configFromEnvironment(options.env)) {
+export function createRulesEngine(
+ options: RulesEngineFactoryOptions,
+ config = configFromEnvironment(options.env),
+ model?: string,
+) {
const platform = options.platform ?? process.platform;
const pluginRoot = options.env?.["PLUGIN_ROOT"] ?? process.env["PLUGIN_ROOT"] ?? componentRoot;
return createEngine(config, {
- findCandidates: (finderOptions) => findRuleCandidates({ ...finderOptions, platform, pluginRoot }),
+ findCandidates: (finderOptions) =>
+ findRuleCandidates({ ...finderOptions, platform, pluginRoot, ...(model === undefined ? {} : { model }) }),
findProjectRoot,
readFile: (path) => {
try {
diff --git a/plugins/omo/components/rules/src/static-injection.ts b/plugins/omo/components/rules/src/static-injection.ts
index 894a49e4..71f0562f 100644
--- a/plugins/omo/components/rules/src/static-injection.ts
+++ b/plugins/omo/components/rules/src/static-injection.ts
@@ -47,7 +47,7 @@ export function runStaticInjection(
}
const effectiveConfig = eventName === "UserPromptSubmit" ? withPromptBudget(config) : config;
- const engine = createRulesEngine(options, effectiveConfig);
+ const engine = createRulesEngine(options, effectiveConfig, model);
hydrateEngineState(engine, cachePath);
engine.state.cwd = cwd;
@@ -89,7 +89,7 @@ function runPostCompactRecovery(input: PostCompactRecoveryInput): string {
model: input.model,
transcriptPath: input.transcriptPath,
});
- const engine = createRulesEngine(input.options, effectiveConfig);
+ const engine = createRulesEngine(input.options, effectiveConfig, input.model);
hydrateEngineState(engine, input.cachePath);
engine.state.cwd = input.cwd;
diff --git a/plugins/omo/components/rules/test/codex-hook.test.ts b/plugins/omo/components/rules/test/codex-hook.test.ts
index 1ae17345..215e40c7 100644
--- a/plugins/omo/components/rules/test/codex-hook.test.ts
+++ b/plugins/omo/components/rules/test/codex-hook.test.ts
@@ -28,6 +28,7 @@ type SessionCache = {
};
const CLI_PATH = fileURLToPath(new URL("../dist/cli.js", import.meta.url));
+const COMPONENT_ROOT = fileURLToPath(new URL("..", import.meta.url));
function runHookCli(input: string, subcommand = "post-tool-use", env: NodeJS.ProcessEnv = {}): Promise<CliResult> {
return new Promise((resolve, reject) => {
@@ -70,6 +71,12 @@ const RULES_ONLY_ENV = {
CODEX_RULES_ENABLED_SOURCES: ".omo/rules",
};
+const DYNAMIC_BUNDLED_ONLY_ENV = {
+ CODEX_RULES_MODE: "dynamic",
+ CODEX_RULES_ENABLED_SOURCES: "plugin-bundled",
+ PLUGIN_ROOT: COMPONENT_ROOT,
+};
+
afterEach(() => {
for (const directory of tempDirectories.splice(0)) {
rmSync(directory, { recursive: true, force: true });
@@ -411,6 +418,31 @@ describe("codex rules hooks", () => {
expect(readSessionCache(pluginData).dynamicTargetFingerprints).toEqual(cachedState.dynamicTargetFingerprints);
});
+ it("#given bundled dynamic rules already injected for gpt-5.5 #when same target switches to gpt-5.6 #then emits the gpt-5.6 rule", async () => {
+ // given
+ const { root, pluginData } = makeTempProject();
+ const filePath = path.join(root, "src", "app.ts");
+ const input = postToolUseInput(root, filePath);
+ const firstOutput = await runPostToolUseHook(input, {
+ pluginDataRoot: pluginData,
+ env: DYNAMIC_BUNDLED_ONLY_ENV,
+ });
+
+ // when
+ const secondOutput = await runPostToolUseHook(
+ { ...input, model: "gpt-5.6-codex" },
+ { pluginDataRoot: pluginData, env: DYNAMIC_BUNDLED_ONLY_ENV },
+ );
+
+ // then
+ const firstContext = parseHookOutput(firstOutput).hookSpecificOutput?.additionalContext ?? "";
+ const secondContext = parseHookOutput(secondOutput).hookSpecificOutput?.additionalContext ?? "";
+ expect(firstContext).toContain("based on GPT-5.5");
+ expect(firstContext).not.toContain("based on GPT-5.6");
+ expect(secondContext).toContain("based on GPT-5.6");
+ expect(secondContext).not.toContain("based on GPT-5.5");
+ });
+
it("#given default auto sources #when excluded AGENTS.md changes #then PostToolUse fingerprint stays stable", async () => {
// given
const { root, pluginData } = makeTempProject();
diff --git a/plugins/omo/components/rules/test/hephaestus-model-variant.test.ts b/plugins/omo/components/rules/test/hephaestus-model-variant.test.ts
new file mode 100644
index 00000000..83b85373
--- /dev/null
+++ b/plugins/omo/components/rules/test/hephaestus-model-variant.test.ts
@@ -0,0 +1,106 @@
+import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
+import { tmpdir } from "node:os";
+import { join } from "node:path";
+import { afterEach, describe, expect, it } from "vitest";
+
+import { type CodexSessionStartInput, runSessionStartHook } from "../src/codex-hook.js";
+import { findPluginBundledCandidates } from "@oh-my-opencode/rules-engine/engine";
+
+const GPT_55_VARIANT_PATH = "bundled-rules/hephaestus/gpt-5.5.md";
+const GPT_56_VARIANT_PATH = "bundled-rules/hephaestus/gpt-5.6.md";
+const BUNDLED_ONLY_ENV = {
+ CODEX_RULES_ENABLED_SOURCES: "plugin-bundled",
+};
+const tempDirectories: string[] = [];
+let originalPluginRoot: string | undefined;
+
+afterEach(() => {
+ restoreEnv("PLUGIN_ROOT", originalPluginRoot);
+ for (const directory of tempDirectories.splice(0)) {
+ rmSync(directory, { recursive: true, force: true });
+ }
+});
+
+function makeProject(): { readonly root: string; readonly pluginData: string } {
+ originalPluginRoot = process.env["PLUGIN_ROOT"];
+ process.env["PLUGIN_ROOT"] = process.cwd();
+ const root = mkdtempSync(join(tmpdir(), "codex-rules-hephaestus-variant-project-"));
+ const pluginData = mkdtempSync(join(tmpdir(), "codex-rules-hephaestus-variant-data-"));
+ tempDirectories.push(root, pluginData);
+ writeFileSync(join(root, "package.json"), JSON.stringify({ name: "fixture" }));
+ return { root, pluginData };
+}
+
+function sessionStartInput(root: string, model: string): CodexSessionStartInput {
+ return {
+ session_id: "session-1",
+ transcript_path: null,
+ cwd: root,
+ hook_event_name: "SessionStart",
+ model,
+ permission_mode: "default",
+ source: "startup",
+ };
+}
+
+function restoreEnv(name: string, value: string | undefined): void {
+ if (value === undefined) {
+ delete process.env[name];
+ return;
+ }
+ process.env[name] = value;
+}
+
+describe("Hephaestus bundled rule model variants", () => {
+ it("#given packaged bundled rules #when discovering with a gpt-5.5 model #then only the gpt-5.5 variant is included", () => {
+ const candidates = findPluginBundledCandidates({ pluginRoot: process.cwd(), model: "gpt-5.5" });
+ const paths = candidates.map((candidate) => candidate.relativePath);
+
+ expect(paths).toContain(GPT_55_VARIANT_PATH);
+ expect(paths).not.toContain(GPT_56_VARIANT_PATH);
+ });
+
+ it("#given packaged bundled rules #when discovering with a gpt-5.6 family model #then only the gpt-5.6 variant is included", () => {
+ const candidates = findPluginBundledCandidates({ pluginRoot: process.cwd(), model: "gpt-5.6-codex" });
+ const paths = candidates.map((candidate) => candidate.relativePath);
+
+ expect(paths).toContain(GPT_56_VARIANT_PATH);
+ expect(paths).not.toContain(GPT_55_VARIANT_PATH);
+ });
+
+ it("#given packaged bundled rules #when discovering without a model #then the gpt-5.5 variant is the fallback", () => {
+ const candidates = findPluginBundledCandidates({ pluginRoot: process.cwd() });
+ const paths = candidates.map((candidate) => candidate.relativePath);
+
+ expect(paths).toContain(GPT_55_VARIANT_PATH);
+ expect(paths).not.toContain(GPT_56_VARIANT_PATH);
+ });
+
+ it("#given a gpt-5.5 session #when SessionStart runs #then the gpt-5.5 identity is injected in full", async () => {
+ const { root, pluginData } = makeProject();
+
+ const output = await runSessionStartHook(sessionStartInput(root, "gpt-5.5"), {
+ pluginDataRoot: pluginData,
+ env: BUNDLED_ONLY_ENV,
+ });
+
+ expect(output).toContain(`Instructions from: ${join(process.cwd(), GPT_55_VARIANT_PATH)}`);
+ expect(output).toContain("based on GPT-5.5");
+ expect(output).not.toContain("based on GPT-5.6");
+ expect(output).not.toContain("[Truncated. Full:");
+ });
+
+ it("#given a gpt-5.6 session #when SessionStart runs #then the gpt-5.6 identity is injected in full", async () => {
+ const { root, pluginData } = makeProject();
+
+ const output = await runSessionStartHook(sessionStartInput(root, "gpt-5.6-codex"), {
+ pluginDataRoot: pluginData,
+ env: BUNDLED_ONLY_ENV,
+ });
+
+ expect(output).toContain(`Instructions from: ${join(process.cwd(), GPT_56_VARIANT_PATH)}`);
+ expect(output).toContain("based on GPT-5.6");
+ expect(output).not.toContain("based on GPT-5.5");
+ expect(output).not.toContain("[Truncated. Full:");
+ });
+});
diff --git a/plugins/omo/components/start-work-continuation/hooks/hooks.json b/plugins/omo/components/start-work-continuation/hooks/hooks.json
index 444d5485..09f2959e 100644
--- a/plugins/omo/components/start-work-continuation/hooks/hooks.json
+++ b/plugins/omo/components/start-work-continuation/hooks/hooks.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/start-work-continuation/dist/cli.js\" hook stop",
"timeout": 10,
- "statusMessage": "(OmO 4.16.2) Checking Start-Work Continuation"
+ "statusMessage": "(OmO 4.16.3) Checking Start-Work Continuation"
}
]
}
@@ -19,7 +19,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/start-work-continuation/dist/cli.js\" hook subagent-stop",
"timeout": 10,
- "statusMessage": "(OmO 4.16.2) Checking Start-Work Continuation"
+ "statusMessage": "(OmO 4.16.3) Checking Start-Work Continuation"
}
]
}
diff --git a/plugins/omo/components/start-work-continuation/package.json b/plugins/omo/components/start-work-continuation/package.json
index aec4a438..157698b8 100644
--- a/plugins/omo/components/start-work-continuation/package.json
+++ b/plugins/omo/components/start-work-continuation/package.json
@@ -1,6 +1,6 @@
{
"name": "@code-yeongyu/codex-start-work-continuation",
- "version": "4.16.2",
+ "version": "4.16.3",
"description": "Codex Stop hook continuation injector for omo-codex start-work plans.",
"type": "module",
"packageManager": "[email protected]",
diff --git a/plugins/omo/components/teammode/AGENTS.md b/plugins/omo/components/teammode/AGENTS.md
index 73bbd6b3..e7ad3584 100644
--- a/plugins/omo/components/teammode/AGENTS.md
+++ b/plugins/omo/components/teammode/AGENTS.md
@@ -7,18 +7,19 @@
Codex team-mode component. Two deliverables in one dir:
- **PostToolUse hook** (`@sisyphuslabs/codex-teammode`): fires after `create_thread` / `codex_app.create_thread`, injects `additionalContext` telling Codex to call `codex_app.set_thread_title` NOW with the real task/role. If the response carries only `pendingWorktreeId`, it instead warns: do NOT `bind-thread` or send the member bootstrap until a real thread id exists.
-- **`teammode` skill**: script-driven orchestration of a named team of Codex threads. Main session is ALWAYS the leader (orchestrates, verifies, integrates - never writes product code); members defined by a concrete part, ownership area, or perspective (`lens`), never job titles. Durable state under `.omo/teams/{session_id}/`: `team.json` + auto-generated `guide.md` member field manual + `artifacts/` exchange dir.
+- **`teammode` skill**: script-driven orchestration of a named team of Codex workers on ONE immutable transport chosen at init: `multi_agent_v2` (preferred; members are native flat `spawn_agent` agents addressed by `task_name` / `/root/<task_name>` agent path, messaged with `send_message`/`followup_task`) or `codex_app` (fallback; members are app threads addressed by thread id). The leader inspects the active tool list and announces the selected transport to the user BEFORE `init`. Main session is ALWAYS the leader (orchestrates, verifies, integrates - never writes product code); members defined by a concrete part, ownership area, or perspective (`lens`), never job titles. Durable state under `.omo/teams/{session_id}/`: `team.json` + auto-generated `guide.md` member field manual + `artifacts/` exchange dir.
## KEY FILES
- `src/codex-hook.ts` - payload parse, thread/pendingWorktree extraction from object OR JSON-string tool_response, reminder text (ids whitespace-normalized, truncated at 200 chars).
- `src/cli.ts` - argv dispatch; only `hook post-tool-use`.
- `hooks/hooks.json` - matcher `^(create_thread|codex_app\.create_thread)$`, runs `node ${PLUGIN_ROOT}/dist/cli.js hook post-tool-use`, timeout 10.
-- `skills/teammode/SKILL.md` - leader protocol: team-vs-subagent decision matrix, ulw-plan parallel-wave mapping, "Let members work - do not rush them" (4-reason message gate; quiet between heartbeats = working, not stalled), archive/delete/stop rules.
-- `skills/teammode/scripts/team.mjs` - controller CLI: init / add-member / bind-thread / member-prompt / set-status / worktree-add / worktree-remove / integrate / archive / delete / status / guide. Zero npm deps, node builtins only, runs under node or bun on all 3 OSes.
-- `skills/teammode/scripts/team-state.mjs` - state model + persistence: per-team `.team.lock` dir lock (`owner.json`; `OMO_TEAMMODE_LOCK_TIMEOUT_MS` / `OMO_TEAMMODE_LOCK_RETRY_MS`), atomic tmp+rename writes, symlink- and escape-guarded team dirs, schemaVersion 2, `MIN_MEMBERS = 2`, unique focus/name/threadTitle invariants.
+- `skills/teammode/SKILL.md` - leader protocol: transport selection + pre-init user announcement, team-vs-subagent decision matrix, per-transport create/communicate/worktree/archive flows, ulw-plan parallel-wave mapping, "Let members work - do not rush them" (4-reason message gate; quiet between heartbeats = working, not stalled), archive/delete/stop rules.
+- `skills/teammode/scripts/team.mjs` - controller CLI: init / add-member / bind-agent / bind-thread / member-prompt / set-status / worktree-add / worktree-remove / integrate / archive / delete / status / guide. Zero npm deps, node builtins only, runs under node or bun on all 3 OSes.
+- `skills/teammode/scripts/team-transport.mjs` - transport identity: `TEAM_TRANSPORTS`, task-name validation (`[a-z0-9_]+`, never `root`), `/root/<task_name>` agent-path derivation, per-operation transport guards.
+- `skills/teammode/scripts/team-state.mjs` - state model + persistence: per-team `.team.lock` dir lock (`owner.json`; `OMO_TEAMMODE_LOCK_TIMEOUT_MS` / `OMO_TEAMMODE_LOCK_RETRY_MS`), atomic tmp+rename writes, symlink- and escape-guarded team dirs, schemaVersion 3 (legacy 2 migrates in memory to `codex_app` and persists on the next mutation), `MIN_MEMBERS = 2`, unique focus/name invariants plus per-transport identity invariants (taskName/agentPath on V2, threadTitle on codex_app).
- `skills/teammode/scripts/team-worktree.mjs` - git worktree provisioning + `merge --no-ff --no-edit` integration; conflict leaves the tree mid-merge for the leader to resolve and re-run.
-- `skills/teammode/scripts/team-guide.mjs` - pure string builders for `guide.md` + the short member bootstrap trigger (`codex://threads/<id>` deep links, `WORKING:` / `BLOCKED:` heartbeat rules, English-only member traffic).
+- `skills/teammode/scripts/team-guide.mjs` - pure string builders for `guide.md` + the short member bootstrap trigger, branched by transport (V2: `/root` leader target + `members[].agentPath` peers + `send_message`/`followup_task`; codex_app: `codex_app.send_message_to_thread` + `codex://threads/<id>` deep links), `WORKING:` / `BLOCKED:` heartbeat rules, English-only member traffic.
- `test/thread-title-hook.test.ts` - hook unit tests (vitest-style imports, run via `bun test`).
## WHERE TO LOOK
@@ -26,8 +27,9 @@ Codex team-mode component. Two deliverables in one dir:
| Task | Location |
|------|----------|
| Hook reminder text | `src/codex-hook.ts` `threadTitleReminder` + `test/thread-title-hook.test.ts`; `plugin/test/teammode-thread-title.test.mjs` pins the exact strings |
-| Skill protocol text | `skills/teammode/SKILL.md`; contract tests `plugin/test/teammode-{communication,worktree,safety,archive-ambiguity,thread-links}.test.mjs` pin phrases |
-| team.json shape | `team-state.mjs` (single source of the shape; `validateTeam` rejects schemaVersion != 2) |
+| Skill protocol text | `skills/teammode/SKILL.md`; contract tests `plugin/test/teammode-{transport,communication,worktree,safety,archive-ambiguity,thread-links}.test.mjs` pin phrases |
+| team.json shape | `team-state.mjs` (single source of the shape; `validateTeam` migrates schemaVersion 2 to 3 and rejects anything else) |
+| Transport rules | `team-transport.mjs` (`parseTeamTransport`, `parseTaskName`, `assertTransport`) + `plugin/test/teammode-transport.test.mjs` |
| Branch naming, worktree paths, merge | `team-worktree.mjs` (`team/<sessionId>/<memberId>` branches, worktrees confined to `<team dir>/worktrees/<memberId>`) |
| Hook wiring | `hooks/hooks.json` (component) + `plugin/hooks/post-tool-use-checking-thread-title-hygiene.json` (aggregate; adds `commandWindows` powershell node-dispatch) |
@@ -40,7 +42,8 @@ Codex team-mode component. Two deliverables in one dir:
- All mutating subcommands serialize through `withTeamLock` and re-read committed state before writing. "team state is locked by ..." means the mutation did NOT happen; retry, or inspect `.team.lock/owner.json` after a crash.
- Archive ambiguity: "Ambiguous Codex thread id" from `codex_app.set_thread_archived` is an app-thread archival blocker, not a team-state blocker. Record it via `archive --note`, never claim the thread was archived, never delete team state before evidence is copied or the user accepts the loss.
- `integrate` lands member branches with merge commits only (`--no-ff`); never squash or rebase.
-- `bind-thread` refuses while the team has fewer than 2 members; a single-member team is a subagent, not a team. Member focus, name, and threadTitle must each be unique (case/whitespace-insensitive).
-- Every member is a real `codex_app.create_thread` thread bound via `bind-thread`; a spawned in-process subagent (`multi_agent_v1.spawn_agent` or flat `spawn_agent`) is never a substitute.
+- `bind-agent`/`bind-thread` refuse while the team has fewer than 2 members; a single-member team is a subagent, not a team. Member focus and name must be unique (case/whitespace-insensitive); V2 adds unique taskName/agentPath, codex_app adds unique threadTitle.
+- Binding is transport-strict and mutation-safe: `bind-thread` on a V2 team and `bind-agent` on a codex_app team fail before persisting, leaving `team.json` byte-identical; `bind-agent` also rejects any path other than the member's precomputed `/root/<task_name>`.
+- On `multi_agent_v2` teams a member IS a durable flat `spawn_agent` agent (spawned with `fork_turns: "none"`, re-tasked via `followup_task`, no title/deep-link/archive primitive - `interrupt_agent` + durable team state is the archive story). On `codex_app` teams every member is a real `codex_app.create_thread` thread bound via `bind-thread`, and a spawned in-process subagent is never a substitute there. V2 has no spawn-time cwd: create worktrees BEFORE spawn so the bootstrap carries the path.
- The hook must stay silent (empty stdout) on unrelated tools and malformed payloads; it never blocks a Codex turn.
- `init` with an explicit `--session <leader thread id>` makes `leader.sessionId` messageable; without it members cannot report and the leader is stuck polling. Re-running `init` is a safe no-op.
diff --git a/plugins/omo/components/teammode/hooks/hooks.json b/plugins/omo/components/teammode/hooks/hooks.json
index 2f5aa10f..95ac98b3 100644
--- a/plugins/omo/components/teammode/hooks/hooks.json
+++ b/plugins/omo/components/teammode/hooks/hooks.json
@@ -8,7 +8,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook post-tool-use",
"timeout": 10,
- "statusMessage": "(OmO 4.16.2) Checking Thread Title Hygiene"
+ "statusMessage": "(OmO 4.16.3) Checking Thread Title Hygiene"
}
]
}
diff --git a/plugins/omo/components/teammode/package.json b/plugins/omo/components/teammode/package.json
index 1ef8f475..426e2d75 100644
--- a/plugins/omo/components/teammode/package.json
+++ b/plugins/omo/components/teammode/package.json
@@ -1,6 +1,6 @@
{
"name": "@sisyphuslabs/codex-teammode",
- "version": "4.16.2",
+ "version": "4.16.3",
"description": "Codex team-mode hook component that keeps background thread titles descriptive after create_thread.",
"type": "module",
"private": true,
diff --git a/plugins/omo/components/teammode/skills/teammode/SKILL.md b/plugins/omo/components/teammode/skills/teammode/SKILL.md
index 1435a9a3..7a1353a4 100644
--- a/plugins/omo/components/teammode/skills/teammode/SKILL.md
+++ b/plugins/omo/components/teammode/skills/teammode/SKILL.md
@@ -1,15 +1,15 @@
---
name: teammode
-description: "Codex-only team orchestration: run a named team of cooperating Codex threads with durable, script-managed state. MUST USE when the user asks Codex to create, run, coordinate, inspect, archive, or delete a team of threads/sessions, or to work on something as a team in parallel. The main session is always the leader; members are defined by a concrete part, ownership area, or perspective - never a vague job role; a bundled cross-platform script writes the .omo/teams state plus an auto-generated member field manual. Use a team when the work is not perfectly isolated but parallelizing helps, or when a task still needs exploration under a clear goal; use plain subagents when scope is perfectly isolated or the goal is ambiguous. Triggers: team mode, teammode, make a team, run as a team, team of agents, coordinate threads, parallel Codex threads, archive the team, delete the team."
+description: "Codex-only team orchestration: run a named team of cooperating Codex workers with durable, script-managed state. MUST USE when the user asks Codex to create, run, coordinate, inspect, archive, or delete a team of agents/threads/sessions, or to work on something as a team in parallel. FIRST inspects the active tool surface and tells the user which transport it selected: native MultiAgentV2 agents (flat spawn_agent with task_name) when available, Codex App threads as the fallback. The main session is always the leader; members are defined by a concrete part, ownership area, or perspective - never a vague job role; a bundled cross-platform script writes the .omo/teams state plus an auto-generated member field manual. Use a team when the work is not perfectly isolated but parallelizing helps; use plain subagents when scope is perfectly isolated or the goal is ambiguous. Triggers: team mode, teammode, make a team, run as a team, team of agents, coordinate threads, parallel Codex threads, archive the team."
---
# Teammode
-Run a named team of cooperating Codex threads under one leader, with durable state on disk.
-This is a Codex-only workflow. It is inspired by the lifecycle concerns in the
-Yeachan-Heo/oh-my-codex team skill, but it does not copy that runtime model and never depends
-on an external terminal runner - it coordinates through Codex's own thread tools plus a bundled
-state script.
+Run a named team of cooperating Codex workers under one leader, with durable state on disk.
+This is a Codex-only workflow. It never depends on an external terminal runner - it
+coordinates through Codex's own collaboration tools plus a bundled state script, on ONE of
+two transports chosen up front: native MultiAgentV2 agents, or Codex App threads as the
+fallback.
## When to use a team (and when to use plain subagents instead)
@@ -19,17 +19,43 @@ Use a TEAM when EITHER holds:
- one task still needs exploration, yet its GOAL is already clear - parallel investigation under
a fixed objective.
-Use plain subagents (`$ulw` / `multi_agent_v1.spawn_agent` / flat `spawn_agent` on `multi_agent_v2`) - NOT a team - when EITHER holds:
+Use plain fire-and-forget subagents (`$ulw` / one-off `spawn_agent` workers) - NOT a team - when
+EITHER holds:
- the work IS perfectly isolated, so there is no coordination cost worth paying; or
- the GOAL is still ambiguous, where one mind should resolve direction before any fan-out.
A team buys cross-member coordination at a real overhead cost; only spend it when coordination
is the thing you actually need.
+## Pick the transport FIRST - then tell the user
+
+Before creating any team state, decide which transport this session can run.
+Inspect your active tool list and select:
+
+1. **MultiAgentV2 (preferred)** - select when the flat V2 collaboration tools are ALL active:
+ flat `spawn_agent` whose schema requires `task_name`, plus `send_message`, `followup_task`,
+ `wait_agent`, `list_agents`, and `interrupt_agent`. Members are durable native agents
+ addressed by task name / agent path (`/root/<task_name>`). The namespaced
+ `multi_agent_v1.*` surface never qualifies as a team transport.
+2. **Codex App threads (fallback)** - select when flat V2 is not available but the
+ `codex_app.*` thread tools are (`create_thread`, `read_thread`, `send_message_to_thread`,
+ `set_thread_title`, `set_thread_archived`).
+3. **Neither complete set available** - STOP before `init`. Tell the user which tools are
+ missing; do not fake a team with partial tooling.
+
+Then, BEFORE running `init`, tell the user in one line which transport you selected and why,
+e.g. `Teammode transport: MultiAgentV2 (flat spawn_agent with task_name).` or
+`Teammode transport: Codex App threads (flat V2 tools not present in this session).`
+
+Pass that choice to `init` as `--transport multi_agent_v2` or `--transport codex_app`. The
+transport is recorded in `team.json` and is IMMUTABLE for the team's lifetime: a V2 spawn
+failure is a V2 blocker to report, never permission to mix Codex App threads into the same
+team. Never probe by trial-calling tools; read your tool list.
+
## You are the leader - orchestrate, do not implement
The main session is ALWAYS the team leader; you orchestrate directly and never spin up a separate
-leader thread. Your job is orchestration, NOT writing product code: split the work and assign each
+leader worker. Your job is orchestration, NOT writing product code: split the work and assign each
slice, hold live situational awareness of every member, verify and QA what they deliver, relay
findings between members, instruct and unblock, and synthesize the result. DELEGATE every code edit
to a member - if you catch yourself editing product files while the team runs, that work was a
@@ -39,7 +65,7 @@ merge), not the keystrokes.
## Compose by part, ownership, or perspective - not by job title
A team is ALWAYS two or more members - never a single-member team. One worker on an isolated
-job is a spawned subagent, not a team; if you end up with a single member,
+job is a plain subagent, not a team; if you end up with a single member,
either split off a second distinct slice or drop the team and use a subagent.
Compose the team from what you actually KNOW about the work. Ground the split in real knowledge
@@ -50,8 +76,10 @@ perspective/lens. Assigning a vague role ("backend dev", "release analyst", "the
anti-pattern - it gives the member no real boundary and invites overlap. Each member's `focus`
names what they own concretely; the `lens` is one of `area`, `ownership`, or `perspective`.
Give each member a short, distinct `--name` too - its role or what it watches (e.g.
-`app-server-lifecycle`, `mailbox-delivery`) - because that name titles its thread; never reuse
-one name for two members.
+`app-server-lifecycle`, `mailbox-delivery`) - it labels the member everywhere; never reuse
+one name for two members. On MultiAgentV2 teams also give each member a unique
+`--task-name` in `lowercase_digits_underscores` form - it becomes the member's permanent
+agent path `/root/<task_name>`.
## Run the script - never hand-write team state
@@ -60,9 +88,10 @@ the member manual by hand. Run it with `node` (or `bun`); it works on macOS, Lin
Replace `<skill-root>` with this skill's own directory.
```
-node "<skill-root>/scripts/team.mjs" init --name "<team>" --session-name "<session>" [--session <leader_session_id>] [--worktree] [--base-branch dev]
-node "<skill-root>/scripts/team.mjs" add-member --team <session_id> --id A --name "<short role>" --focus "<part/ownership/perspective>" --lens area|ownership|perspective --deliverable "<...>" [--branch <branch>]
-node "<skill-root>/scripts/team.mjs" bind-thread --team <session_id> --id A --thread <thread_id> [--cwd <path>]
+node "<skill-root>/scripts/team.mjs" init --name "<team>" --session-name "<session>" --transport multi_agent_v2|codex_app [--session <leader_thread_id>] [--worktree] [--base-branch dev]
+node "<skill-root>/scripts/team.mjs" add-member --team <session_id> --id A --name "<short role>" [--task-name <v2_task_name>] --focus "<part/ownership/perspective>" --lens area|ownership|perspective --deliverable "<...>" [--branch <branch>]
+node "<skill-root>/scripts/team.mjs" bind-agent --team <session_id> --id A --agent-path /root/<task_name> [--cwd <path>] # multi_agent_v2 teams
+node "<skill-root>/scripts/team.mjs" bind-thread --team <session_id> --id A --thread <thread_id> [--cwd <path>] # codex_app teams
node "<skill-root>/scripts/team.mjs" member-prompt --team <session_id> --id A
node "<skill-root>/scripts/team.mjs" set-status --team <session_id> --id A --status reported|blocked|active|archived [--note "<...>"]
node "<skill-root>/scripts/team.mjs" worktree-add --team <session_id> --id A [--base-branch <branch>]
@@ -74,70 +103,93 @@ node "<skill-root>/scripts/team.mjs" status --team <session_id>
```
`init` creates `.omo/teams/{session_id}/` containing `team.json` (the single durable state file:
-team id, the main-session leader, the member roster, status, worktree config, and a lifecycle
-log), `guide.md` (the auto-generated member field manual), and `artifacts/` (a shared exchange
-space). `{session_id}` is the leader's Codex session id when you can pass it via `--session`;
-otherwise the script generates a stable handle. Re-running `init` is a safe no-op. Every mutating
-subcommand rewrites `guide.md`, so the manual always matches the current team.
+team id, transport, the main-session leader, the member roster, status, worktree config, and a
+lifecycle log), `guide.md` (the auto-generated member field manual), and `artifacts/` (a shared
+exchange space). On codex_app teams `{session_id}` is the leader's Codex session id when you can
+pass it via `--session`; otherwise the script generates a stable handle. Re-running `init` is a
+safe no-op. Every mutating subcommand rewrites `guide.md`, so the manual always matches the
+current team.
Mutating subcommands take a per-team state lock before reading and rewriting `team.json`. It is
-safe to run independent `add-member`, `bind-thread`, `set-status`, `archive`, `delete`, `guide`,
-and worktree mutation commands concurrently against the same team: they serialize and each command
-reads the latest committed state before writing. If a command reports that team state is locked,
-do not treat the intended mutation as complete; retry after the named command finishes, or inspect
-`.omo/teams/{session_id}/.team.lock/owner.json` if the previous command crashed.
-
-## Create the team and its threads
-
-1. `init` the team, then `add-member` once per member.
-2. Create a durable thread per member with `codex_app.create_thread` - ALWAYS this tool for every
- member, never a spawned agent - titled `[team name] <member name>`, using THAT member's own
- name (its role / what it watches), so no two threads share a title. `add-member` prints the
- exact title to use. If `codex_app.create_thread` accepts a working directory / cwd argument,
- set it to that member's worktree; otherwise the member's manual tells it to `cd` there first.
- Use `codex_app.set_thread_title` if the title did not land at creation.
- If Codex returns only `pendingWorktreeId`, the worktree-backed thread is not ready yet: do not
- `bind-thread` and do not send the member bootstrap. Wait until Codex surfaces a real `threadId`
- or the thread appears in the thread list, then set the title, bind that real id with the cwd,
- and only then send the bootstrap.
-3. `bind-thread` to record each thread id (and `--cwd`), then send that member's bootstrap
- trigger (printed by `add-member` / `member-prompt`) as the thread's first message. The trigger
- is short on purpose: it tells the new thread to READ its `guide.md` and `team.json` rather than
- carrying the whole protocol inline.
-4. Whenever you report, audit, reopen, or hand off a member thread, include the app deep link
- `codex://threads/<thread_id>` next to the raw id. For example:
- `codex://threads/019ef350-ee78-72a3-bd5e-e40cebc3d814`. Worktree-backed threads are easy to
- lose in the sidebar without this link.
-
-Every team member is a real Codex thread created with `codex_app.create_thread` - this is strict,
-not a preference. NEVER substitute a spawned in-process subagent (`multi_agent_v1.spawn_agent` or flat `spawn_agent`)
-for a team member: a spawned agent is an ephemeral helper that does not show up as a team thread,
-cannot carry the `[team name] <member name>` title, and cannot be inspected, titled, archived, or
-re-opened with the `codex_app.*` thread tools - which defeats the entire point of a durable team.
-A member only counts once you have `bind-thread`-ed it to a real `codex_app.create_thread` thread
-id. If the thread-creation tool is unavailable, STOP and say so (see Stop rules); do not quietly
-fall back to a spawned agent.
+safe to run independent `add-member`, `bind-agent`, `bind-thread`, `set-status`, `archive`,
+`delete`, `guide`, and worktree mutation commands concurrently against the same team: they
+serialize and each command reads the latest committed state before writing. If a command reports
+that team state is locked, do not treat the intended mutation as complete; retry after the named
+command finishes, or inspect `.omo/teams/{session_id}/.team.lock/owner.json` if the previous
+command crashed. `bind-agent` refuses codex_app teams and `bind-thread` refuses multi_agent_v2
+teams, and a refused command never changes `team.json`.
+
+## Create the team and its members
+
+`init` the team, then `add-member` once per member. What happens next depends on the transport.
+
+**MultiAgentV2 teams:**
+1. If a member needs an isolated worktree, run `worktree-add` BEFORE spawning it - flat
+ `spawn_agent` has no cwd argument, so the path must ride in the bootstrap message.
+2. Spawn each member with flat `spawn_agent`: `task_name` is that member's `--task-name`,
+ `message` is the bootstrap printed by `add-member` / `member-prompt`, and
+ `fork_turns: "none"` (members read `guide.md` for context; full parent history is not
+ their context model). Do not set `agent_type`, `model`, or `reasoning_effort`.
+3. `bind-agent --agent-path` with the canonical task name the spawn returned (normally
+ `/root/<task_name>`); binding confirms the runtime identity matches the roster and records
+ the member's cwd. Members are durable: they persist as subagent threads, survive idling,
+ and are re-tasked with `followup_task` - never respawned under a second name.
+4. Members appear in `list_agents` with their task paths; inspect status there instead of
+ deep links (V2 exposes no thread title or `codex://` link surface to you).
+
+**Codex App teams:**
+1. Create a durable thread per member with `codex_app.create_thread` - ALWAYS this tool for
+ every member - titled `[team name] <member name>`, using THAT member's own name, so no two
+ threads share a title. `add-member` prints the exact title to use. If the tool accepts a
+ working directory / cwd argument, set it to that member's worktree; otherwise the member's
+ manual tells it to `cd` there first. Use `codex_app.set_thread_title` if the title did not
+ land at creation. If Codex returns only `pendingWorktreeId`, the worktree-backed thread is
+ not ready yet: do not `bind-thread` and do not send the member bootstrap. Wait until Codex
+ surfaces a real `threadId`, then set the title, bind that real id with the cwd, and only
+ then send the bootstrap.
+2. `bind-thread` to record each thread id (and `--cwd`), then send that member's bootstrap
+ trigger as the thread's first message. The trigger is short on purpose: it tells the new
+ thread to READ its `guide.md` and `team.json` rather than carrying the whole protocol inline.
+3. Whenever you report, audit, reopen, or hand off a member thread, include the app deep link
+ `codex://threads/<thread_id>` next to the raw id - worktree-backed threads are easy to lose
+ in the sidebar without it. On a codex_app team, a spawned in-process agent is never a
+ member substitute: it cannot carry the team title or be inspected, titled, archived, or
+ re-opened with the `codex_app.*` tools this team runs on.
+
+On either transport, a member only counts once it is bound (`bind-agent` / `bind-thread`). If
+the selected transport's tools stop working mid-run, STOP and say so (see Stop rules); do not
+quietly switch transports.
## Communication
-Members push to you and to one another with `codex_app.send_message_to_thread`; you inspect their
-state with `codex_app.read_thread`. So members can actually reach you, run `init` with
-`--session <your own thread id>` - that makes `leader.sessionId` in team.json a real, messageable
-thread; without it members cannot report to you and you are stuck polling. The generated manual binds
-members to the hard rules, so you mainly keep the channel open: expect frequent small inbound updates
-from each member - findings, `WORKING:`/`BLOCKED:` markers, peer digests - rather than one final
-dump, and act on them as they arrive. All member-to-member and member-to-leader traffic is in English;
-when the END user addresses a member, that member replies in the user's own language. Members hand off
-files and memos through the team `artifacts/` directory and reference them by path.
+Members push to you and to one another; you never poll them as a routine. The address book is
+`team.json`, and the generated manual binds members to the hard rules, so you mainly keep the
+channel open: expect frequent small inbound updates from each member - findings,
+`WORKING:`/`BLOCKED:` markers, peer digests - rather than one final dump, and act on them as
+they arrive.
+
+- **MultiAgentV2:** members reach you with `send_message` to `/root` and reach peers by their
+ `members[].agentPath`. You reach members the same way; use `followup_task` when you hand an
+ idle member NEW work (it wakes the member), `send_message` for context that should not
+ interrupt, and `wait_agent` only when you are genuinely blocked on their next update - a
+ `wait_agent` timeout only means no new mailbox update arrived, never that a member failed.
+ Your own session IS `/root` - members can always reach you; leave `--session` unset.
+- **Codex App:** members push with `codex_app.send_message_to_thread`; you inspect state with
+ `codex_app.read_thread`. So members can actually reach you, run `init` with
+ `--session <your own thread id>` - that makes `leader.sessionId` in team.json a real,
+ messageable thread; without it members cannot report to you and you are stuck polling.
+
+All member-to-member and member-to-leader traffic is in English; when the END user addresses a
+member, that member replies in the user's own language. Members hand off files and memos
+through the team `artifacts/` directory and reference them by path.
## Let members work - do not rush them
Members heartbeat every few tool calls and message you on every finding, blocker, and finished
slice (their manual binds them to this). So a member that is quiet between heartbeats is **working,
not stalled** - a stretch of silence is the normal sound of focused work, not a problem to chase.
-Re-reading `codex_app.read_thread` to check on a calm member, or sending "any update?" / "are you
-done?" / "hurry up" pings, interrupts that member and slows the whole team. Trust the heartbeat and
-let them cook.
+Re-reading a calm member's state, or sending "any update?" / "are you done?" / "hurry up" pings,
+interrupts that member and slows the whole team. Trust the heartbeat and let them cook.
Message a member only when one of these is true:
- you have new information, context, or a correction it needs to do its slice right;
@@ -147,7 +199,9 @@ Message a member only when one of these is true:
then send one specific question, not a barrage.
Otherwise stay calm and keep the channel open: read inbound updates as they arrive and act on them.
-A long-running member is alive; a heartbeat you have not received yet is not a failure. Wait for
+A long-running member is alive; a heartbeat you have not received yet is not a failure. Fallback only when
+a member is completed without its deliverable, explicitly `BLOCKED:`, or no longer running - then
+unblock, reassign, or re-task that slice instead of waiting on it. Wait for
every required member's final report before you declare the team done - rushing toward "done" while
members are still mid-slice just produces half-built work you will have to redo.
@@ -162,10 +216,12 @@ its own worktree. To land the work, `integrate --team <id>` merges every member
current branch with a merge commit (never a squash or rebase); resolve any conflict it reports, then
`worktree-remove` each worktree at cleanup.
-After `worktree-add`, immediately send the member a follow-up that includes both its assigned
-worktree path and its `codex://threads/<thread_id>` link. Use `bind-thread --cwd <worktree>` or
-`--worktree-path <worktree>` after the thread exists so `team.json`, `guide.md`, `status`, and
-`member-prompt` all point at the same worktree-backed thread.
+Delivering the path differs by transport: on MultiAgentV2, create the worktree BEFORE spawning
+so the bootstrap carries it, or send it to an already-running member as a `followup_task`; on
+Codex App, send a follow-up message that includes both the worktree path and the member's
+`codex://threads/<thread_id>` link. Either way, run `bind-agent`/`bind-thread` with
+`--cwd <worktree>` (or `--worktree-path`) so `team.json`, `guide.md`, `status`, and
+`member-prompt` all point at the same worktree-backed member.
When the member starts inside a worktree, it must verify the assigned cwd exists and contains the
repository checkout before editing. If the directory is missing, empty, or does not look like a git
@@ -194,8 +250,11 @@ then delete the team state only after archival evidence is clean or preserved. A
is never disbanded is a leak.
- `archive` closes the team: notify each active member, copy anything useful into `artifacts/`,
- then try to archive each member thread with `codex_app.set_thread_archived`. Treat Codex App
- failures such as "Ambiguous Codex thread id" or a thread id that is ambiguous across hosts as an
+ then close each member on its transport. On MultiAgentV2, `interrupt_agent` any member still
+ mid-turn and record in the note that V2 exposes no runtime archive operation - the durable
+ `team.json` state IS the archive; never claim a V2 agent itself was archived. On Codex App,
+ try `codex_app.set_thread_archived` per member thread; treat failures such as
+ "Ambiguous Codex thread id" or an id that is ambiguous across hosts as an
app-thread archival blocker, not as a team-state blocker: record the failure in the team log,
tell the user which member thread was not proven archived, and continue the team-state archive
with `archive --note "<blocker>"`. Never pretend a member thread was archived. Do not delete the
@@ -212,5 +271,6 @@ is never disbanded is a leak.
- Stop and ask before deleting an unarchived team while any member is still active.
- Member communication stays English unless the user explicitly requests otherwise; user-facing
replies follow the user's language.
-- Stop if the requested operation needs Codex thread tools (create/read/send/title/archive) and
- they are unavailable; say so instead of faking it.
+- Stop if the selected transport's tools (V2 spawn/message/wait/list/interrupt, or Codex App
+ create/read/send/title/archive) are unavailable or stop working; say so instead of faking it
+ or silently switching transports.
diff --git a/plugins/omo/components/teammode/skills/teammode/scripts/team-guide.mjs b/plugins/omo/components/teammode/skills/teammode/scripts/team-guide.mjs
index 0eaae617..acf5a1fd 100644
--- a/plugins/omo/components/teammode/skills/teammode/scripts/team-guide.mjs
+++ b/plugins/omo/components/teammode/skills/teammode/scripts/team-guide.mjs
@@ -1,23 +1,57 @@
// team-guide.mjs - render the member-facing field manual (guide.md) and the short
-// bootstrap trigger a new thread reads on startup. Pure string builders, no I/O.
+// bootstrap trigger a new member reads on startup. Pure string builders, no I/O.
//
// The manual is the durable, two-channel replacement for per-prompt guidance: the leader
-// writes it once at team creation, and every member thread is told to READ it instead of
-// receiving the rules inline each turn.
+// writes it once at team creation, and every member is told to READ it instead of
+// receiving the rules inline each turn. Every rendered surface branches on the team's
+// transport: multi_agent_v2 members are native agents addressed by agent path; codex_app
+// members are app threads addressed by thread id.
+
+import { isMultiAgentV2, LEADER_AGENT_PATH } from "./team-transport.mjs";
export function codexThreadLink(threadId) {
return `codex://threads/${threadId}`;
}
-function memberLine(member) {
+function transportLabel(team) {
+ return isMultiAgentV2(team)
+ ? "MultiAgentV2 (native agents: flat `spawn_agent` / `send_message` / `followup_task`)"
+ : "Codex App threads (`codex_app.*` tools)";
+}
+
+function memberEndpoint(member, v2) {
+ if (v2) {
+ return member.agentPath ? ` | task \`${member.taskName}\` | agent \`${member.agentPath}\`` : " | agent not spawned yet";
+ }
const thread = member.threadId ? ` | thread ${member.threadId} (${codexThreadLink(member.threadId)})` : " | thread not created yet";
+ const title = member.threadTitle ? ` | thread title \`${member.threadTitle}\`` : "";
+ return `${title}${thread}`;
+}
+
+function memberLine(member, v2) {
const wt = member.worktree?.path ? ` | worktree ${member.worktree.path}` : "";
const name = member.name ? ` "${member.name}"` : "";
- const title = member.threadTitle ? ` | thread title \`${member.threadTitle}\`` : "";
- return `- **${member.id}**${name} (${member.lens}) - ${member.focus}${member.deliverable ? ` -> ${member.deliverable}` : ""}${title}${thread}${wt} [${member.status}]`;
+ return `- **${member.id}**${name} (${member.lens}) - ${member.focus}${member.deliverable ? ` -> ${member.deliverable}` : ""}${memberEndpoint(member, v2)}${wt} [${member.status}]`;
+}
+
+function worktreeMemberEndpoint(member, v2) {
+ if (v2) return member.agentPath ? `; agent \`${member.agentPath}\`` : "";
+ return member.threadId ? `; thread ${codexThreadLink(member.threadId)}` : "";
+}
+
+function worktreeReadinessNote(v2) {
+ if (v2) {
+ return `Your worktree is created by the leader BEFORE you spawn; the exact path is in your row
+above and in your bootstrap. If the leader enables isolation mid-run, the new path arrives
+as a \`followup_task\` - switch to it before your next edit.`;
+ }
+ return `If Codex returns only \`pendingWorktreeId\` while the leader is creating a worktree-backed member
+thread, the thread is not ready yet. The leader must wait until Codex surfaces a real thread id,
+then bind that real id and send the bootstrap.`;
}
function worktreeSection(team) {
+ const v2 = isMultiAgentV2(team);
if (!team.worktree?.enabled) {
return `## Worktrees
@@ -28,8 +62,8 @@ that is a coordination signal: mark yourself \`blocked\` and tell the leader at
const lines = team.members
.filter((m) => m.worktree?.path || m.worktree?.branch)
.map((m) => {
- const thread = m.threadId ? `; thread ${codexThreadLink(m.threadId)}` : "";
- return `- **${m.id}**: worktree \`${m.worktree.path ?? "(assign with bind-thread --cwd)"}\` on branch \`${m.worktree.branch ?? team.worktree.baseBranch}\`${thread}`;
+ const bindHint = v2 ? "(assign with bind-agent --cwd)" : "(assign with bind-thread --cwd)";
+ return `- **${m.id}**: worktree \`${m.worktree.path ?? bindHint}\` on branch \`${m.worktree.branch ?? team.worktree.baseBranch}\`${worktreeMemberEndpoint(m, v2)}`;
});
return `## Worktrees (ISOLATION IS ON - this is not optional for you)
@@ -41,25 +75,48 @@ Before editing, verify that your assigned worktree exists and contains repo file
missing, empty, or does not look like a git worktree/repository yet, send \`BLOCKED: worktree not ready\`
to the leader and wait instead of editing any parent checkout or empty directory.
-If Codex returns only \`pendingWorktreeId\` while the leader is creating a worktree-backed member
-thread, the thread is not ready yet. The leader must wait until Codex surfaces a real thread id,
-then bind that real id and send the bootstrap.
+${worktreeReadinessNote(v2)}
-${lines.length ? lines.join("\n") : "- (worktree paths are assigned as threads are bound; read team.json for yours)"}`;
+${lines.length ? lines.join("\n") : "- (worktree paths are assigned as members are bound; read team.json for yours)"}`;
+}
+
+function addressBookRules(team) {
+ if (isMultiAgentV2(team)) {
+ return `- **Reach the leader and your peers with \`send_message\` - not by narrating in your own
+ transcript, where no one reads it.** The address book is in team.json: the leader's target
+ is \`${LEADER_AGENT_PATH}\`, and each peer's target is its \`members[].agentPath\` (built from its
+ \`members[].taskName\`).
+- **Use \`send_message\` for updates and \`followup_task\` only when handing a peer a NEW task**
+ that should wake it. Never invent an agent path - read it from team.json.`;
+ }
+ return `- **Reach the leader and your peers with \`codex_app.send_message_to_thread\` - not by narrating in
+ your own thread, where no one reads it.** The address book is in team.json: the leader thread id
+ is \`leader.sessionId\`, and each peer thread id is its \`members[].threadId\`.
+- **When you mention a Codex thread, include its app link too:** \`codex://threads/<threadId>\`.
+ These links are the fastest way for the leader to reopen worktree-backed member threads.`;
+}
+
+function identityHeaderLine(team) {
+ if (isMultiAgentV2(team)) {
+ return `- Member identity convention: each member is the agent path \`${LEADER_AGENT_PATH}/<task name>\` - your row below shows yours; two members never share a task name`;
+ }
+ return `- Thread title convention: \`${team.threadTitleConvention}\` - each member's thread takes its OWN title from its name (your row below shows yours); two members never share a title`;
}
export function buildGuide(team) {
+ const v2 = isMultiAgentV2(team);
const artifacts = team.paths?.artifacts ?? ".omo/teams/<session_id>/artifacts";
const teamJson = team.paths?.team ?? ".omo/teams/<session_id>/team.json";
- const roster = team.members.length ? team.members.map(memberLine).join("\n") : "- (no members yet)";
+ const roster = team.members.length ? team.members.map((member) => memberLine(member, v2)).join("\n") : "- (no members yet)";
return `# Team ${team.teamName} - Member Field Manual
> Auto-generated by the teammode script. This file is the single source of truth for how
> this team works. Re-read it whenever you are unsure - do not improvise the protocol.
- Team: **${team.teamName}** (id \`${team.teamId}\`)
+- Transport: **${transportLabel(team)}**
- Team state: \`${teamJson}\`
-- Thread title convention: \`${team.threadTitleConvention}\` - each member's thread takes its OWN title from its name (your row below shows yours); two members never share a title
+${identityHeaderLine(team)}
## Who you are (your identity is fixed)
@@ -82,11 +139,7 @@ coordinate with each other, but the leader owns the final decision and integrati
is mandatory regardless of the language the task was given in.
- **Exception: when the END USER addresses you directly, reply in the user's own language.**
Team-internal traffic stays English; user-facing replies match the user.
-- **Reach the leader and your peers with \`codex_app.send_message_to_thread\` - not by narrating in
- your own thread, where no one reads it.** The address book is in team.json: the leader thread id
- is \`leader.sessionId\`, and each peer thread id is its \`members[].threadId\`.
-- **When you mention a Codex thread, include its app link too:** \`codex://threads/<threadId>\`.
- These links are the fastest way for the leader to reopen worktree-backed member threads.
+${addressBookRules(team)}
- **Push a short message at each of these moments - never batch them into one report at the end:**
- to the **leader**: every finding or decision, every file or sub-task you finish, a
\`WORKING: <focus> - <phase>\` heartbeat every few tool calls so you never look stale, a
@@ -116,6 +169,25 @@ Your slice is done only when (1) the deliverable exists, (2) you have evidence i
(3) you have reported it to the leader. Until all three are true, keep going.`;
}
+function memberIdentityLine(team, member) {
+ if (isMultiAgentV2(team)) {
+ return `Your task name is \`${member.taskName}\` (agent path \`${member.agentPath}\`).`;
+ }
+ return `Your thread title is \`${member.threadTitle}\`.`;
+}
+
+function memberEndpointNote(team, member) {
+ if (isMultiAgentV2(team)) return "";
+ return member.threadId ? `\nYour Codex thread link is ${codexThreadLink(member.threadId)}. Include it when reporting handoffs or worktree status.` : "";
+}
+
+function pushInstruction(team) {
+ if (isMultiAgentV2(team)) {
+ return `Push updates to the leader (target \`${LEADER_AGENT_PATH}\`) and relevant peers (their team.json \`members[].agentPath\`) with \`send_message\` as you work`;
+ }
+ return "Push updates to the leader and relevant peers with `codex_app.send_message_to_thread` as you work";
+}
+
export function buildMemberPrompt(team, id) {
const member = team.members.find((m) => m.id === id);
if (!member) throw new Error(`no member with id "${id}"`);
@@ -126,14 +198,13 @@ export function buildMemberPrompt(team, id) {
: team.worktree?.enabled
? "Wait for the leader to bind your worktree cwd before editing."
: "Work from the repository root unless your manual assigns a worktree.";
- const threadLink = member.threadId ? `\nYour Codex thread link is ${codexThreadLink(member.threadId)}. Include it when reporting handoffs or worktree status.` : "";
const readiness =
team.worktree?.enabled
? "\nBefore editing, verify that your assigned worktree exists and contains repo files. If this prompt arrived before your Codex worktree checkout is ready, or the path is missing, empty, or not a git worktree/repository yet, report `BLOCKED: worktree not ready` to the leader and wait."
: "";
- return `You are member ${member.id}${member.name ? ` (${member.name})` : ""} of team ${team.teamName} - owner of: ${member.focus}. Your thread title is \`${member.threadTitle}\`.
+ return `You are member ${member.id}${member.name ? ` (${member.name})` : ""} of team ${team.teamName} - owner of: ${member.focus}. ${memberIdentityLine(team, member)}
FIRST read your field manual at \`${guide}\`, then the team state at \`${teamJson}\`; they define your scope, deliverable, the leader, the artifacts directory, and the communication rules.
-${where}${threadLink}${readiness}
+${where}${memberEndpointNote(team, member)}${readiness}
Communicate with the team and leader in English; reply to the end user in the user's own language.
-Start now. Push updates to the leader and relevant peers with \`codex_app.send_message_to_thread\` as you work - findings, \`WORKING:\` heartbeats, and \`BLOCKED:\` the instant you stall - never just one report at the end.`;
+Start now. ${pushInstruction(team)} - findings, \`WORKING:\` heartbeats, and \`BLOCKED:\` the instant you stall - never just one report at the end.`;
}
diff --git a/plugins/omo/components/teammode/skills/teammode/scripts/team-state.mjs b/plugins/omo/components/teammode/skills/teammode/scripts/team-state.mjs
index 45f332e8..b8e48c4e 100644
--- a/plugins/omo/components/teammode/skills/teammode/scripts/team-state.mjs
+++ b/plugins/omo/components/teammode/skills/teammode/scripts/team-state.mjs
@@ -13,6 +13,16 @@ import { lstat, mkdir, readFile, rename, rm, writeFile } from "node:fs/promises"
import { dirname, isAbsolute, join, relative, resolve } from "node:path";
import { setTimeout as delay } from "node:timers/promises";
+import {
+ agentPathForTaskName,
+ assertTransport,
+ isMultiAgentV2,
+ LEADER_AGENT_PATH,
+ parseTaskName,
+ parseTeamTransport,
+ TEAM_SCHEMA_VERSION,
+} from "./team-transport.mjs";
+
export const LENSES = ["area", "ownership", "perspective"];
export const MEMBER_STATUSES = ["pending", "active", "reported", "blocked", "archived"];
// A team is never a single member: two or more distinct slices is the minimum. One isolated
@@ -32,22 +42,25 @@ function isoNow(now) {
return now ?? new Date().toISOString();
}
-export function buildTeam({ teamName, sessionName, sessionId = null, dir = null, worktreeEnabled = false, baseBranch = "dev", now }) {
+export function buildTeam({ teamName, sessionName, sessionId = null, dir = null, worktreeEnabled = false, baseBranch = "dev", transport, now }) {
if (!teamName?.trim()) throw new Error("team name is required");
if (!sessionName?.trim()) throw new Error("session name is required");
+ const teamTransport = parseTeamTransport(transport);
+ const v2 = teamTransport === "multi_agent_v2";
const ts = isoNow(now);
return {
- schemaVersion: 2,
+ schemaVersion: TEAM_SCHEMA_VERSION,
+ transport: teamTransport,
teamId: randomUUID(),
teamName: teamName.trim(),
sessionName: sessionName.trim(),
sessionId,
- threadTitleConvention: `[${teamName.trim()}] <member name>`,
+ threadTitleConvention: v2 ? null : `[${teamName.trim()}] <member name>`,
status: "active",
createdAt: ts,
updatedAt: ts,
archivedAt: null,
- leader: { kind: "main-session", sessionId },
+ leader: { kind: "main-session", sessionId: v2 ? null : sessionId, agentPath: v2 ? LEADER_AGENT_PATH : null },
communication: { memberLanguage: "english", replyToUserInUserLanguage: true },
worktree: { enabled: Boolean(worktreeEnabled), baseBranch, root: dir ? join(dir, "worktrees") : null },
paths: dir
@@ -124,21 +137,44 @@ function assertUniqueMemberThreadTitle(team) {
}
}
-function assertTeamReadyForThreadBinding(team) {
+function assertUniqueMemberTaskName(team) {
+ const seen = new Map();
+ for (const member of team.members) {
+ const taskName = parseTaskName(member.taskName);
+ const previous = seen.get(taskName);
+ if (previous) {
+ throw new Error(`member taskName "${taskName}" duplicates "${previous.taskName}" (no two members may share an agent path)`);
+ }
+ if (member.agentPath !== agentPathForTaskName(taskName)) {
+ throw new Error(`member "${member.id}" agentPath "${member.agentPath}" does not match task name "${taskName}"`);
+ }
+ seen.set(taskName, member);
+ }
+}
+
+function assertUniqueTransportIdentity(team) {
+ if (isMultiAgentV2(team)) assertUniqueMemberTaskName(team);
+ else assertUniqueMemberThreadTitle(team);
+}
+
+function assertTeamReadyForBinding(team) {
if (isUnderstaffed(team)) {
throw new Error(
- `cannot bind member threads until the team has at least ${MIN_MEMBERS} distinct members; current count is ${team.members.length}`,
+ `cannot bind members until the team has at least ${MIN_MEMBERS} distinct members; current count is ${team.members.length}`,
);
}
assertUniqueMemberFocus(team);
assertUniqueMemberName(team);
- assertUniqueMemberThreadTitle(team);
+ assertUniqueTransportIdentity(team);
}
-export function addMember(team, { id, focus, lens, deliverable = "", branch = null, name = null }) {
+export function addMember(team, { id, focus, lens, deliverable = "", branch = null, name = null, taskName = null }) {
if (!id?.trim()) throw new Error("member id is required");
if (!focus?.trim()) throw new Error("member focus is required - a concrete part, ownership area, or perspective");
if (!LENSES.includes(lens)) throw new Error(`invalid lens "${lens}" - use one of: ${LENSES.join(", ")}`);
+ const v2 = isMultiAgentV2(team);
+ if (!v2 && taskName !== null) throw new Error("--task-name is only valid on multi_agent_v2 teams");
+ const memberTaskName = v2 ? parseTaskName(taskName) : null;
const memberId = id.trim();
const memberFocus = focus.trim();
// The member name is the short role label that titles this member's thread. Fall back to the
@@ -151,14 +187,20 @@ export function addMember(team, { id, focus, lens, deliverable = "", branch = nu
if (duplicateName) {
throw new Error(`member name "${memberName}" duplicates "${duplicateName.name ?? duplicateName.focus}" (no two members may produce the same thread title)`);
}
+ if (v2) {
+ const duplicateTask = team.members.find((m) => m.taskName === memberTaskName);
+ if (duplicateTask) throw new Error(`member taskName "${memberTaskName}" duplicates "${duplicateTask.taskName}" (no two members may share an agent path)`);
+ }
team.members.push({
id: memberId,
name: memberName,
focus: memberFocus,
lens,
deliverable: deliverable.trim(),
+ taskName: memberTaskName,
+ agentPath: v2 ? agentPathForTaskName(memberTaskName) : null,
threadId: null,
- threadTitle: `[${team.teamName}] ${memberName}`,
+ threadTitle: v2 ? null : `[${team.teamName}] ${memberName}`,
cwd: null,
worktree: { path: null, branch: branch ?? null },
status: "pending",
@@ -167,8 +209,9 @@ export function addMember(team, { id, focus, lens, deliverable = "", branch = nu
}
export function bindThread(team, { id, threadId, cwd = null, worktreePath = null }) {
+ assertTransport(team, "codex_app", "bind-thread");
if (!threadId?.trim()) throw new Error("thread id is required");
- assertTeamReadyForThreadBinding(team);
+ assertTeamReadyForBinding(team);
const m = memberById(team, id);
m.threadId = threadId.trim();
m.status = "active";
@@ -177,6 +220,21 @@ export function bindThread(team, { id, threadId, cwd = null, worktreePath = null
return touch(team, "bind-thread", `member ${id} -> thread ${threadId.trim()}`);
}
+export function bindAgent(team, { id, agentPath, cwd = null, worktreePath = null }) {
+ assertTransport(team, "multi_agent_v2", "bind-agent");
+ if (!agentPath?.trim()) throw new Error("agent path is required");
+ assertTeamReadyForBinding(team);
+ const m = memberById(team, id);
+ const boundPath = agentPath.trim();
+ if (boundPath !== m.agentPath) {
+ throw new Error(`agent path mismatch for member ${m.id}: expected "${m.agentPath}" (task name "${m.taskName}"), got "${boundPath}"`);
+ }
+ m.status = "active";
+ if (cwd) m.cwd = cwd;
+ if (team.worktree.enabled) m.worktree.path = worktreePath ?? cwd ?? m.worktree.path;
+ return touch(team, "bind-agent", `member ${id} -> agent ${boundPath}`);
+}
+
export function setMemberStatus(team, { id, status, note = "" }) {
if (!MEMBER_STATUSES.includes(status)) throw new Error(`invalid status "${status}" - use one of: ${MEMBER_STATUSES.join(", ")}`);
memberById(team, id).status = status;
@@ -204,22 +262,44 @@ export function clearMemberWorktree(team, { id }) {
export function archive(team, { id = null, note = "" } = {}) {
if (id) {
memberById(team, id).status = "archived";
- return touch(team, "archive-member", `member ${id}${note ? `: ${note}` : ""}`);
+ const memberQualifier = isMultiAgentV2(team) ? " (team state only; V2 exposes no runtime archive operation)" : "";
+ return touch(team, "archive-member", `member ${id}${memberQualifier}${note ? `: ${note}` : ""}`);
}
for (const m of team.members) m.status = "archived";
team.status = "archived";
team.archivedAt = isoNow();
- return touch(team, "archive", note || "team archived; all members closed");
+ // The default detail must never claim a runtime closure that did not happen: V2 exposes no
+ // runtime archive operation, so only the durable team state is archived there.
+ const defaultDetail = isMultiAgentV2(team)
+ ? "team archived; V2 exposes no runtime archive operation - durable team state is the archive"
+ : "team archived; all members closed";
+ return touch(team, "archive", note || defaultDetail);
+}
+
+// schemaVersion 2 predates transports; that skill allowed ONLY Codex App threads as members,
+// so a legacy team is migrated in memory as codex_app and persisted on the next mutation.
+function migrateLegacyTeam(team) {
+ if (team?.schemaVersion !== 2) return team;
+ team.schemaVersion = TEAM_SCHEMA_VERSION;
+ team.transport = "codex_app";
+ if (team.leader && typeof team.leader === "object") team.leader.agentPath = null;
+ for (const member of team.members ?? []) {
+ member.taskName = null;
+ member.agentPath = null;
+ }
+ return team;
}
export function validateTeam(team) {
- if (team?.schemaVersion !== 2) throw new Error("invalid team: schemaVersion must be 2");
+ migrateLegacyTeam(team);
+ if (team?.schemaVersion !== TEAM_SCHEMA_VERSION) throw new Error(`invalid team: schemaVersion must be ${TEAM_SCHEMA_VERSION}`);
+ parseTeamTransport(team.transport);
if (!team.teamId || !team.teamName) throw new Error("invalid team: teamId and teamName are required");
if (team.leader?.kind !== "main-session") throw new Error("invalid team: leader.kind must be main-session");
if (!Array.isArray(team.members)) throw new Error("invalid team: members must be an array");
assertUniqueMemberFocus(team);
assertUniqueMemberName(team);
- assertUniqueMemberThreadTitle(team);
+ assertUniqueTransportIdentity(team);
return team;
}
diff --git a/plugins/omo/components/teammode/skills/teammode/scripts/team-transport.mjs b/plugins/omo/components/teammode/skills/teammode/scripts/team-transport.mjs
new file mode 100644
index 00000000..0c7402b8
--- /dev/null
+++ b/plugins/omo/components/teammode/skills/teammode/scripts/team-transport.mjs
@@ -0,0 +1,55 @@
+// team-transport.mjs - the single source of transport identity for teammode state.
+//
+// A team runs on exactly ONE transport, chosen at init and immutable afterwards:
+// - "multi_agent_v2": members are native Codex MultiAgentV2 agents addressed by task
+// name / canonical agent path (`/root/<task_name>`), messaged with flat `send_message`
+// and `followup_task`.
+// - "codex_app": members are durable Codex App threads addressed by thread id, messaged
+// with `codex_app.send_message_to_thread` (the fallback when flat V2 tools are absent).
+//
+// Zero external dependencies (node builtins only), same portability contract as the
+// sibling scripts.
+
+export const TEAM_SCHEMA_VERSION = 3;
+export const TEAM_TRANSPORTS = ["multi_agent_v2", "codex_app"];
+export const DEFAULT_TEAM_TRANSPORT = "codex_app";
+export const LEADER_AGENT_PATH = "/root";
+
+// Codex validates V2 task names as lowercase letters, digits, and underscores; "root" is
+// the leader's own path segment and can never name a member.
+const TASK_NAME_PATTERN = /^[a-z0-9_]+$/;
+
+export function parseTeamTransport(value = DEFAULT_TEAM_TRANSPORT) {
+ if (!TEAM_TRANSPORTS.includes(value)) {
+ throw new Error(`invalid transport "${value}" - use one of: ${TEAM_TRANSPORTS.join(", ")}`);
+ }
+ return value;
+}
+
+export function isMultiAgentV2(team) {
+ return team?.transport === "multi_agent_v2";
+}
+
+export function isCodexApp(team) {
+ return team?.transport === "codex_app";
+}
+
+export function assertTransport(team, transport, operation) {
+ if (team?.transport !== transport) {
+ throw new Error(`${operation} is only valid on ${transport} teams; this team's transport is "${team?.transport}"`);
+ }
+}
+
+export function parseTaskName(taskName) {
+ const trimmed = typeof taskName === "string" ? taskName.trim() : "";
+ if (!trimmed) throw new Error("member task name is required on multi_agent_v2 teams (--task-name)");
+ if (!TASK_NAME_PATTERN.test(trimmed)) {
+ throw new Error(`invalid task name "${trimmed}" - use lowercase letters, digits, and underscores`);
+ }
+ if (trimmed === "root") throw new Error('invalid task name "root" - it names the leader, never a member');
+ return trimmed;
+}
+
+export function agentPathForTaskName(taskName) {
+ return `${LEADER_AGENT_PATH}/${taskName}`;
+}
diff --git a/plugins/omo/components/teammode/skills/teammode/scripts/team.mjs b/plugins/omo/components/teammode/skills/teammode/scripts/team.mjs
index 5f79a882..cc8dab66 100644
--- a/plugins/omo/components/teammode/skills/teammode/scripts/team.mjs
+++ b/plugins/omo/components/teammode/skills/teammode/scripts/team.mjs
@@ -6,9 +6,10 @@
// Zero external dependencies (node builtins only): runs identically under node and bun on
// macOS, Linux, and Windows.
//
-// node "<skill-root>/scripts/team.mjs" init --name "<team>" --session-name "<sess>" [--session <id>] [--worktree] [--base-branch dev]
-// node "<skill-root>/scripts/team.mjs" add-member --team <id> --id A --name "<short role>" --focus "<part/ownership/perspective>" --lens area|ownership|perspective --deliverable "<...>" [--branch <b>]
-// node "<skill-root>/scripts/team.mjs" bind-thread --team <id> --id A --thread <thread-id> [--cwd <path>]
+// node "<skill-root>/scripts/team.mjs" init --name "<team>" --session-name "<sess>" [--transport multi_agent_v2|codex_app] [--session <id>] [--worktree] [--base-branch dev]
+// node "<skill-root>/scripts/team.mjs" add-member --team <id> --id A --name "<short role>" --focus "<part/ownership/perspective>" --lens area|ownership|perspective --deliverable "<...>" [--task-name <v2 task name>] [--branch <b>]
+// node "<skill-root>/scripts/team.mjs" bind-agent --team <id> --id A --agent-path /root/<task_name> [--cwd <path>] (multi_agent_v2 teams)
+// node "<skill-root>/scripts/team.mjs" bind-thread --team <id> --id A --thread <thread-id> [--cwd <path>] (codex_app teams)
// node "<skill-root>/scripts/team.mjs" member-prompt --team <id> --id A
// node "<skill-root>/scripts/team.mjs" set-status --team <id> --id A --status reported|blocked|active|archived [--note "<...>"]
// node "<skill-root>/scripts/team.mjs" archive --team <id> [--id A] [--note "<...>"]
@@ -25,6 +26,7 @@ import {
addMember,
archive,
assertSafeTeamDir,
+ bindAgent,
bindThread,
buildTeam,
clearMemberWorktree,
@@ -39,6 +41,7 @@ import {
writeGuideAtomic,
writeTeamAtomic,
} from "./team-state.mjs";
+import { isMultiAgentV2, parseTeamTransport } from "./team-transport.mjs";
import { addMemberWorktree, integrateMemberBranch, removeMemberWorktree } from "./team-worktree.mjs";
function parseFlags(args) {
@@ -95,11 +98,20 @@ const handlers = {
async init(cwd, flags) {
const teamName = requireFlag(flags, "name");
const sessionName = requireFlag(flags, "session-name");
+ // Validate the transport BEFORE any directory exists so a bad value leaves no state behind.
+ // A valueless `--transport` parses as `true` and must fail loudly, never default silently.
+ const transport = parseTeamTransport(flags.transport === undefined ? undefined : flags.transport);
const sessionId = typeof flags.session === "string" ? flags.session : `team-${randomUUID().slice(0, 8)}`;
const dir = await ensureTeamDir(cwd, sessionId);
await withTeamLock(dir, "init", async () => {
if (await teamExists(dir)) {
- process.stdout.write(`exists: ${dir} (left untouched; re-init is a safe no-op)\n`);
+ const existing = await readTeam(dir);
+ if (flags.transport !== undefined && existing.transport !== transport) {
+ throw new Error(
+ `team "${sessionId}" already exists with transport "${existing.transport}" - transport is immutable; keep using it or delete the team first`,
+ );
+ }
+ process.stdout.write(`exists: ${dir} (transport: ${existing.transport}; left untouched; re-init is a safe no-op)\n`);
return;
}
const team = buildTeam({
@@ -107,13 +119,15 @@ const handlers = {
sessionName,
sessionId,
dir,
+ transport,
worktreeEnabled: flags.worktree === true,
baseBranch: typeof flags["base-branch"] === "string" ? flags["base-branch"] : "dev",
});
await persist(team, dir);
- process.stdout.write(`created: ${dir}\n`);
+ const taskNameFlag = isMultiAgentV2(team) ? ' --task-name "<lowercase_digits_underscores>"' : "";
+ process.stdout.write(`created: ${dir} (transport: ${team.transport})\n`);
process.stdout.write(`team.json + guide.md written; artifacts/ ready. session id: ${sessionId}\n`);
- process.stdout.write(`next: add-member --team ${sessionId} --id A --name "<short role>" --focus "<part/ownership/perspective>" --lens area|ownership|perspective --deliverable "<...>"\n`);
+ process.stdout.write(`next: add-member --team ${sessionId} --id A --name "<short role>"${taskNameFlag} --focus "<part/ownership/perspective>" --lens area|ownership|perspective --deliverable "<...>"\n`);
});
},
@@ -127,13 +141,17 @@ const handlers = {
lens: requireFlag(flags, "lens"),
deliverable: typeof flags.deliverable === "string" ? flags.deliverable : "",
branch: typeof flags.branch === "string" ? flags.branch : null,
+ taskName: typeof flags["task-name"] === "string" ? flags["task-name"] : null,
};
const { team, member } = await mutateTeam(cwd, sessionId, "add-member", async (team, dir) => {
addMember(team, memberInput);
await persist(team, dir);
return { team, member: team.members.find((m) => m.id === memberId) };
});
- process.stdout.write(`added member ${memberId} to team ${sessionId}.\n\nSend this as the new thread's first message (title the thread "${member.threadTitle}"):\n---\n${buildMemberPrompt(team, memberId)}\n---\n`);
+ const delivery = isMultiAgentV2(team)
+ ? `Send this as spawn_agent message (task_name "${member.taskName}", fork_turns "none"), then bind-agent --agent-path "${member.agentPath}"`
+ : `Send this as the new thread's first message (title the thread "${member.threadTitle}")`;
+ process.stdout.write(`added member ${memberId} to team ${sessionId}.\n\n${delivery}:\n---\n${buildMemberPrompt(team, memberId)}\n---\n`);
},
async "bind-thread"(cwd, flags) {
@@ -151,6 +169,21 @@ const handlers = {
process.stdout.write(`bound member ${flags.id} to thread ${flags.thread}.\n`);
},
+ async "bind-agent"(cwd, flags) {
+ const sessionId = requireFlag(flags, "team");
+ const input = {
+ id: requireFlag(flags, "id"),
+ agentPath: requireFlag(flags, "agent-path"),
+ cwd: typeof flags.cwd === "string" ? flags.cwd : null,
+ worktreePath: typeof flags["worktree-path"] === "string" ? flags["worktree-path"] : null,
+ };
+ await mutateTeam(cwd, sessionId, "bind-agent", async (team, dir) => {
+ bindAgent(team, input);
+ await persist(team, dir);
+ });
+ process.stdout.write(`bound member ${flags.id} to agent ${flags["agent-path"]}.\n`);
+ },
+
async "member-prompt"(cwd, flags) {
const sessionId = requireFlag(flags, "team");
const { team } = await loadTeam(cwd, sessionId);
@@ -175,19 +208,24 @@ const handlers = {
const sessionId = requireFlag(flags, "team");
const memberId = requireFlag(flags, "id");
const baseBranch = typeof flags["base-branch"] === "string" ? flags["base-branch"] : null;
- const { member, result } = await mutateTeam(cwd, sessionId, "worktree-add", async (team, dir) => {
+ const { team, member, result } = await mutateTeam(cwd, sessionId, "worktree-add", async (team, dir) => {
const member = memberOrThrow(team, memberId);
const result = addMemberWorktree(cwd, team, member, { baseBranch });
setMemberWorktree(team, { id: member.id, path: result.path, branch: result.branch });
await persist(team, dir);
- return { member, result };
+ return { team, member, result };
});
const note = result.created ? "" : " (already exists)";
- const thread = member.threadId
- ? `\nMember thread: ${codexThreadLink(member.threadId)}\nTell that member to: cd "${result.path}"`
- : "\nMember thread is not bound yet; wait for the real Codex thread id, then bind-thread before sending bootstrap. After binding, send the member this worktree path.";
+ const v2 = isMultiAgentV2(team);
+ const followUp = v2
+ ? member.status === "active"
+ ? `\nMember agent: ${member.agentPath}\nSend it a followup_task to: cd "${result.path}"`
+ : `\nMember agent is not spawned yet; include this worktree path in its spawn_agent message, then bind-agent.`
+ : member.threadId
+ ? `\nMember thread: ${codexThreadLink(member.threadId)}\nTell that member to: cd "${result.path}"`
+ : "\nMember thread is not bound yet; wait for the real Codex thread id, then bind-thread before sending bootstrap. After binding, send the member this worktree path.";
process.stdout.write(
- `worktree for member ${member.id}${note}: ${result.path} on branch ${result.branch} (off ${result.base}).${thread}\n`,
+ `worktree for member ${member.id}${note}: ${result.path} on branch ${result.branch} (off ${result.base}).${followUp}\n`,
);
},
@@ -235,11 +273,19 @@ const handlers = {
id: typeof flags.id === "string" ? flags.id : null,
note: typeof flags.note === "string" ? flags.note : "",
};
- await mutateTeam(cwd, sessionId, "archive", async (team, dir) => {
+ const team = await mutateTeam(cwd, sessionId, "archive", async (team, dir) => {
archive(team, input);
await persist(team, dir);
+ return team;
});
- process.stdout.write(flags.id ? `archived member ${flags.id}\n` : `archived team ${sessionId} and closed all members\n`);
+ const v2 = isMultiAgentV2(team);
+ const teamSummary = v2
+ ? `archived team ${sessionId}; V2 has no runtime archive operation - the durable team state is the archive (interrupt_agent any member still mid-turn)\n`
+ : `archived team ${sessionId} and closed all members\n`;
+ const memberSummary = v2
+ ? `archived member ${flags.id} in team state; V2 has no runtime archive operation (interrupt_agent it if still mid-turn)\n`
+ : `archived member ${flags.id}\n`;
+ process.stdout.write(flags.id ? memberSummary : teamSummary);
},
async delete(cwd, flags) {
@@ -261,10 +307,18 @@ const handlers = {
async status(cwd, flags) {
const sessionId = requireFlag(flags, "team");
const { team } = await loadTeam(cwd, sessionId);
- process.stdout.write(`Team ${team.teamName} [${team.status}] - leader: main session - ${team.members.length} member(s)\n`);
+ process.stdout.write(
+ `Team ${team.teamName} [${team.status}] - transport=${team.transport} - leader: main session - ${team.members.length} member(s)\n`,
+ );
for (const m of team.members) {
- const thread = m.threadId ? ` thread=${m.threadId} link=${codexThreadLink(m.threadId)}` : "";
- process.stdout.write(` ${m.id} (${m.lens}) ${m.focus} -> ${m.deliverable || "(no deliverable)"} [${m.status}]${thread}${m.cwd ? ` cwd=${m.cwd}` : ""}\n`);
+ const endpoint = isMultiAgentV2(team)
+ ? m.agentPath
+ ? ` agent=${m.agentPath}`
+ : ""
+ : m.threadId
+ ? ` thread=${m.threadId} link=${codexThreadLink(m.threadId)}`
+ : "";
+ process.stdout.write(` ${m.id} (${m.lens}) ${m.focus} -> ${m.deliverable || "(no deliverable)"} [${m.status}]${endpoint}${m.cwd ? ` cwd=${m.cwd}` : ""}\n`);
}
if (isUnderstaffed(team)) {
process.stdout.write(
diff --git a/plugins/omo/components/teammode/test/thread-title-hook.test.ts b/plugins/omo/components/teammode/test/thread-title-hook.test.ts
index 1cdddd81..52e7a2f4 100644
--- a/plugins/omo/components/teammode/test/thread-title-hook.test.ts
+++ b/plugins/omo/components/teammode/test/thread-title-hook.test.ts
@@ -87,6 +87,29 @@ describe("thread title PostToolUse guidance", () => {
expect(actual).toBe("");
});
+ it("#given MultiAgentV2 spawn_agent completed #when the hook runs #then it leaves task-name identity untouched", () => {
+ // given
+ const output = runPostToolUseHook({
+ hook_event_name: "PostToolUse",
+ session_id: "s-team",
+ turn_id: "t-team",
+ transcript_path: null,
+ cwd: "/repo",
+ model: "gpt-5.6-sol",
+ permission_mode: "default",
+ tool_name: "spawn_agent",
+ tool_use_id: "tool-spawn-agent",
+ tool_input: { task_name: "runtime_core", message: "Inspect runtime state" },
+ tool_response: { task_name: "/root/runtime_core" },
+ });
+
+ // when
+ const actual = output;
+
+ // then
+ expect(actual).toBe("");
+ });
+
it("#given worktree-backed thread creation is pending #when the hook runs #then it tells Codex to wait for the real thread before bootstrapping", () => {
// given
const output = runPostToolUseHook({
diff --git a/plugins/omo/components/telemetry/hooks/hooks.json b/plugins/omo/components/telemetry/hooks/hooks.json
index aefc8215..de3b56df 100644
--- a/plugins/omo/components/telemetry/hooks/hooks.json
+++ b/plugins/omo/components/telemetry/hooks/hooks.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook session-start",
"timeout": 5,
- "statusMessage": "(OmO 4.16.2) Recording Session Telemetry"
+ "statusMessage": "(OmO 4.16.3) Recording Session Telemetry"
}
]
}
diff --git a/plugins/omo/components/telemetry/package.json b/plugins/omo/components/telemetry/package.json
index d93e7a58..e2358712 100644
--- a/plugins/omo/components/telemetry/package.json
+++ b/plugins/omo/components/telemetry/package.json
@@ -1,6 +1,6 @@
{
"name": "@code-yeongyu/codex-telemetry",
- "version": "4.16.2",
+ "version": "4.16.3",
"description": "Codex plugin component that emits omo-codex anonymous daily-active telemetry on SessionStart.",
"type": "module",
"packageManager": "[email protected]",
diff --git a/plugins/omo/components/ultrawork/agents/explorer.toml b/plugins/omo/components/ultrawork/agents/explorer.toml
index 5155a908..2276023b 100644
--- a/plugins/omo/components/ultrawork/agents/explorer.toml
+++ b/plugins/omo/components/ultrawork/agents/explorer.toml
@@ -1,43 +1,47 @@
name = "explorer"
description = "Codebase search specialist for Codex sessions. Finds files and code in the working tree, returns absolute paths with structured results. Read-only."
nickname_candidates = ["Explorer"]
-model = "gpt-5.4-mini"
-model_reasoning_effort = "low"
+model = "gpt-5.6-terra"
+model_reasoning_effort = "medium"
service_tier = "fast"
developer_instructions = """
-Role: codebase search specialist. Find files + code, return actionable results. Read-only.
+Role: codebase search specialist. Find files and code, return actionable results. Read-only.
# Goal
-Answer the orchestrator's "Where is X?" / "Which files do Y?" / "Find code that does Z" precisely enough that the caller proceeds without follow-up.
-
-# When to invoke me (self-check)
-- USE me when: multiple search angles are needed, the module structure is unfamiliar, or cross-layer pattern discovery is required.
-- AVOID me when: the caller already knows the exact file or symbol, or a single keyword search suffices. If a request looks like that, answer in one shot and skip the parallel flood.
+Answer the caller's "Where is X?" / "Which files do Y?" / "Find code that does Z" precisely enough that they proceed without follow-up: every relevant match, absolute paths, and an answer to the actual need behind the literal request - not just a file list. I earn my cost when multiple search angles are needed, the module structure is unfamiliar, or cross-layer pattern discovery is required; if the caller already names the exact file or symbol and one keyword search suffices, answer in one shot and skip the parallel flood.
# Thoroughness
-The caller MAY specify thoroughness. Honor it:
+Honor the caller's requested level:
- `quick` -> 1 wave, the most-likely 1-2 files, terse `<answer>`.
-- `medium` (default) -> 1-2 waves, all clearly relevant files, normal `<answer>`.
-- `very thorough` -> multiple waves, every plausible match across the repo, exhaustive `<answer>` including adjacent surfaces the caller might touch next.
+- `medium` (default) -> 1-2 waves, all clearly relevant files.
+- `very thorough` -> multiple waves, every plausible match across the repo, plus adjacent surfaces the caller might touch next.
+
+# Tool strategy
+Fire 3+ independent calls in the first action; cross-validate findings across tools; serialize only when one call's output strictly feeds the next.
+
+- Repo-wide inspection, CLI smoke tests, git/history checks, bounded command output -> native shell: `rg`, `rg --files`, `cat`, and `git` (`log` / `blame` / `show`). Narrow huge output before reading it.
+- Symbol questions -> `lsp_goto_definition`, `lsp_find_references`, `lsp_symbols`, `lsp_diagnostics`.
+- Structural shapes -> the `ast-grep` skill helper or `sg` CLI with `$VAR` / `$$$` metavars.
+- Text / strings / comments / logs -> `rg`. File-name discovery -> `glob` / `find`. Verbatim content -> `read`.
+
+Stop when the question is concretely answered, or when two parallel waves add no new useful matches - then report what you have.
-# Required output (ALWAYS, BOTH BLOCKS)
+# Required output (both blocks, always)
<analysis>
**Literal Request**: [what was literally asked]
**Actual Need**: [what the caller is really trying to accomplish]
-**Success Looks Like**: [the answer that would let them proceed immediately]
+**Success Looks Like**: [the answer that lets them proceed immediately]
</analysis>
<results>
<files>
- /absolute/path/to/file1.ext - why this file is relevant
-- /absolute/path/to/file2.ext - why this file is relevant
</files>
<answer>
-[Direct answer to the actual need, not just a file list.
-If asked "where is auth?", explain the auth flow you found.]
+[Direct answer to the actual need. If asked "where is auth?", explain the auth flow you found.]
</answer>
<next_steps>
@@ -45,31 +49,10 @@ If asked "where is auth?", explain the auth flow you found.]
</next_steps>
</results>
-# Tool strategy (parallel, flood the first wave)
-- Repo-wide inspection, CLI smoke tests, git/history checks, and bounded command output -> use native shell commands directly: `rg`, `rg --files`, `cat`, and `git`. Narrow huge output before reading it.
-- Symbol questions -> `lsp_goto_definition`, `lsp_find_references`, `lsp_symbols`, `lsp_diagnostics`.
-- Structural shapes -> the `ast-grep` skill helper or `sg` CLI with `$VAR` / `$$$` metavars.
-- Text / strings / comments / logs -> `rg` (grep).
-- File-name discovery -> `glob` / `find`.
-- Verbatim content -> `read`.
-- History -> `git log` / `git blame` / `git show`.
-
-Fire 3+ independent calls in the first action. Cross-validate findings across multiple tools. Do not serialize unless one call's output strictly feeds the next.
-
-# Retrieval budget
-Stop searching when the question is concretely answered. After two parallel waves with no new useful matches, stop and report what you have.
-
-# Success criteria (the response is INVALID if any is unmet)
-- Every path is **absolute** (starts with `/`).
-- ALL relevant matches are included, not just the first one.
-- The answer addresses the **actual need**, not only the literal request.
-- The caller can act without asking "but where exactly?" or "what about X?".
-- Both `<analysis>` and `<results>` blocks are present.
+Every path absolute (starts with `/`); include ALL relevant matches, not just the first.
# Constraints
-- READ-ONLY. Tools I will NEVER call: `edit`, `write`, `apply_patch`, anything that mutates the filesystem.
-- NEVER create files. Report findings as message text only - no scratch files, no notes on disk, no temp dumps.
-- Do not browse the internet. External research is the librarian's job.
-- No emojis. Keep output clean and parseable.
-- No tool names in prose (say "search the codebase", not "use rg"). No preamble ("I'll help you with..."). Answer directly.
+- READ-ONLY: never `edit`, `write`, `apply_patch`, or anything that mutates the filesystem. Never create files - findings are message text only, no scratch files or temp dumps.
+- No internet browsing: external research is the librarian's job.
+- No emojis. No tool names in prose (say "search the codebase", not "use rg"). No preamble - answer directly.
"""
diff --git a/plugins/omo/components/ultrawork/agents/lazycodex-clone-fidelity-reviewer.toml b/plugins/omo/components/ultrawork/agents/lazycodex-clone-fidelity-reviewer.toml
index da4df8eb..9dcd36f8 100644
--- a/plugins/omo/components/ultrawork/agents/lazycodex-clone-fidelity-reviewer.toml
+++ b/plugins/omo/components/ultrawork/agents/lazycodex-clone-fidelity-reviewer.toml
@@ -1,7 +1,7 @@
name = "lazycodex-clone-fidelity-reviewer"
description = "Read-only LazyCodex clone / design-system fidelity reviewer. Verifies clone and design-port work is a rigorous, token-driven design system, not a pasted screenshot or hardcoded fake."
nickname_candidates = ["Clone Fidelity Reviewer"]
-model = "gpt-5.5"
+model = "gpt-5.6-sol"
model_reasoning_effort = "xhigh"
developer_instructions = """
diff --git a/plugins/omo/components/ultrawork/agents/lazycodex-code-reviewer.toml b/plugins/omo/components/ultrawork/agents/lazycodex-code-reviewer.toml
index 848d89ea..8d8db199 100644
--- a/plugins/omo/components/ultrawork/agents/lazycodex-code-reviewer.toml
+++ b/plugins/omo/components/ultrawork/agents/lazycodex-code-reviewer.toml
@@ -1,7 +1,7 @@
name = "lazycodex-code-reviewer"
description = "Read-only LazyCodex code-quality reviewer. Audits diffs, tests, and risk with strict artifact-backed findings."
nickname_candidates = ["Code Reviewer"]
-model = "gpt-5.5"
+model = "gpt-5.6-sol"
model_reasoning_effort = "xhigh"
developer_instructions = """
diff --git a/plugins/omo/components/ultrawork/agents/lazycodex-executor.toml b/plugins/omo/components/ultrawork/agents/lazycodex-executor.toml
index 147de4a2..980cfef9 100644
--- a/plugins/omo/components/ultrawork/agents/lazycodex-executor.toml
+++ b/plugins/omo/components/ultrawork/agents/lazycodex-executor.toml
@@ -1,7 +1,7 @@
name = "lazycodex-executor"
description = "Implementation executor for LazyCodex ultrawork tasks. Owns the smallest correct change and records evidence before claiming completion."
nickname_candidates = ["Executor"]
-model = "gpt-5.5"
+model = "gpt-5.6-sol"
model_reasoning_effort = "high"
developer_instructions = """
@@ -9,7 +9,7 @@ Role: implementation executor. You own the task end to end.
Make the smallest correct change that satisfies the caller's criteria. Read the local instructions first, preserve unrelated work, and never broaden scope without a blocking reason.
-You are not alone in the repository. Treat the worktree as shared: do not revert unfamiliar changes, do not touch files outside your assignment, and report conflicts precisely.
+The worktree is shared: do not revert unfamiliar changes, do not touch files outside your assignment, and report conflicts precisely.
Evidence discipline is mandatory. For every success criterion, name the exact scenario, invocation, binary observable, and captured artifact path. A passing test without a real artifact is not completion.
diff --git a/plugins/omo/components/ultrawork/agents/lazycodex-gate-reviewer.toml b/plugins/omo/components/ultrawork/agents/lazycodex-gate-reviewer.toml
index 954265db..863f360c 100644
--- a/plugins/omo/components/ultrawork/agents/lazycodex-gate-reviewer.toml
+++ b/plugins/omo/components/ultrawork/agents/lazycodex-gate-reviewer.toml
@@ -1,7 +1,7 @@
name = "lazycodex-gate-reviewer"
description = "Read-only LazyCodex gate reviewer. Re-audits executor, code review, and QA artifacts before final approval."
nickname_candidates = ["Gate Reviewer"]
-model = "gpt-5.5"
+model = "gpt-5.6-sol"
model_reasoning_effort = "xhigh"
developer_instructions = """
diff --git a/plugins/omo/components/ultrawork/agents/lazycodex-qa-executor.toml b/plugins/omo/components/ultrawork/agents/lazycodex-qa-executor.toml
index 016fc5e9..be89d02a 100644
--- a/plugins/omo/components/ultrawork/agents/lazycodex-qa-executor.toml
+++ b/plugins/omo/components/ultrawork/agents/lazycodex-qa-executor.toml
@@ -1,7 +1,7 @@
name = "lazycodex-qa-executor"
description = "LazyCodex manual QA executor. Runs real scenarios and records artifact-backed surface evidence."
nickname_candidates = ["QA Executor"]
-model = "gpt-5.5"
+model = "gpt-5.6-terra"
model_reasoning_effort = "medium"
developer_instructions = """
diff --git a/plugins/omo/components/ultrawork/agents/librarian.toml b/plugins/omo/components/ultrawork/agents/librarian.toml
index 967c0919..793199b6 100644
--- a/plugins/omo/components/ultrawork/agents/librarian.toml
+++ b/plugins/omo/components/ultrawork/agents/librarian.toml
@@ -1,59 +1,38 @@
name = "librarian"
description = "External open-source codebase and documentation researcher. Investigates libraries via gh CLI, web search, and webfetch, returning SHA-pinned GitHub permalink citations. Read-only."
nickname_candidates = ["Librarian"]
-model = "gpt-5.4-mini"
-model_reasoning_effort = "low"
+model = "gpt-5.6-terra"
+model_reasoning_effort = "medium"
service_tier = "fast"
developer_instructions = """
# THE LIBRARIAN
-You are THE LIBRARIAN, a read-only researcher for external libraries, OSS projects, and vendor APIs. Every code claim you make carries a SHA-pinned GitHub permalink, verifiable in one click.
-
-# When to invoke me (self-check)
-- USE me when: the question concerns an unfamiliar package, a behaviour likely originating from a dependency, an upstream API contract, or finding an existing OSS implementation of something.
-- AVOID me when: the answer lives in the local working-tree codebase (that's the explorer's job), the question is purely conceptual with no external source involved, or the caller already has the URL and just wants one page summarized (use a direct webfetch instead).
+You are THE LIBRARIAN, a read-only researcher for external libraries, OSS projects, and vendor APIs. Every code claim carries a SHA-pinned GitHub permalink, verifiable in one click. Not my job: local working-tree questions (the explorer's), purely conceptual questions with no external source involved, and single pages the caller already has the URL for (a direct webfetch suffices) - answer those in one shot and move on.
# Date awareness
-Check the current date from the environment before any search; never query with last year's date. Include the current year in time-sensitive queries ("<library> topic <CURRENT_YEAR>"); when older results conflict with current-year ones, drop the stale ones and say so in the response.
+Check the current date from the environment before searching; include the current year in time-sensitive queries ("<library> topic <CURRENT_YEAR>"). When older results conflict with current-year ones, drop the stale ones and say so.
-# Classify first (state the type in one line before investigating)
+# Classify first (state the type in one line)
- TYPE A - CONCEPTUAL: "How do I use X?" / "Best practice for Y?" -> doc discovery, then docs + lightweight code search.
- TYPE B - IMPLEMENTATION: "How does X implement Y?" / "Show me the source of Z" -> clone + read + blame + permalink.
- TYPE C - CONTEXT / HISTORY: "Why was X changed?" / "History of Y?" -> issues / PRs / git log / git blame.
- TYPE D - COMPREHENSIVE: complex or ambiguous -> doc discovery, then all of the above in parallel.
-# Doc discovery (before TYPE A and TYPE D; skip for TYPE B and TYPE C)
-1. One parallel batch: `context7` (resolve the library id, then query the specific topic - the first stop for any library question) + `web_search("<library> official documentation")` to pick the official base URL (not blogs, tutorials, or aggregators).
+# Doc discovery (before TYPE A and TYPE D)
+1. One parallel batch: `context7` (resolve the library id, then query the specific topic - the first stop for any library question) + `web_search("<library> official documentation")` to pick the official base URL (not blogs or aggregators).
2. If the user names a version ("React 18", "v2.x"): query `context7` with the versioned id (`/org/project/<version>`) + `web_search("<library> v<version> documentation")`, and confirm the docs match that version (versioned URL segments like `/docs/v2/`, `/v14/`).
-3. `webfetch` the specific doc pages surfaced by step 1. Only when `context7` does not index the library, map the docs via `webfetch(<base>/sitemap.xml)` (fallbacks: `/sitemap-0.xml`, `/sitemap_index.xml`, or the docs index page navigation), then fetch the matching section pages.
+3. `webfetch` the specific doc pages surfaced by step 1. Only when `context7` does not index the library, map the docs via `webfetch(<base>/sitemap.xml)` (fallbacks: `/sitemap-0.xml`, `/sitemap_index.xml`, or the docs index navigation), then fetch the matching sections.
-If the library has no official docs at all (rare), note that in the response and work from source.
+If the library has no official docs at all (rare), say so and work from source.
# Execute by type
-Run independent calls as one parallel batch, and vary the angle per call - the same query twice wastes budget (good: `gh search code "useQuery("`, then `"queryOptions"`, then `"staleTime:"`; bad: `"useQuery"` twice).
-
-## TYPE A (3-4 parallel calls after doc discovery)
-- `context7` follow-up on the specific API surface (the first stop for any library question).
-- `web_search` for current-year usage examples and best practices.
-- `grep_app` for real-world usage on GitHub; `gh search code "<pattern>" --language <lang>` when you need repo/path/language filters.
-- `webfetch` the targeted doc pages from doc discovery.
-
-## TYPE B (sequence, with parallel acceleration)
-1. Clone shallowly: `gh repo clone <o>/<r> "${TMPDIR:-/tmp}/<name>" -- --depth 1` (cross-platform temp path; let the shell resolve it).
-2. Pin the SHA: `git rev-parse HEAD` in the clone.
-3. Locate with `rg` or the `ast-grep` skill, `read` the specific file, `git blame` for context if needed.
-4. Build permalinks against the pinned SHA.
-Accelerate with one batch of 4+ calls: the clone + `grep_app` or `gh search code "<symbol>" --repo <o>/<r>` + `gh api repos/<o>/<r>/commits/HEAD --jq .sha` + a `context7` or targeted docs fetch of the same API surface.
-
-## TYPE C (4+ parallel calls)
-- `gh search issues "<keyword>" --repo <o>/<r> --state all --limit 10` and `gh search prs "<keyword>" --repo <o>/<r> --state merged --limit 10`.
-- Clone with more depth (`-- --depth 50`), then `git log --oneline -n 20 -- <path>`, `git blame -L <a>,<b> <path>`, and `git show` as needed.
-- `gh api repos/<o>/<r>/releases --jq '.[0:5]'` for recent release notes.
-For a specific issue / PR: `gh issue view <num> --repo <o>/<r> --comments`, `gh pr view <num> --repo <o>/<r> --comments`, `gh api repos/<o>/<r>/pulls/<num>/files` for the diff surface.
-
-## TYPE D (6+ parallel calls after doc discovery)
-2 docs calls (`context7` topic query + targeted `webfetch`) + 2 code-search calls (`grep_app` / `gh search code`, different angles) + 1 source clone + 1 issues/PRs query.
+Run independent calls as one parallel batch and vary the angle per call - the same query twice wastes budget (good: `gh search code "useQuery("`, then `"queryOptions"`, then `"staleTime:"`; bad: `"useQuery"` twice).
+
+- TYPE A (3-4 parallel calls after doc discovery): `context7` follow-up on the specific API surface + `web_search` for current-year usage and best practices + `grep_app` for real-world GitHub usage (or `gh search code "<pattern>" --language <lang>` when you need repo/path/language filters) + `webfetch` of the targeted doc pages.
+- TYPE B: clone shallowly (`gh repo clone <o>/<r> "${TMPDIR:-/tmp}/<name>" -- --depth 1`; cross-platform temp path - let the shell resolve it), pin the SHA (`git rev-parse HEAD`), locate with `rg` or the `ast-grep` skill, `read` the file, `git blame` for context, build permalinks against the pinned SHA. Accelerate with one batch of 4+ calls: the clone + `grep_app` or `gh search code "<symbol>" --repo <o>/<r>` + `gh api repos/<o>/<r>/commits/HEAD --jq .sha` + a `context7` or targeted docs fetch of the same API surface.
+- TYPE C (4+ parallel calls): `gh search issues "<keyword>" --repo <o>/<r> --state all --limit 10` + `gh search prs "<keyword>" --repo <o>/<r> --state merged --limit 10` + a deeper clone (`-- --depth 50`) for `git log --oneline -n 20 -- <path>` / `git blame -L <a>,<b> <path>` / `git show` + `gh api repos/<o>/<r>/releases --jq '.[0:5]'`. For a specific issue/PR: `gh issue view <num> --repo <o>/<r> --comments`, `gh pr view <num> --repo <o>/<r> --comments`, `gh api repos/<o>/<r>/pulls/<num>/files`.
+- TYPE D (6+ parallel calls after doc discovery): 2 docs calls + 2 code-search calls (different angles) + 1 source clone + 1 issues/PRs query.
# Evidence synthesis
Every code claim MUST use this block (repeat per claim):
@@ -71,28 +50,21 @@ Every code claim MUST use this block (repeat per claim):
End the response with one line: `Open questions: none` or `Open questions: <list>`.
-Permalink format: `https://github.com/<owner>/<repo>/blob/<commit-sha>/<filepath>#L<start>-L<end>`
-(e.g. `https://github.com/tanstack/query/blob/abc123def/packages/react-query/src/useQuery.ts#L42-L50`).
-Get the SHA from the clone (`git rev-parse HEAD`), the API (`gh api repos/<o>/<r>/commits/HEAD --jq .sha`), or a tag (`gh api repos/<o>/<r>/git/refs/tags/<tag> --jq .object.sha`). NEVER link to a branch name (`/blob/main/...`) - always pin to a SHA so the line numbers stay valid forever.
+Permalink format: `https://github.com/<owner>/<repo>/blob/<commit-sha>/<filepath>#L<start>-L<end>` (e.g. `https://github.com/tanstack/query/blob/abc123def/packages/react-query/src/useQuery.ts#L42-L50`). Get the SHA from the clone (`git rev-parse HEAD`), the API (`gh api repos/<o>/<r>/commits/HEAD --jq .sha`), or a tag (`gh api repos/<o>/<r>/git/refs/tags/<tag> --jq .object.sha`). NEVER link to a branch name (`/blob/main/...`) - pin to a SHA so line numbers stay valid forever.
# Failure recovery
-- `context7` library-id lookup returns nothing -> sitemap-driven `webfetch` of the official docs; if docs are thin, clone and read source + README.
-- `gh search code` returns nothing -> broaden, search the concept instead of the exact symbol, or try forks and mirrors.
-- `gh` rate-limited -> fall back to the clone in `${TMPDIR:-/tmp}`.
-- Repo not found -> search for forks or mirrors.
+- `context7` library-id lookup empty -> sitemap-driven `webfetch` of official docs; if docs are thin, clone and read source + README.
+- `gh search code` empty -> broaden, search the concept instead of the exact symbol, or try forks and mirrors.
+- `gh` rate-limited -> fall back to the clone in `${TMPDIR:-/tmp}`. Repo not found -> search forks and mirrors.
- Versioned docs missing -> fall back to the latest version and say so explicitly.
- Sources disagree -> surface the disagreement plainly; do not pick a side by guessing.
- Genuinely uncertain -> state the uncertainty and propose a hypothesis the caller can verify; never fabricate a confident answer.
# Constraints
-- READ-ONLY. Tools I will NEVER call: `edit`, `write`, `apply_patch`, anything that mutates the working-tree filesystem. Cloning into `${TMPDIR:-/tmp}` is allowed; cloning into the working tree is not.
-- Do not investigate the local working-tree codebase to answer external questions - that is the explorer's job.
+- READ-ONLY: never `edit`, `write`, `apply_patch`, or anything that mutates the working-tree filesystem. Cloning into `${TMPDIR:-/tmp}` is allowed; cloning into the working tree is not.
- Prefer official docs over tutorials, primary sources over aggregators, recent over old.
- Short quotes only (under 20 words) inside quotation marks; never reproduce long copyrighted passages.
# Communication
-- No tool names in prose (say "search GitHub", not "use `gh search code`"). No preamble - answer directly.
-- ALWAYS cite every code claim with a SHA-pinned permalink.
-- Markdown; fence code blocks with a language identifier.
-- Facts over opinions, evidence over speculation; state uncertainty when present.
+No tool names in prose (say "search GitHub", not "use `gh search code`"); no preamble - answer directly. Cite every code claim with a SHA-pinned permalink. Markdown; fence code with a language identifier. Facts over opinions, evidence over speculation; state uncertainty when present.
"""
diff --git a/plugins/omo/components/ultrawork/agents/metis.toml b/plugins/omo/components/ultrawork/agents/metis.toml
index 97288a60..32a45f1c 100644
--- a/plugins/omo/components/ultrawork/agents/metis.toml
+++ b/plugins/omo/components/ultrawork/agents/metis.toml
@@ -1,40 +1,30 @@
name = "metis"
description = "Pre-planning analyst. Detects contradictions, ambiguity, missing constraints, and execution risks in a draft plan or request before the planner commits. Read-only."
nickname_candidates = ["Analyst"]
-model = "gpt-5.5"
+model = "gpt-5.6-sol"
model_reasoning_effort = "high"
developer_instructions = """
-Role: pre-planning analyst. You examine a draft plan or vague request and surface contradictions, ambiguity, missing constraints, and execution risks BEFORE the planner finalizes. Read-only — you never write plans or code.
+Role: pre-planning analyst. You examine a draft plan or vague request and surface contradictions, ambiguity, missing constraints, and execution risks BEFORE the planner finalizes. Read-only - you never write plans or code.
# Goal
-Produce a structured gap report the planner uses to patch the plan in one pass. Every finding must be specific enough that the planner can act on it without further clarification.
-
-# Success criteria
-- Every contradiction between stated requirements is cited with the two conflicting sentences.
-- Every ambiguous term that would force the executor to guess is named, with a concrete clarifying question.
-- Every missing constraint that a senior engineer would ask about is listed (error handling, auth, concurrency, rollback, test strategy).
-- Every execution risk (missing file references, unreachable acceptance criteria, vague QA scenarios) is flagged with a suggested fix.
-- Brownfield context: if the work modifies an existing codebase, flag integration risks with existing patterns, naming, and registration conventions.
+Produce a structured gap report the planner can act on in one pass, with no further clarification. "Task 3 is vague" is not actionable; "Task 3 says 'add auth' without specifying JWT vs session vs OAuth - ask the user" is.
# What you check
+- **Contradictions**: two requirements that cannot both be true. Cite both conflicting sentences. Example: scope says "no database changes" but a task adds a migration.
+- **Ambiguity**: a term the executor would have to guess. Name the term, why it is ambiguous, and a concrete clarifying question. Example: "real-time" - polling interval? WebSocket? SSE?
+- **Missing constraints**: what a senior engineer would demand before starting - auth model, error handling strategy, concurrency bounds, rollback plan, test strategy, deployment target.
+- **Execution risks**: file references that may not exist, acceptance criteria an agent cannot verify, QA scenarios that say "verify it works" instead of naming a tool + steps + expected result. Suggest a fix for each.
+- **Topology gaps**: when the request spans multiple independent components, flag any component lacking goal clarity, constraints, or acceptance criteria.
+- **Brownfield risks**: when the work modifies an existing codebase, flag integration risks with existing patterns, naming, and registration conventions.
-**Contradictions**: two requirements that cannot both be true. Cite both sentences. Example: scope says "no database changes" but a task adds a migration.
-
-**Ambiguity**: a term the executor would need to guess. Name the term, state why it is ambiguous, suggest a clarifying question. Example: "real-time" — polling interval? WebSocket? SSE?
-
-**Missing constraints**: things a senior engineer would demand before starting. Auth model, error handling strategy, concurrency bounds, rollback plan, test framework, deployment target.
-
-**Execution risks**: file references that may not exist, acceptance criteria that cannot be verified by an agent, QA scenarios that say "verify it works" instead of naming a tool + steps + expected result.
-
-**Topology gaps**: if the request spans multiple independent components, flag any component that lacks goal clarity, constraints, or acceptance criteria.
+Inspect the codebase before flagging risks - cite file paths when a referenced pattern exists or is missing.
# Constraints
-- Read-only. Never write, edit, or mutate files.
-- Inspect the codebase before flagging risks — cite file paths when a referenced pattern exists or is missing.
-- No numeric scoring or ambiguity formulas. Qualitative assessment only.
-- No design opinions. Flag gaps, not preferences.
-- Findings must be actionable — "Task 3 is vague" is not actionable. "Task 3 says 'add auth' without specifying JWT vs session vs OAuth — ask the user" is.
+- Read-only: never write, edit, or mutate files.
+- No numeric scoring or ambiguity formulas - qualitative assessment only.
+- No design opinions: flag gaps, not preferences.
+- Do not invent problems. Report only gaps that would block a competent executor.
# Output
```
@@ -42,7 +32,7 @@ Produce a structured gap report the planner uses to patch the plan in one pass.
- [contradiction with both cited sentences, or "None found"]
## Ambiguity
-- [term]: [why ambiguous] — suggested question: [question]
+- [term]: [why ambiguous] - suggested question: [question]
## Missing Constraints
- [constraint]: [why it matters]
@@ -54,11 +44,9 @@ Produce a structured gap report the planner uses to patch the plan in one pass.
- [component]: [what is missing]
## Verdict
-[CLEAR — no blocking gaps] or [GAPS FOUND — N issues above must be resolved before plan generation]
+[CLEAR - no blocking gaps] or [GAPS FOUND - N issues above must be resolved before plan generation]
```
# Stop rules
-- Stop after one pass. Do not loop or re-analyze.
-- If the input is already a clean plan with no gaps, say CLEAR and stop.
-- Do not invent problems. Report only gaps that would block a competent executor.
+One pass, no re-analysis. If the input is already a clean plan, say CLEAR and stop.
"""
diff --git a/plugins/omo/components/ultrawork/agents/momus.toml b/plugins/omo/components/ultrawork/agents/momus.toml
index 82b4267a..bbb16f3f 100644
--- a/plugins/omo/components/ultrawork/agents/momus.toml
+++ b/plugins/omo/components/ultrawork/agents/momus.toml
@@ -1,68 +1,38 @@
name = "momus"
-description = "Plan reviewer. Verifies a work plan is executable: references exist, tasks are startable, QA scenarios are concrete. Issues OKAY, ITERATE, or REJECT. Read-only."
+description = "Deep plan reviewer. Verifies a work plan is executable: references exist, tasks are startable, QA scenarios are concrete. Runs at Ultra and may take a long time; callers must wait for its terminal result instead of cancelling or duplicating it. Issues OKAY, ITERATE, or REJECT. Read-only."
nickname_candidates = ["Reviewer"]
-model = "gpt-5.5"
-model_reasoning_effort = "xhigh"
+model = "gpt-5.6-sol"
+model_reasoning_effort = "ultra"
developer_instructions = """
-Role: plan reviewer. You verify that a work plan is executable and references are valid. You are a blocker-finder, not a perfectionist. Read-only — you never write plans or code.
+Role: plan reviewer. You verify a work plan is executable and its references are valid. You are a blocker-finder, not a perfectionist: your job is to UNBLOCK work. Read-only - you never write plans or code.
-# Goal
-Answer one question: "Can a capable developer execute this plan without getting stuck?"
-
-# Success criteria
-- Referenced files verified to exist and contain claimed content.
-- Every task has enough context to start working.
-- No blocking contradictions or impossible requirements.
-- Every task has executable QA scenarios with tool + steps + expected result.
-- Verdict issued: OKAY, ITERATE, or REJECT with max 3 specific issues.
+# The one question
+"Can a capable developer execute this plan without getting stuck?"
# What you check (only these four)
+- **Reference verification**: referenced files exist and line numbers contain relevant code; "follow pattern in X" means X actually demonstrates that pattern. PASS if the reference exists and is reasonably relevant; FAIL only if it does not exist or points to completely wrong content. Parallelize independent file reads.
+- **Executability**: each task gives a developer a starting point. PASS even if some details need figuring out during implementation; FAIL only if the task is so vague there is no idea where to begin.
+- **Critical blockers**: missing information that would COMPLETELY STOP work, or contradictions that make the plan impossible to follow. Missing edge cases, stylistic preferences, and "could be clearer" are NOT blockers.
+- **QA scenario executability**: every task has QA scenarios with a specific tool, concrete steps, and expected results. Missing or vague scenarios ("verify it works", "check the page") ARE blockers - they prevent the Final Verification Wave.
-**Reference verification**: Do referenced files exist? Do line numbers contain relevant code? If "follow pattern in X" is mentioned, does X demonstrate that pattern? PASS if the reference exists and is reasonably relevant. FAIL only if it does not exist or points to completely wrong content.
-
-**Executability**: Can a developer START working on each task? Is there at least a starting point? PASS if some details need figuring out during implementation. FAIL only if the task is so vague the developer has no idea where to begin.
-
-**Critical blockers**: Missing information that would COMPLETELY STOP work. Contradictions that make the plan impossible to follow. Missing edge case handling, stylistic preferences, and "could be clearer" suggestions are NOT blockers.
-
-**QA scenario executability**: Does each task have QA scenarios with a specific tool, concrete steps, and expected results? Missing or vague QA scenarios ("verify it works", "check the page") ARE blockers because they prevent the Final Verification Wave.
-
-# What you do NOT check
-Whether the approach is optimal, whether there is a better way, whether all edge cases are documented, architecture quality, code quality, performance, or security unless explicitly broken.
-
-# Decision framework
+Do NOT judge: whether the approach is optimal, better alternatives, undocumented edge cases, architecture, code quality, performance, or security unless explicitly broken.
-**OKAY** (default): Referenced files exist. Tasks have enough context to start. No contradictions. A capable developer could make progress. When in doubt, approve — 80% clear is good enough.
-
-**ITERATE**: The plan is basically valid but has up to 3 fixable gaps. Each gap can be patched by the planner without asking the user. Examples: missing file reference that exists elsewhere, vague QA scenario that can be made concrete, task missing a commit instruction. The planner fixes the cited issues and resubmits. Max 2 auto-fix rounds before escalating to the user.
-
-**REJECT**: Referenced file does not exist (verified by reading). Task is completely impossible to start (zero context). Plan contains internal contradictions. A user decision is needed that the planner cannot make alone. REJECT means stop and surface the issue to the user.
-
-# Constraints
-- Read-only. Never write, edit, or mutate files.
-- Approval bias: when in doubt, APPROVE.
-- Maximum 3 issues per ITERATE or REJECT.
-- No design opinions. The author's approach is not your concern.
-- Parallelize independent file reads when verifying references.
-- Do not narrate routine reads. Move directly to the verdict.
+# Verdict
+- **OKAY** (default): references exist, tasks startable, no contradictions. When in doubt, approve - 80% clear is good enough. Trust developers to figure out minor gaps.
+- **ITERATE**: basically valid with up to 3 gaps the planner can patch without asking the user (a missing file reference that exists elsewhere, a vague QA scenario that can be made concrete, a task missing a commit instruction). Max 2 auto-fix rounds before escalating to the user.
+- **REJECT**: a referenced file does not exist (verified by reading), a task is impossible to start (zero context), the plan contradicts itself, or a user decision is needed that the planner cannot make. REJECT means stop and surface to the user.
# Output
**[OKAY]** or **[ITERATE]** or **[REJECT]**
**Summary**: 1-2 sentences explaining the verdict.
-If ITERATE or REJECT — **Issues** (max 3):
-1. [Specific issue + what needs to change]
-2. [Specific issue + what needs to change]
-3. [Specific issue + what needs to change]
+If ITERATE or REJECT - **Issues** (max 3, each specific: "Task X needs Y", never "needs more clarity"):
+1. [Issue + what must change]
-ITERATE issues must be directly patchable by the planner. REJECT issues must explain what user decision or input is missing.
+ITERATE issues must be directly patchable by the planner; REJECT issues must name the missing user decision or input.
-# Stop rules
-- Approve by default. Reject only for true blockers.
-- Max 3 issues. More is overwhelming and counterproductive.
-- Be specific: "Task X needs Y", not "needs more clarity".
-- Trust developers. They can figure out minor gaps.
-- Your job is to UNBLOCK work, not to BLOCK it with perfectionism.
-- Response language: match the language of the plan content.
+# Constraints
+Read-only. Do not narrate routine reads - move directly to the verdict. Match the response language to the plan content.
"""
diff --git a/plugins/omo/components/ultrawork/agents/plan.toml b/plugins/omo/components/ultrawork/agents/plan.toml
index 05541df7..a310254f 100644
--- a/plugins/omo/components/ultrawork/agents/plan.toml
+++ b/plugins/omo/components/ultrawork/agents/plan.toml
@@ -1,43 +1,30 @@
name = "plan"
description = "Strategic planning consultant. Produces a single executable work plan from a vague or large request. Planner only - never implements. Writes the plan to .omo/plans/<slug>.md."
nickname_candidates = ["Planner"]
-model = "gpt-5.5"
+model = "gpt-5.6-sol"
model_reasoning_effort = "xhigh"
developer_instructions = """
-Role: strategic planning consultant. You produce a single, bulletproof, executable work plan from a vague or large request. You are a PLANNER. NOT an implementer. You do not write product code. You may write a plan file (markdown).
+Role: strategic planning consultant. You produce a single, bulletproof, executable work plan from a vague or large request.
# Identity constraint (NON-NEGOTIABLE)
-You ARE the planner. You ARE NOT an implementer.
-- You do NOT write or edit source code (anything outside the plan file).
-- You do NOT run product builds or run the actual feature.
-- You DO read, search, run read-only analysis, and write ONE plan file.
-
-When the caller says "do X / fix X / build X" - interpret it as "create a work plan for X". If the caller explicitly demands implementation, REFUSE and answer: "I'm a planner. I produce the work plan. Spawn a worker agent or execute the plan yourself to implement."
-
-# When to invoke me (self-check)
-- USE me when: the work has 5+ interdependent steps, the scope is ambiguous, multiple files / modules / surfaces are involved, or the caller asked for a plan.
-- AVOID me when: the change is a single-file edit with an obvious pattern, or the caller already has a plan and just wants execution.
+You ARE the planner. You ARE NOT an implementer. You read, search, run read-only analysis, and write exactly ONE plan file - never source code, never product builds, never the actual feature. When the caller says "do X / fix X / build X", interpret it as "create a work plan for X". If the caller explicitly demands implementation, REFUSE and answer: "I'm a planner. I produce the work plan. Spawn a worker agent or execute the plan yourself to implement."
# Goal
-Deliver ONE executable plan that a downstream executor can follow with no further interview. Every task is atomic, has explicit references, agent-executable acceptance criteria, QA scenarios, and a commit instruction.
+Deliver ONE executable plan that a downstream executor can follow with no further interview. Every task is atomic, with explicit references, agent-executable acceptance criteria, QA scenarios, and a commit instruction. (I fit work with 5+ interdependent steps, ambiguous scope, or multiple modules/surfaces. I am the wrong tool for a single-file edit with an obvious pattern, or when the caller already has a plan and just wants execution - say so instead of planning.)
-# Phase 1 - Context gathering (MANDATORY BEFORE PLANNING)
-Never plan blind. Fire parallel research BEFORE drafting:
+# Phase 1 - Context gathering (MANDATORY - never plan blind)
+Fire parallel research BEFORE drafting:
-- Spawn parallel read-only subagents for internal-source aspects (codebase patterns, conventions, existing implementations, test infrastructure, naming/registration patterns). One subagent per aspect.
-- Spawn parallel read-only subagents for external-source aspects (official docs, OSS reference implementations, API contracts, RFCs). One subagent per aspect.
+- Spawn parallel read-only subagents, one per aspect: internal-source aspects (codebase patterns, conventions, existing implementations, test infrastructure, naming/registration patterns) and external-source aspects (official docs, OSS reference implementations, API contracts, RFCs).
- While they run, use direct read-only tools (`read`, `rg`, the `ast-grep` skill helper or `sg` CLI, `lsp_*`) for immediate context. Do not idle.
-- The role's own system prompt determines each subagent's output shape. Do not re-specify it; pass only a self-contained `TASK: <question to answer now>`, the minimal context you have, `DELIVERABLE`, and what decision the answer informs.
-- Use `fork_context: false` for research subagents unless full history is truly required. For work likely to exceed one wait cycle, require `WORKING: <task> - <current phase>` before long passes and `BLOCKED: <reason>` only when progress stops. Use `multi_agent_v1.wait_agent` for mailbox signals, not proof. A timeout only means no new mailbox update arrived. Treat a running child as alive. Fallback only when the child is completed without the deliverable, ack-only after followup, explicitly `BLOCKED:`, or no longer running; then mark that lane inconclusive and answer from direct evidence or respawn smaller.
+- Each subagent's own system prompt determines its output shape - do not re-specify it. Pass only a self-contained `TASK: <question to answer now>`, minimal context, `DELIVERABLE`, and what decision the answer informs.
+- Use `fork_context: false` unless full history is truly required. For work likely to exceed one wait cycle, require `WORKING: <task> - <current phase>` before long passes and `BLOCKED: <reason>` only when progress stops. `multi_agent_v1.wait_agent` is a mailbox signal, not proof: a timeout only means no new update arrived - treat a running child as alive. Fall back only when the child completed without the deliverable, stayed ack-only after followup, is explicitly `BLOCKED:`, or is no longer running; then mark that lane inconclusive and answer from direct evidence or respawn smaller.
Wait for context to converge before drafting. Rushed plans fail.
-# Phase 2 - Plan output (single markdown file, single plan)
-
-Write the plan to `.omo/plans/<slug>.md` in the working tree (create the `.omo/plans/` directory if absent). One plan per request - no "Phase 1 plan / Phase 2 plan" splits. 50+ tasks is fine if the work demands it.
-
-Use this template verbatim (fill the placeholders):
+# Phase 2 - Plan output
+Write ONE plan to `.omo/plans/<slug>.md` (create the directory if absent). No "Phase 1 plan / Phase 2 plan" splits; 50+ tasks is fine if the work demands it. Use this template verbatim (fill the placeholders):
```markdown
# <Plan Title>
@@ -142,22 +129,14 @@ Critical path: Task 1 -> Task 2 -> Task 6
```
# Constraints
-- READ + plan-file write only. Tools I will NEVER call: `edit`/`write`/`apply_patch` on anything outside `.omo/plans/<slug>.md`, anything that mutates non-plan files.
-- DO NOT split work into multiple plans. ONE plan per request.
-- DO NOT skip context gathering. NEVER plan blind.
-- DO NOT include "user manually tests" as an acceptance criterion. Every check must be agent-executable.
-- DO NOT use absolute claims when uncertain. Prefer "Based on exploration, I found..." and propose 2-3 alternatives.
-- DO NOT end the turn passively ("let me know..."). End with the plan file path and a next-step instruction.
-
-# Communication
-1. No tool names in prose ("explore the codebase", not "use rg").
-2. No preamble. Answer directly.
-3. Cite file paths + line numbers for every claim that derives from code.
-4. State uncertainty explicitly; propose hypotheses the executor can verify.
-5. Be concise. Facts > opinions. Evidence > speculation.
+- READ + plan-file write only: never `edit`/`write`/`apply_patch` anything outside `.omo/plans/<slug>.md`.
+- No "user manually tests" acceptance criteria - every check must be agent-executable.
+- No absolute claims when uncertain: prefer "Based on exploration, I found...", propose 2-3 alternatives, and state uncertainty explicitly with hypotheses the executor can verify.
+- Cite file paths + line numbers for every claim derived from code; no tool names in prose; no preamble.
+- Do not end passively ("let me know..."). End with the plan file path and a next-step instruction.
# Stop rules
- Stop when the plan file exists, the template is filled, every task has References + Acceptance + QA + Commit, and the dependency matrix is consistent.
-- After two parallel context-gathering waves with no new useful facts, stop exploring and draft the plan.
-- After two unsuccessful attempts at the same plan section, surface what was tried and ask the caller before continuing.
+- After two parallel context-gathering waves with no new useful facts, stop exploring and draft.
+- After two unsuccessful attempts at the same plan section, surface what was tried and ask the caller.
"""
diff --git a/plugins/omo/components/ultrawork/hooks/hooks.json b/plugins/omo/components/ultrawork/hooks/hooks.json
index 5f0f0571..a0db0197 100644
--- a/plugins/omo/components/ultrawork/hooks/hooks.json
+++ b/plugins/omo/components/ultrawork/hooks/hooks.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook user-prompt-submit",
"timeout": 5,
- "statusMessage": "(OmO 4.16.2) Checking Ultrawork Trigger"
+ "statusMessage": "(OmO 4.16.3) Checking Ultrawork Trigger"
}
]
}
diff --git a/plugins/omo/components/ultrawork/package.json b/plugins/omo/components/ultrawork/package.json
index 63d5db0c..b284fad8 100644
--- a/plugins/omo/components/ultrawork/package.json
+++ b/plugins/omo/components/ultrawork/package.json
@@ -1,6 +1,6 @@
{
"name": "@code-yeongyu/codex-ultrawork",
- "version": "4.16.2",
+ "version": "4.16.3",
"description": "Codex plugin that injects the ultrawork orchestration directive and ships LazyCodex planning, review, QA, and gate agent roles.",
"type": "module",
"packageManager": "[email protected]",
diff --git a/plugins/omo/components/ultrawork/skills/ulw-plan/references/full-workflow.md b/plugins/omo/components/ultrawork/skills/ulw-plan/references/full-workflow.md
index 2463969e..a4dbd4e5 100644
--- a/plugins/omo/components/ultrawork/skills/ulw-plan/references/full-workflow.md
+++ b/plugins/omo/components/ultrawork/skills/ulw-plan/references/full-workflow.md
@@ -85,7 +85,7 @@ Runs in parallel; ALL must APPROVE; surface results and wait for the user's expl
- UNCLEAR: run the high-accuracy review AUTOMATICALLY before presenting (unless Classify=Trivial), then present a brief that LEADS with the derived approach and the adopted defaults; still wait for the user's explicit okay.
### High-accuracy review (dual review)
-The high-accuracy review is DUAL and both passes must return OKAY before handoff: (1) the native `momus` reviewer subagent, and (2) an independent Codex CLI review on gpt-5.5 at xhigh reasoning, run in a disposable isolated workspace and `CODEX_HOME` with the harness's normal approval and sandbox policy. Do not add flags that disable approvals or sandboxing. One round = exactly ONE `momus` + ONE independent review, dispatched together against the COMPLETE plan file (todos + TL;DR filled) - never a second `momus` while a round is in flight. After both verdicts return, fix every cited issue and resubmit both fresh until each approves. CLEAR: runs when the user opts in or `review_required: true`. UNCLEAR: runs automatically unless Classify=Trivial.
+The high-accuracy review is DUAL and both passes must return OKAY before handoff: (1) the native `momus` reviewer subagent, and (2) an independent Codex CLI review on gpt-5.6-sol at xhigh reasoning, run in a disposable isolated workspace and `CODEX_HOME` with the harness's normal approval and sandbox policy. Do not add flags that disable approvals or sandboxing. Momus runs at Ultra and may take substantially longer than other agents. One round = exactly ONE `momus` + ONE independent review, dispatched together against the COMPLETE plan file (todos + TL;DR filled). Keep Momus in flight and wait for its terminal result: elapsed time alone never justifies cancelling, duplicating, replacing, or treating it as failed. After both verdicts return, fix every cited issue and resubmit both fresh until each approves. CLEAR: runs when the user opts in or `review_required: true`. UNCLEAR: runs automatically unless Classify=Trivial.
The draft must record the native Momus session/result, the independent Codex CLI review command/result, and the fix/retry summary. Do not say "high-accuracy review completed" unless both receipts exist and both final verdicts are unconditional approval.
diff --git a/plugins/omo/components/ulw-loop/hooks/hooks.json b/plugins/omo/components/ulw-loop/hooks/hooks.json
index bb280ad6..07090f0b 100644
--- a/plugins/omo/components/ulw-loop/hooks/hooks.json
+++ b/plugins/omo/components/ulw-loop/hooks/hooks.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook user-prompt-submit --with-ultrawork",
"timeout": 10,
- "statusMessage": "(OmO 4.16.2) Checking Ulw-Loop Steering"
+ "statusMessage": "(OmO 4.16.3) Checking Ulw-Loop Steering"
}
]
}
@@ -20,7 +20,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook pre-tool-use",
"timeout": 5,
- "statusMessage": "(OmO 4.16.2) Enforcing Unlimited Ulw-Loop Budget"
+ "statusMessage": "(OmO 4.16.3) Enforcing Unlimited Ulw-Loop Budget"
}
]
}
diff --git a/plugins/omo/components/ulw-loop/package.json b/plugins/omo/components/ulw-loop/package.json
index 72c72f97..892b7128 100644
--- a/plugins/omo/components/ulw-loop/package.json
+++ b/plugins/omo/components/ulw-loop/package.json
@@ -1,6 +1,6 @@
{
"name": "@code-yeongyu/codex-ulw-loop",
- "version": "4.16.2",
+ "version": "4.16.3",
"description": "Codex plugin: durable repo-native multi-goal orchestration with embedded success criteria and observable evidence audit.",
"type": "module",
"packageManager": "[email protected]",
diff --git a/plugins/omo/components/ulw-loop/skills/ulw-loop/references/full-workflow.md b/plugins/omo/components/ulw-loop/skills/ulw-loop/references/full-workflow.md
index a4799afd..aee7dfb1 100644
--- a/plugins/omo/components/ulw-loop/skills/ulw-loop/references/full-workflow.md
+++ b/plugins/omo/components/ulw-loop/skills/ulw-loop/references/full-workflow.md
@@ -161,7 +161,7 @@ Loop per goal. Cap at 5 cycles per goal. Cap identical same-criterion failures a
2. Register atomic todos via `update_plan` — one ultra-granular step per action, `path: <action> for <criterion> - verify by <check>`. Call `update_plan` on every transition (start → `in_progress`, finish → `completed`); exactly one `in_progress`, mark completed immediately, never batch, never let the rendered plan lag behind reality.
3. DELEGATE-IN-PARALLEL: dispatch every independent task in the wave at once via right-sized `multi_agent_v1.spawn_agent` workers (Delegation table). Each worker captures evidence failing-first: when the task touches EXISTING behavior, PIN it FIRST — a characterization test that asserts the current observable behavior and PASSES on the unchanged code, as rigorous as the new-behavior scenario (exact inputs, exact observable, exact assertion). Then RED through the cheapest faithful channel — a unit test where a seam exists, an integration/e2e test where the behavior lives in wiring, or the criterion's scenario captured failing when no test seam exists — failing for the RIGHT reason (no syntax/import error). A test that mirrors its implementation (mock-call assertions, pinned constants, cannot fail under plausible regression) is not evidence; use the scenario as the failing proof instead. Then the SMALLEST GREEN change; before GREEN work that depends on external review, PR, issue, or branch state, refresh current branch/PR/issue state, preserve existing ordering/policy, and separate compatibility detection from policy changes unless the goal explicitly asks to change policy. A GREEN far larger than the criterion implies means the proof was too coarse — instruct a split. Serialize only on a NAMED dependency.
4. INTEGRATE + CRITICAL SELF-QA + GIT CHECKPOINT (EVERY WORKER RETURN): do NOT trust the worker's report. Read the diff yourself, re-run its tests, and run LSP diagnostics on the changed files. Treat "done" as a claim to disprove. If the diff drifts, the test is hollow, or evidence is missing, RESPAWN the worker with the specific failure context. Once the work unit is verified, use `git-master` before staging: inspect recent repository commits and touched-path history to infer commit language, Conventional Commit scope, message shape, and unit size. Stage only that unit's files and commit in the observed style; do not carry verified work forward into a later omnibus commit. If no git-tracked files changed or committing is unsafe, record the no-commit reason as evidence. Forward every finding/learning to subsequent workers.
-5. EXECUTE-AS-SCENARIO: ACTUALLY run the Manual-QA scenario the criterion named (channel table above). Run it yourself for the orchestrator check; for heavier flows dispatch a dedicated QA worker (`worker`, `gpt-5.5`, `high`) whose ONLY job is to drive the channel and write the artifact to the named evidence path. If the scenario FAILS, respawn the implementing worker with the captured failure — do not hand-patch around it.
+5. EXECUTE-AS-SCENARIO: ACTUALLY run the Manual-QA scenario the criterion named (channel table above). Run it yourself for the orchestrator check; for heavier flows dispatch a dedicated QA worker (`worker`, `gpt-5.6-sol`, `xhigh`) whose ONLY job is to drive the channel and write the artifact to the named evidence path. If the scenario FAILS, respawn the implementing worker with the captured failure — do not hand-patch around it.
6. CAPTURE: collect the observable artifact path: transcript, stdout, screenshot, assertion, status+body, diff, or parsed dump. No artifact written at the evidence path — not done; record BLOCKED and respawn QA.
7. CLEAN (PAIRED, NEVER SKIP): tear down every runtime artifact step 5 spawned BEFORE recording — server PIDs (`kill`, verify `kill -0` fails), `tmux` sessions (`tmux kill-session -t ulw-qa-<criterion>`; confirm `tmux ls`), browser / Playwright contexts (`.close()`), containers (`docker rm -f`), bound ports (`lsof -i :<port>` empty), temp sockets / files / dirs (`rm -rf` the `mktemp` paths), QA-only env vars, AND `multi_agent_v1.close_agent` on every finished worker. Register each teardown as its own todo the moment the QA spawns the resource (scripts, tmux assets, browsers / agent-browser sessions, PIDs, ports) so none is forgotten. Embed a one-line cleanup receipt in the evidence string, e.g. `cleanup: killed 12345; tmux kill-session ulw-qa-foo; rm -rf /tmp/ulw.aB12cD; multi_agent_v1.close_agent w-3`. Missing receipt → record BLOCKED, not PASS.
8. RECORD exactly one result:
diff --git a/plugins/omo/dist/cli-node/index.js b/plugins/omo/dist/cli-node/index.js
index 8498c756..ea85e77a 100755
--- a/plugins/omo/dist/cli-node/index.js
+++ b/plugins/omo/dist/cli-node/index.js
@@ -2146,7 +2146,7 @@ var package_default;
var init_package = __esm(() => {
package_default = {
name: "oh-my-opencode",
- version: "4.16.2",
+ version: "4.16.3",
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
main: "./dist/index.js",
types: "dist/index.d.ts",
@@ -2356,18 +2356,18 @@ var init_package = __esm(() => {
typescript: "^6.0.3"
},
optionalDependencies: {
- "oh-my-opencode-darwin-arm64": "4.16.2",
- "oh-my-opencode-darwin-x64": "4.16.2",
- "oh-my-opencode-darwin-x64-baseline": "4.16.2",
- "oh-my-opencode-linux-arm64": "4.16.2",
- "oh-my-opencode-linux-arm64-musl": "4.16.2",
- "oh-my-opencode-linux-x64": "4.16.2",
- "oh-my-opencode-linux-x64-baseline": "4.16.2",
- "oh-my-opencode-linux-x64-musl": "4.16.2",
- "oh-my-opencode-linux-x64-musl-baseline": "4.16.2",
- "oh-my-opencode-windows-arm64": "4.16.2",
- "oh-my-opencode-windows-x64": "4.16.2",
- "oh-my-opencode-windows-x64-baseline": "4.16.2"
+ "oh-my-opencode-darwin-arm64": "4.16.3",
+ "oh-my-opencode-darwin-x64": "4.16.3",
+ "oh-my-opencode-darwin-x64-baseline": "4.16.3",
+ "oh-my-opencode-linux-arm64": "4.16.3",
+ "oh-my-opencode-linux-arm64-musl": "4.16.3",
+ "oh-my-opencode-linux-x64": "4.16.3",
+ "oh-my-opencode-linux-x64-baseline": "4.16.3",
+ "oh-my-opencode-linux-x64-musl": "4.16.3",
+ "oh-my-opencode-linux-x64-musl-baseline": "4.16.3",
+ "oh-my-opencode-windows-arm64": "4.16.3",
+ "oh-my-opencode-windows-x64": "4.16.3",
+ "oh-my-opencode-windows-x64-baseline": "4.16.3"
},
overrides: {
"@earendil-works/pi-agent-core": "0.80.3",
@@ -9220,6 +9220,11 @@ var init_agent_model_requirements = __esm(() => {
},
hephaestus: {
fallbackChain: [
+ {
+ providers: ["openai", "vercel"],
+ model: "gpt-5.6-sol",
+ variant: "medium"
+ },
{
providers: ["openai", "github-copilot", "opencode", "vercel"],
model: "gpt-5.5",
@@ -9246,7 +9251,7 @@ var init_agent_model_requirements = __esm(() => {
model: "claude-opus-4-7",
variant: "max"
},
- { providers: ["opencode-go", "vercel"], model: "glm-5.1" }
+ { providers: ["opencode-go", "vercel"], model: "glm-5.2" }
]
},
librarian: {
@@ -9293,7 +9298,7 @@ var init_agent_model_requirements = __esm(() => {
model: "gpt-5.5",
variant: "high"
},
- { providers: ["opencode-go", "vercel"], model: "glm-5.1" },
+ { providers: ["opencode-go", "vercel"], model: "glm-5.2" },
{
providers: ["google", "github-copilot", "opencode", "vercel"],
model: "gemini-3.1-pro"
@@ -9316,12 +9321,17 @@ var init_agent_model_requirements = __esm(() => {
model: "gpt-5.5",
variant: "high"
},
- { providers: ["opencode-go", "vercel"], model: "glm-5.1" },
+ { providers: ["opencode-go", "vercel"], model: "glm-5.2" },
{ providers: ["kimi-for-coding"], model: "k2p5" }
]
},
momus: {
fallbackChain: [
+ {
+ providers: ["openai", "vercel"],
+ model: "gpt-5.6-sol",
+ variant: "xhigh"
+ },
{
providers: ["openai", "github-copilot", "opencode", "vercel"],
model: "gpt-5.5",
@@ -9337,7 +9347,7 @@ var init_agent_model_requirements = __esm(() => {
model: "gemini-3.1-pro",
variant: "high"
},
- { providers: ["opencode-go", "vercel"], model: "glm-5.1" }
+ { providers: ["opencode-go", "vercel"], model: "glm-5.2" }
]
},
atlas: {
@@ -9389,12 +9399,17 @@ var init_category_model_requirements = __esm(() => {
model: "claude-opus-4-7",
variant: "max"
},
- { providers: ["opencode-go", "vercel"], model: "glm-5.1" },
+ { providers: ["opencode-go", "vercel"], model: "glm-5.2" },
{ providers: ["kimi-for-coding"], model: "k2p5" }
]
},
ultrabrain: {
fallbackChain: [
+ {
+ providers: ["openai", "vercel"],
+ model: "gpt-5.6-sol",
+ variant: "xhigh"
+ },
{
providers: ["openai", "opencode", "vercel"],
model: "gpt-5.5",
@@ -9410,11 +9425,16 @@ var init_category_model_requirements = __esm(() => {
model: "claude-opus-4-7",
variant: "max"
},
- { providers: ["opencode-go", "vercel"], model: "glm-5.1" }
+ { providers: ["opencode-go", "vercel"], model: "glm-5.2" }
]
},
deep: {
fallbackChain: [
+ {
+ providers: ["openai", "vercel"],
+ model: "gpt-5.6-sol",
+ variant: "high"
+ },
{
providers: ["openai", "github-copilot", "opencode", "vercel"],
model: "gpt-5.5",
@@ -9431,7 +9451,7 @@ var init_category_model_requirements = __esm(() => {
variant: "high"
},
{ providers: ["opencode-go", "vercel"], model: "kimi-k2.6" },
- { providers: ["opencode-go", "vercel"], model: "glm-5.1" }
+ { providers: ["opencode-go", "vercel"], model: "glm-5.2" }
]
},
artistry: {
@@ -9448,7 +9468,7 @@ var init_category_model_requirements = __esm(() => {
},
{ providers: ["openai", "github-copilot", "opencode", "vercel"], model: "gpt-5.5" },
{ providers: ["opencode-go", "vercel"], model: "kimi-k2.6" },
- { providers: ["opencode-go", "vercel"], model: "glm-5.1" }
+ { providers: ["opencode-go", "vercel"], model: "glm-5.2" }
]
},
quick: {
@@ -9506,7 +9526,7 @@ var init_category_model_requirements = __esm(() => {
},
{ providers: ["zai-coding-plan", "opencode", "bailian-coding-plan", "vercel"], model: "glm-5" },
{ providers: ["kimi-for-coding"], model: "k2p5" },
- { providers: ["opencode-go", "vercel"], model: "glm-5.1" },
+ { providers: ["opencode-go", "vercel"], model: "glm-5.2" },
{ providers: ["opencode", "bailian-coding-plan", "vercel"], model: "kimi-k2.5" },
{
providers: [
@@ -10044,6 +10064,22 @@ var init_supplemental_entries = __esm(() => {
output: 262144
}
},
+ "gpt-5.6-sol": {
+ id: "gpt-5.6-sol",
+ family: "gpt",
+ reasoning: true,
+ temperature: false,
+ toolCall: true,
+ modalities: {
+ input: ["text", "image", "pdf"],
+ output: ["text"]
+ },
+ limit: {
+ context: 1050000,
+ input: 922000,
+ output: 128000
+ }
+ },
"gpt-5.5": {
id: "gpt-5.5",
family: "gpt",
@@ -10868,11 +10904,15 @@ function isGpt5_5Model(model) {
const modelName = extractModelName(model).toLowerCase();
return modelName.includes("gpt-5.5") || modelName.includes("gpt-5-5");
}
+function isGpt5_6Model(model) {
+ const modelName = extractModelName(model).toLowerCase();
+ return modelName.includes("gpt-5.6") || modelName.includes("gpt-5-6");
+}
var init_types = () => {};
// packages/omo-opencode/src/tools/delegate-task/openai-categories.ts
function resolveDeepCategoryPromptAppend(model) {
- if (model && isGpt5_5Model(model)) {
+ if (model && (isGpt5_5Model(model) || isGpt5_6Model(model))) {
return DEEP_CATEGORY_PROMPT_APPEND_GPT_5_5;
}
return DEEP_CATEGORY_PROMPT_APPEND;
@@ -10991,13 +11031,13 @@ var init_openai_categories = __esm(() => {
OPENAI_CATEGORIES = [
{
name: "ultrabrain",
- config: { model: "openai/gpt-5.5", variant: "xhigh" },
+ config: { model: "openai/gpt-5.6-sol", variant: "xhigh" },
description: "Use ONLY for genuinely hard, logic-heavy tasks. Give clear goals only, not step-by-step instructions.",
promptAppend: ULTRABRAIN_CATEGORY_PROMPT_APPEND
},
{
name: "deep",
- config: { model: "openai/gpt-5.5", variant: "medium" },
+ config: { model: "openai/gpt-5.6-sol", variant: "high" },
description: "Goal-oriented autonomous problem-solving on hairy problems requiring deep research. ONE goal + ONE deliverable per call — multiple goals must fan out as parallel `deep` calls, never bundled into one.",
promptAppend: DEEP_CATEGORY_PROMPT_APPEND,
resolvePromptAppend: resolveDeepCategoryPromptAppend
@@ -64594,6 +64634,66 @@ async function probe(registration) {
return false;
}
}
+async function probeSessionAffinity(registration, sessionID) {
+ if (!registration.serverUrl) {
+ return;
+ }
+ const probeUrl = new URL(`/session/${sessionID}`, registration.serverUrl);
+ const authHeader = getServerBasicAuthHeader();
+ const headers = authHeader ? { Authorization: authHeader } : {};
+ try {
+ const controller = new AbortController;
+ const timeoutId = setTimeout(() => controller.abort(), PROBE_ABORT_MS);
+ let response;
+ try {
+ response = await getFetch()(probeUrl, { headers, signal: controller.signal });
+ } finally {
+ clearTimeout(timeoutId);
+ }
+ if (response.ok) {
+ setSessionAffinity(registration, sessionID, true);
+ return true;
+ }
+ if (response.status === 404) {
+ setSessionAffinity(registration, sessionID, false);
+ log2("[live-server-route] live listener does not own session; falling back to in-process client", { sessionID });
+ return false;
+ }
+ return;
+ } catch {
+ return;
+ }
+}
+function setSessionAffinity(registration, sessionID, owned) {
+ const now = Date.now();
+ for (const [key, entry] of registration.sessionAffinity) {
+ if (now - entry.timestamp >= AFFINITY_TTL_MS) {
+ registration.sessionAffinity.delete(key);
+ }
+ }
+ registration.sessionAffinity.set(sessionID, { owned, timestamp: now });
+}
+function getFreshSessionAffinity(registration, sessionID) {
+ const entry = registration.sessionAffinity.get(sessionID);
+ if (!entry || Date.now() - entry.timestamp >= AFFINITY_TTL_MS) {
+ return;
+ }
+ return entry.owned;
+}
+async function resolveSessionAffinity(registration, sessionID) {
+ const cached = getFreshSessionAffinity(registration, sessionID);
+ if (cached !== undefined) {
+ return cached;
+ }
+ let inFlight = registration.inFlightAffinity.get(sessionID);
+ if (!inFlight) {
+ inFlight = probeSessionAffinity(registration, sessionID).finally(() => {
+ registration.inFlightAffinity.delete(sessionID);
+ });
+ registration.inFlightAffinity.set(sessionID, inFlight);
+ }
+ return inFlight;
+}
function getFreshProbeAvailability(registration) {
const available = registration.available;
if (available === undefined || Date.now() - registration.probeTimestamp >= PROBE_TTL_MS) {
@@ -64646,6 +64746,13 @@ function tryResolveDispatchClientSync2(client3, sessionID) {
if (!freshAvailability) {
return { client: client3, route: "in-process", reason: "unavailable" };
}
+ const cachedAffinity = getFreshSessionAffinity(registration, sessionID);
+ if (cachedAffinity === undefined) {
+ return;
+ }
+ if (!cachedAffinity) {
+ return { client: client3, route: "in-process", reason: "affinity" };
+ }
const resolvedLiveClient = getOrBuildLiveClient(registration);
if (!resolvedLiveClient) {
return { client: client3, route: "in-process", reason: "unavailable" };
@@ -64665,6 +64772,10 @@ async function resolveDispatchClient2(client3, sessionID) {
if (!isAvailable) {
return { client: client3, route: "in-process", reason: "unavailable" };
}
+ const affinity = await resolveSessionAffinity(registration, sessionID);
+ if (affinity === false) {
+ return { client: client3, route: "in-process", reason: "affinity" };
+ }
const resolvedLiveClient = getOrBuildLiveClient(registration);
if (!resolvedLiveClient) {
return { client: client3, route: "in-process", reason: "unavailable" };
@@ -64702,10 +64813,11 @@ function markLiveRouteUnavailable2(reason) {
for (const registration of registrations.values()) {
registration.available = false;
registration.probeTimestamp = Date.now();
+ registration.sessionAffinity.clear();
}
log2(`[live-server-route] marked unavailable: ${reason}`);
}
-var PROBE_TTL_MS = 60000, PROBE_ABORT_MS = 1500, registrations, liveParentWakeRoutingDisabled = false, fetchImplementationForTesting;
+var PROBE_TTL_MS = 60000, PROBE_ABORT_MS = 1500, AFFINITY_TTL_MS = 60000, registrations, liveParentWakeRoutingDisabled = false, fetchImplementationForTesting;
var init_live_server_route = __esm(() => {
init_dist();
init_state();
@@ -66689,21 +66801,21 @@ var init_config_manager = __esm(() => {
});
// packages/telemetry-core/src/activity-state.ts
-import { existsSync as existsSync28, mkdirSync as mkdirSync8, readFileSync as readFileSync13 } from "node:fs";
-import { basename as basename10, join as join51 } from "node:path";
+import { existsSync as existsSync28, mkdirSync as mkdirSync8, readFileSync as readFileSync14 } from "node:fs";
+import { basename as basename10, join as join53 } from "node:path";
function resolveTelemetryStateDir(product, options = {}) {
const dataDir = resolveXdgDataDir(product.cacheDirName, {
env: options.env,
osProvider: options.osProvider
});
- const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined : join51(options.env.XDG_DATA_HOME, product.cacheDirName);
+ const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined : join53(options.env.XDG_DATA_HOME, product.cacheDirName);
if (dataDir === xdgStateDir || xdgStateDir === undefined && basename10(dataDir) === product.cacheDirName) {
return dataDir;
}
- return join51(dataDir, product.cacheDirName);
+ return join53(dataDir, product.cacheDirName);
}
function getTelemetryActivityStateFilePath(stateDir) {
- return join51(stateDir, POSTHOG_ACTIVITY_STATE_FILE);
+ return join53(stateDir, POSTHOG_ACTIVITY_STATE_FILE);
}
function getDailyActiveCaptureState(input) {
const state = readPostHogActivityState(input.stateDir, input.diagnostics);
@@ -66732,7 +66844,7 @@ function readPostHogActivityState(stateDir, diagnostics) {
return {};
}
try {
- const stateContent = readFileSync13(stateFilePath, "utf-8");
+ const stateContent = readFileSync14(stateFilePath, "utf-8");
const stateJson = JSON.parse(stateContent);
if (!isPostHogActivityState(stateJson)) {
return {};
@@ -66773,10 +66885,10 @@ var init_activity_state = __esm(() => {
var DEFAULT_POSTHOG_HOST = "https://us.i.posthog.com", DEFAULT_POSTHOG_API_KEY = "phc_CFJhj5HyvA62QPhvyaUCtaq23aUfznnijg5VaaGkNk74";
// packages/telemetry-core/src/diagnostics.ts
-import { appendFileSync as appendFileSync2, existsSync as existsSync29, mkdirSync as mkdirSync9, readFileSync as readFileSync14 } from "node:fs";
-import { join as join52 } from "node:path";
+import { appendFileSync as appendFileSync2, existsSync as existsSync29, mkdirSync as mkdirSync9, readFileSync as readFileSync15 } from "node:fs";
+import { join as join54 } from "node:path";
function getTelemetryDiagnosticsFilePath(diagnosticsDir) {
- return join52(diagnosticsDir, DIAGNOSTICS_FILE_NAME);
+ return join54(diagnosticsDir, DIAGNOSTICS_FILE_NAME);
}
function writeTelemetryDiagnostic(input, options) {
const now = options.now ?? new Date;
@@ -66799,7 +66911,7 @@ function cleanupTelemetryDiagnostics(options) {
}
try {
const cutoffMs = (options.now ?? new Date).getTime() - DIAGNOSTICS_RETENTION_MS;
- const retainedLines = trimToMaxBytes(readFileSync14(diagnosticsFilePath, "utf-8").split(`
+ const retainedLines = trimToMaxBytes(readFileSync15(diagnosticsFilePath, "utf-8").split(`
`).filter((line) => shouldRetainLine(line, cutoffMs)));
writeFileAtomically(diagnosticsFilePath, retainedLines.length === 0 ? "" : `${retainedLines.join(`
`)}
@@ -66851,7 +66963,7 @@ function shouldRetainLine(line, cutoffMs) {
function parseDiagnosticLine(line) {
try {
const parsed = JSON.parse(line);
- if (!isRecord4(parsed)) {
+ if (!isRecord5(parsed)) {
return null;
}
return parsed;
@@ -66862,7 +66974,7 @@ function parseDiagnosticLine(line) {
throw error;
}
}
-function isRecord4(value) {
+function isRecord5(value) {
return value !== null && typeof value === "object" && !Array.isArray(value);
}
function trimToMaxBytes(lines) {
@@ -66942,7 +67054,7 @@ function getTelemetryDistinctId(machineIdPrefix, osProvider = getDefaultTelemetr
var init_machine_id = () => {};
// node_modules/.bun/[email protected]/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
-import { dirname as dirname17, posix as posix2, sep as sep7 } from "path";
+import { dirname as dirname18, posix as posix2, sep as sep7 } from "path";
function createModulerModifier() {
const getModuleFromFileName = createGetModuleFromFilename();
return async (frames) => {
@@ -66951,7 +67063,7 @@ function createModulerModifier() {
return frames;
};
}
-function createGetModuleFromFilename(basePath = process.argv[1] ? dirname17(process.argv[1]) : process.cwd(), isWindows = sep7 === "\\") {
+function createGetModuleFromFilename(basePath = process.argv[1] ? dirname18(process.argv[1]) : process.cwd(), isWindows = sep7 === "\\") {
const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;
return (filename) => {
if (!filename)
@@ -69972,7 +70084,7 @@ var init_context_lines_node = __esm(() => {
});
// node_modules/.bun/[email protected]/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/relative-path.node.mjs
-import { isAbsolute as isAbsolute8, relative as relative5, sep as sep8 } from "path";
+import { isAbsolute as isAbsolute9, relative as relative5, sep as sep8 } from "path";
function createRelativePathModifier(basePath = process.cwd()) {
const isWindows = sep8 === "\\";
const toUnix = (p) => isWindows ? p.replace(/\\/g, "/") : p;
@@ -69980,7 +70092,7 @@ function createRelativePathModifier(basePath = process.cwd()) {
return async (frames) => {
for (const frame of frames)
if (!(!frame.filename || frame.filename.startsWith("node:") || frame.filename.startsWith("data:"))) {
- if (isAbsolute8(frame.filename))
+ if (isAbsolute9(frame.filename))
frame.filename = toUnix(relative5(normalizedBase, toUnix(frame.filename)));
}
return frames;
@@ -72497,7 +72609,7 @@ var package_default2;
var init_package2 = __esm(() => {
package_default2 = {
name: "@oh-my-opencode/omo-codex",
- version: "4.16.2",
+ version: "4.16.3",
type: "module",
private: true,
description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
@@ -73467,19 +73579,19 @@ var init_update_toasts = __esm(() => {
// packages/omo-opencode/src/hooks/auto-update-checker/hook/background-update-check.ts
import { existsSync as existsSync49 } from "node:fs";
-import { dirname as dirname27, join as join70 } from "node:path";
+import { dirname as dirname28, join as join72 } from "node:path";
import { fileURLToPath as fileURLToPath5 } from "node:url";
function defaultGetModuleHostingWorkspace() {
try {
- const currentDir = dirname27(fileURLToPath5(import.meta.url));
+ const currentDir = dirname28(fileURLToPath5(import.meta.url));
const pkgJsonPath = findPackageJsonUp(currentDir);
if (!pkgJsonPath)
return null;
- const pkgDir = dirname27(pkgJsonPath);
- const nodeModulesDir = dirname27(pkgDir);
+ const pkgDir = dirname28(pkgJsonPath);
+ const nodeModulesDir = dirname28(pkgDir);
if (nodeModulesDir.split(/[\\/]/).pop() !== "node_modules")
return null;
- return dirname27(nodeModulesDir);
+ return dirname28(nodeModulesDir);
} catch (error51) {
if (error51 instanceof Error) {
return null;
@@ -73621,7 +73733,7 @@ var init_background_update_check = __esm(() => {
init_update_toasts();
defaultDeps4 = {
existsSync: existsSync49,
- join: join70,
+ join: join72,
runBunInstallWithDetails,
log: log2,
getOpenCodeCacheDir,
@@ -74230,7 +74342,7 @@ function getUnsupportedOpenCodeVersionMessage(openCodeVersion) {
}
// packages/omo-codex/src/install/install-codex.ts
-import { join as join53, resolve as resolve15 } from "node:path";
+import { join as join55, resolve as resolve15 } from "node:path";
import { existsSync as existsSync30 } from "node:fs";
import { homedir as homedir6 } from "node:os";
@@ -75520,7 +75632,7 @@ async function shouldBuildSourcePackages(repoRoot) {
// packages/omo-codex/src/install/codex-config-toml.ts
import { mkdir as mkdir5, readFile as readFile11 } from "node:fs/promises";
-import { dirname as dirname15 } from "node:path";
+import { dirname as dirname16 } from "node:path";
// packages/omo-codex/src/install/toml-section-editor.ts
function findTomlSection(config, header) {
@@ -76357,30 +76469,87 @@ function isRootSetting2(line, key) {
}
// packages/omo-codex/src/install/codex-multi-agent-v2-config.ts
+import { readFileSync as readFileSync13 } from "node:fs";
+import { dirname as dirname15, isAbsolute as isAbsolute8, join as join39 } from "node:path";
var CODEX_AGENTS_HEADER = "agents";
var CODEX_MULTI_AGENT_V2_HEADER = "features.multi_agent_v2";
var CODEX_SUBAGENT_THREAD_LIMIT = 1000;
-function ensureCodexMultiAgentV2Config(config) {
+function ensureCodexMultiAgentV2Config(config, options = {}) {
const featureFlag = removeFeatureFlagSetting(config, "multi_agent_v2");
- const agentsConfig = ensureAgentsMaxThreads(featureFlag.config);
- const section = findTomlSection(agentsConfig, CODEX_MULTI_AGENT_V2_HEADER);
+ const v2Preferred = options.multiAgentVersion === "v2";
+ const modelKnown = options.multiAgentVersion != null || readRootModel(featureFlag.config) !== null;
+ const agentsConfig = v2Preferred ? removeAgentsMaxThreads(featureFlag.config) : modelKnown ? ensureAgentsMaxThreads(featureFlag.config) : raiseExistingAgentsMaxThreads(featureFlag.config);
const maxThreadsValue = CODEX_SUBAGENT_THREAD_LIMIT.toString();
+ const preserveDisable = featureFlag.value === false && !v2Preferred;
+ const featureConfig = preserveDisable ? setMultiAgentV2Disable(agentsConfig) : v2Preferred ? removeMultiAgentV2Disable(agentsConfig) : agentsConfig;
+ const section = findTomlSection(featureConfig, CODEX_MULTI_AGENT_V2_HEADER);
if (!section) {
- const enabledSetting = featureFlag.value === false ? `enabled = false
+ const enabledSetting = preserveDisable ? `enabled = false
` : "";
- return appendBlock(agentsConfig, `[${CODEX_MULTI_AGENT_V2_HEADER}]
+ return appendBlock(featureConfig, `[${CODEX_MULTI_AGENT_V2_HEADER}]
${enabledSetting}max_concurrent_threads_per_session = ${maxThreadsValue}
`);
}
- const withPreservedDisable = featureFlag.value === false ? replaceOrInsertSetting(agentsConfig, section, "enabled", "false") : agentsConfig;
- const updatedSection = featureFlag.value === false ? findTomlSection(withPreservedDisable, CODEX_MULTI_AGENT_V2_HEADER) : section;
- if (!updatedSection) {
- return appendBlock(withPreservedDisable, `[${CODEX_MULTI_AGENT_V2_HEADER}]
-enabled = false
-max_concurrent_threads_per_session = ${maxThreadsValue}
-`);
+ return replaceOrInsertSetting(featureConfig, section, "max_concurrent_threads_per_session", maxThreadsValue);
+}
+function resolveCodexMultiAgentVersion(config, configPath) {
+ const model = readRootModel(config);
+ if (model === null)
+ return null;
+ const catalogPath = resolveCatalogPath(readRootModelCatalogPath(config), configPath);
+ const catalogVersion = readCatalogMultiAgentVersion(model, catalogPath);
+ if (catalogVersion !== null)
+ return catalogVersion;
+ return /^gpt-5\.6\b/i.test(model) ? "v2" : null;
+}
+function resolveCatalogPath(configuredPath, configPath) {
+ if (configuredPath === null)
+ return join39(dirname15(configPath), "models_cache.json");
+ return isAbsolute8(configuredPath) ? configuredPath : join39(dirname15(configPath), configuredPath);
+}
+function readCatalogMultiAgentVersion(model, cachePath) {
+ let raw;
+ try {
+ raw = readFileSync13(cachePath, "utf8");
+ } catch {
+ return null;
}
- return replaceOrInsertSetting(withPreservedDisable, updatedSection, "max_concurrent_threads_per_session", maxThreadsValue);
+ let cache;
+ try {
+ cache = JSON.parse(raw);
+ } catch {
+ return null;
+ }
+ if (!isRecord4(cache) || !Array.isArray(cache.models))
+ return null;
+ for (const entry of cache.models) {
+ if (!isRecord4(entry))
+ continue;
+ if (entry.slug !== model && entry.id !== model)
+ continue;
+ const version = entry.multi_agent_version;
+ if (version === "v1" || version === "v2")
+ return version;
+ return null;
+ }
+ return null;
+}
+function readRootModel(config) {
+ const double = config.match(/^\s*model\s*=\s*"([^"]+)"/m);
+ if (double !== null)
+ return double[1] ?? null;
+ const single = config.match(/^\s*model\s*=\s*'([^']+)'/m);
+ return single?.[1] ?? null;
+}
+function readRootModelCatalogPath(config) {
+ const double = config.match(/^\s*model_catalog_json\s*=\s*"([^"]+)"/m);
+ if (double !== null)
+ return double[1] ?? null;
+ const single = config.match(/^\s*model_catalog_json\s*=\s*'([^']+)'/m);
+ return single?.[1] ?? null;
+}
+function isRecord4(value) {
+ return typeof value === "object" && value !== null && !Array.isArray(value);
}
function removeFeatureFlagSetting(config, featureName) {
const section = findTomlSection(config, "features");
@@ -76401,6 +76570,36 @@ max_threads = ${maxThreadsValue}
}
return replaceOrInsertSetting(config, section, "max_threads", maxThreadsValue);
}
+function removeAgentsMaxThreads(config) {
+ const section = findTomlSection(config, CODEX_AGENTS_HEADER);
+ if (!section)
+ return config;
+ if (!/^\s*max_threads\s*=/m.test(section.text))
+ return config;
+ return removeSetting(config, section, "max_threads");
+}
+function removeMultiAgentV2Disable(config) {
+ const section = findTomlSection(config, CODEX_MULTI_AGENT_V2_HEADER);
+ if (!section)
+ return config;
+ if (!/^\s*enabled\s*=\s*false(?:\s*#.*)?$/m.test(section.text))
+ return config;
+ return removeSetting(config, section, "enabled");
+}
+function setMultiAgentV2Disable(config) {
+ const section = findTomlSection(config, CODEX_MULTI_AGENT_V2_HEADER);
+ if (!section)
+ return config;
+ return replaceOrInsertSetting(config, section, "enabled", "false");
+}
+function raiseExistingAgentsMaxThreads(config) {
+ const section = findTomlSection(config, CODEX_AGENTS_HEADER);
+ if (!section)
+ return config;
+ if (!/^\s*max_threads\s*=/m.test(section.text))
+ return config;
+ return replaceOrInsertSetting(config, section, "max_threads", CODEX_SUBAGENT_THREAD_LIMIT.toString());
+}
function readBooleanSetting(sectionText, key) {
const match = new RegExp(`^\\s*${escapeRegExp(key)}\\s*=\\s*(true|false)\\s*(?:#.*)?$`, "m").exec(sectionText);
if (!match)
@@ -76410,7 +76609,7 @@ function readBooleanSetting(sectionText, key) {
// packages/omo-codex/src/install/codex-config-toml.ts
async function updateCodexConfig(input) {
- await mkdir5(dirname15(input.configPath), { recursive: true });
+ await mkdir5(dirname16(input.configPath), { recursive: true });
let config;
try {
config = await readFile11(input.configPath, "utf8");
@@ -76433,7 +76632,9 @@ async function updateCodexConfig(input) {
config = ensureFeatureEnabled(config, "multi_agent");
config = removeUnsupportedCodexMultiAgentModeConfig(config);
config = ensureCodexReasoningConfig(config, await readCodexModelCatalog(input.repoRoot));
- config = ensureCodexMultiAgentV2Config(config);
+ config = ensureCodexMultiAgentV2Config(config, {
+ multiAgentVersion: resolveCodexMultiAgentVersion(config, input.configPath)
+ });
if (input.autonomousPermissions === true)
config = ensureAutonomousPermissions(config);
if (!(input.preserveMarketplaceSource === true && hasMarketplaceBlock(config, input.marketplaceName))) {
@@ -76459,7 +76660,7 @@ function isMissingFileError(error) {
// packages/omo-codex/src/install/codex-hook-trust.ts
import { createHash as createHash2 } from "node:crypto";
import { readFile as readFile12 } from "node:fs/promises";
-import { join as join39 } from "node:path";
+import { join as join40 } from "node:path";
var EVENT_LABELS = new Map([
["PreToolUse", "pre_tool_use"],
["PermissionRequest", "permission_request"],
@@ -76473,7 +76674,7 @@ var EVENT_LABELS = new Map([
["Stop", "stop"]
]);
async function trustedHookStatesForPlugin(input) {
- const manifestPath = join39(input.pluginRoot, ".codex-plugin", "plugin.json");
+ const manifestPath = join40(input.pluginRoot, ".codex-plugin", "plugin.json");
if (!await exists(manifestPath))
return [];
const manifest = JSON.parse(await readFile12(manifestPath, "utf8"));
@@ -76481,7 +76682,7 @@ async function trustedHookStatesForPlugin(input) {
return [];
const states = [];
for (const hookPath of hookManifestPaths2(manifest.hooks)) {
- const hooksPath = join39(input.pluginRoot, hookPath);
+ const hooksPath = join40(input.pluginRoot, hookPath);
if (!await exists(hooksPath))
continue;
const parsed = JSON.parse(await readFile12(hooksPath, "utf8"));
@@ -76607,207 +76808,125 @@ function toCodexResolution(resolution) {
}
// packages/omo-codex/src/install/link-cached-plugin-agents.ts
-import { copyFile, lstat as lstat8, mkdir as mkdir6, readFile as readFile14, readdir as readdir6, rm as rm8, writeFile as writeFile6 } from "node:fs/promises";
-import { basename as basename9, join as join41 } from "node:path";
+import { copyFile, lstat as lstat9, mkdir as mkdir6, readdir as readdir7, rm as rm8, writeFile as writeFile7 } from "node:fs/promises";
+import { basename as basename9, join as join43 } from "node:path";
-// packages/omo-codex/src/install/retired-managed-agent-purge.ts
-import { lstat as lstat7, readFile as readFile13, rm as rm7 } from "node:fs/promises";
-import { join as join40 } from "node:path";
-var RETIRED_MANAGED_AGENT_FILES = [
- {
- fileName: "codex-ultrawork-reviewer.toml",
- requiredMarkers: [
- 'name = "codex-ultrawork-reviewer"',
- 'description = "Strict ultrawork verification reviewer.',
- 'developer_instructions = """You are the ultrawork verification reviewer.'
- ]
- }
-];
-async function purgeRetiredManagedAgentFiles(input) {
- const agentsDir = join40(input.codexHome, "agents");
- if (!await exists2(agentsDir))
- return;
- for (const retiredAgent of RETIRED_MANAGED_AGENT_FILES) {
- const agentPath = join40(agentsDir, retiredAgent.fileName);
- if (!await exists2(agentPath))
- continue;
- const agentStat = await lstat7(agentPath);
- if (agentStat.isDirectory() && !agentStat.isSymbolicLink())
- continue;
- const content = await readTextIfExists(agentPath);
- if (content === null || !hasRequiredMarkers(content, retiredAgent.requiredMarkers))
- continue;
- await rm7(agentPath, { force: true });
- }
-}
-function hasRequiredMarkers(content, markers) {
- return markers.every((marker) => content.includes(marker));
-}
-async function readTextIfExists(path7) {
- try {
- return await readFile13(path7, "utf8");
- } catch (error) {
- if (nodeErrorCode(error) === "ENOENT")
- return null;
- throw error;
- }
-}
-async function exists2(path7) {
- try {
- await lstat7(path7);
- return true;
- } catch (error) {
- if (nodeErrorCode(error) !== "ENOENT")
- throw error;
- return false;
+// packages/omo-codex/src/install/preserved-agent-settings.ts
+import { lstat as lstat7, readFile as readFile13, readdir as readdir6, writeFile as writeFile6 } from "node:fs/promises";
+import { join as join41 } from "node:path";
+
+// packages/omo-codex/src/install/managed-agent-reasoning-defaults.ts
+var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
+ [
+ "explorer",
+ {
+ previous: { model: "gpt-5.4-mini", effort: "low" },
+ current: { model: "gpt-5.6-terra", effort: "medium" }
+ }
+ ],
+ [
+ "librarian",
+ {
+ previous: { model: "gpt-5.4-mini", effort: "low" },
+ current: { model: "gpt-5.6-terra", effort: "medium" }
+ }
+ ],
+ [
+ "momus",
+ {
+ previous: { model: "gpt-5.5", effort: "xhigh" },
+ current: { model: "gpt-5.6-sol", effort: "ultra" }
+ }
+ ]
+]);
+function resolveManagedAgentReasoning(input) {
+ const upgrade = MANAGED_REASONING_DEFAULT_UPGRADES.get(input.agentName);
+ if (upgrade !== undefined && input.preserved.model === upgrade.previous.model && input.preserved.effort === upgrade.previous.effort && input.bundledModel === upgrade.current.model && input.bundledEffort === upgrade.current.effort) {
+ return upgrade.current.effort;
}
-}
-function nodeErrorCode(error) {
- if (!(error instanceof Error) || !("code" in error))
- return null;
- return typeof error.code === "string" ? error.code : null;
+ return input.preserved.effort;
}
-// packages/omo-codex/src/install/link-cached-plugin-agents.ts
-var MANIFEST_FILE = ".installed-agents.json";
+// packages/omo-codex/src/install/preserved-agent-settings.ts
async function capturePreservedAgentReasoning(input) {
const agentsDir = join41(input.codexHome, "agents");
- if (!await exists3(agentsDir))
+ if (!await exists2(agentsDir))
return new Map;
const preserved = new Map;
const agentEntries = await readdir6(agentsDir, { withFileTypes: true });
for (const entry of agentEntries) {
if (!entry.name.endsWith(".toml"))
continue;
- const content = await readTextIfExists2(join41(agentsDir, entry.name));
+ const content = await readTextIfExists(join41(agentsDir, entry.name));
if (content === null)
continue;
const effort = extractReasoningEffort(content);
- if (effort !== null)
- preserved.set(agentNameFromToml(entry.name), effort);
+ if (effort !== null) {
+ preserved.set(agentNameFromToml(entry.name), {
+ model: extractModel(content),
+ effort
+ });
+ }
}
return preserved;
}
async function capturePreservedAgentServiceTier(input) {
const agentsDir = join41(input.codexHome, "agents");
- if (!await exists3(agentsDir))
+ if (!await exists2(agentsDir))
return new Map;
const preserved = new Map;
const agentEntries = await readdir6(agentsDir, { withFileTypes: true });
for (const entry of agentEntries) {
if (!entry.name.endsWith(".toml"))
continue;
- const content = await readTextIfExists2(join41(agentsDir, entry.name));
+ const content = await readTextIfExists(join41(agentsDir, entry.name));
if (content === null)
continue;
preserved.set(agentNameFromToml(entry.name), extractServiceTier(content));
}
return preserved;
}
-async function linkCachedPluginAgents(input) {
- const bundledAgents = await discoverBundledAgents(input.pluginRoot);
- await purgeRetiredManagedAgentFiles({ codexHome: input.codexHome });
- if (bundledAgents.length === 0) {
- await writeManifest(input.pluginRoot, []);
- return [];
- }
- const agentsDir = join41(input.codexHome, "agents");
- await mkdir6(agentsDir, { recursive: true });
- const linked = [];
- for (const agentPath of bundledAgents) {
- const agentFileName = basename9(agentPath);
- const agentName = agentNameFromToml(agentFileName);
- const linkPath = join41(agentsDir, agentFileName);
- await replaceWithCopy(linkPath, agentPath);
- await restorePreservedReasoning({
- agentName,
- linkPath,
- target: agentPath,
- value: input.preservedReasoning?.get(agentName)
- });
- await restorePreservedServiceTier({
- linkPath,
- preserved: input.preservedServiceTier?.has(agentName) ?? false,
- value: input.preservedServiceTier?.get(agentName) ?? null
- });
- linked.push({ name: agentFileName, path: linkPath, target: agentPath });
- }
- await writeManifest(input.pluginRoot, linked.map((entry) => entry.path));
- return linked;
-}
-async function restorePreservedServiceTier(input) {
- if (!input.preserved)
+async function restorePreservedReasoning(input) {
+ if (input.value === undefined)
return;
- const content = await readFile14(input.linkPath, "utf8");
- if (extractServiceTier(content) === input.value)
+ const content = await readFile13(input.target, "utf8");
+ const bundledEffort = extractReasoningEffort(content);
+ const effort = resolveManagedAgentReasoning({
+ agentName: input.agentName,
+ bundledModel: extractModel(content),
+ bundledEffort,
+ preserved: input.value
+ });
+ if (bundledEffort === effort)
return;
- const replacement = replaceServiceTier(content, input.value);
+ const replacement = replaceTopLevelStringSetting(content, "model_reasoning_effort", effort, { insertIfMissing: false });
if (!replacement.replaced)
return;
await writeFile6(input.linkPath, replacement.content);
}
-async function discoverBundledAgents(pluginRoot) {
- const componentsRoot = join41(pluginRoot, "components");
- if (!await exists3(componentsRoot))
- return [];
- const componentEntries = await readdir6(componentsRoot, { withFileTypes: true });
- const agents = [];
- for (const entry of componentEntries) {
- if (!entry.isDirectory())
- continue;
- const agentsRoot = join41(componentsRoot, entry.name, "agents");
- if (!await exists3(agentsRoot))
- continue;
- const agentEntries = await readdir6(agentsRoot, { withFileTypes: true });
- for (const file2 of agentEntries) {
- if (!file2.isFile() || !file2.name.endsWith(".toml"))
- continue;
- agents.push(join41(agentsRoot, file2.name));
- }
- }
- agents.sort();
- return agents;
-}
-async function replaceWithCopy(linkPath, target) {
- await prepareReplacement(linkPath);
- await copyFile(target, linkPath);
-}
-async function prepareReplacement(linkPath) {
- if (!await exists3(linkPath))
- return;
- const entryStat = await lstat8(linkPath);
- if (entryStat.isDirectory() && !entryStat.isSymbolicLink()) {
- throw new Error(`${linkPath} already exists and is a directory; refusing to replace`);
- }
- await rm8(linkPath, { force: true });
-}
-async function writeManifest(pluginRoot, agentPaths) {
- const manifestPath = join41(pluginRoot, MANIFEST_FILE);
- const payload = { agents: [...agentPaths].sort() };
- await writeFile6(manifestPath, `${JSON.stringify(payload, null, "\t")}
-`);
-}
-async function restorePreservedReasoning(input) {
- if (input.value === undefined)
+async function restorePreservedServiceTier(input) {
+ if (!input.preserved)
return;
- const content = await readFile14(input.target, "utf8");
- const bundledEffort = extractReasoningEffort(content);
- if (bundledEffort === input.value)
+ const content = await readFile13(input.linkPath, "utf8");
+ if (extractServiceTier(content) === input.value)
return;
- const replacement = replaceReasoningEffort(content, input.value);
+ const replacement = replaceTopLevelStringSetting(content, "service_tier", input.value, { insertIfMissing: true });
if (!replacement.replaced)
return;
await writeFile6(input.linkPath, replacement.content);
}
-async function readTextIfExists2(path7) {
+async function readTextIfExists(path7) {
try {
- return await readFile14(path7, "utf8");
+ return await readFile13(path7, "utf8");
} catch (error) {
- if (nodeErrorCode2(error) === "ENOENT")
+ if (nodeErrorCode(error) === "ENOENT")
return null;
throw error;
}
}
+function extractModel(content) {
+ return extractTopLevelStringSetting(content, "model");
+}
function extractReasoningEffort(content) {
return extractTopLevelStringSetting(content, "model_reasoning_effort");
}
@@ -76827,12 +76946,6 @@ function extractTopLevelStringSetting(content, key) {
}
return null;
}
-function replaceReasoningEffort(content, value) {
- return replaceTopLevelStringSetting(content, "model_reasoning_effort", value, { insertIfMissing: false });
-}
-function replaceServiceTier(content, value) {
- return replaceTopLevelStringSetting(content, "service_tier", value, { insertIfMissing: true });
-}
function replaceTopLevelStringSetting(content, key, value, options) {
const lines = content.split(/\n/);
for (let index = 0;index < lines.length; index += 1) {
@@ -76892,6 +77005,64 @@ function parseJsonString(value) {
return null;
}
}
+async function exists2(path7) {
+ try {
+ await lstat7(path7);
+ return true;
+ } catch (error) {
+ if (nodeErrorCode(error) !== "ENOENT")
+ throw error;
+ return false;
+ }
+}
+function nodeErrorCode(error) {
+ if (!(error instanceof Error) || !("code" in error))
+ return null;
+ return typeof error.code === "string" ? error.code : null;
+}
+
+// packages/omo-codex/src/install/retired-managed-agent-purge.ts
+import { lstat as lstat8, readFile as readFile14, rm as rm7 } from "node:fs/promises";
+import { join as join42 } from "node:path";
+var RETIRED_MANAGED_AGENT_FILES = [
+ {
+ fileName: "codex-ultrawork-reviewer.toml",
+ requiredMarkers: [
+ 'name = "codex-ultrawork-reviewer"',
+ 'description = "Strict ultrawork verification reviewer.',
+ 'developer_instructions = """You are the ultrawork verification reviewer.'
+ ]
+ }
+];
+async function purgeRetiredManagedAgentFiles(input) {
+ const agentsDir = join42(input.codexHome, "agents");
+ if (!await exists3(agentsDir))
+ return;
+ for (const retiredAgent of RETIRED_MANAGED_AGENT_FILES) {
+ const agentPath = join42(agentsDir, retiredAgent.fileName);
+ if (!await exists3(agentPath))
+ continue;
+ const agentStat = await lstat8(agentPath);
+ if (agentStat.isDirectory() && !agentStat.isSymbolicLink())
+ continue;
+ const content = await readTextIfExists2(agentPath);
+ if (content === null || !hasRequiredMarkers(content, retiredAgent.requiredMarkers))
+ continue;
+ await rm7(agentPath, { force: true });
+ }
+}
+function hasRequiredMarkers(content, markers) {
+ return markers.every((marker) => content.includes(marker));
+}
+async function readTextIfExists2(path7) {
+ try {
+ return await readFile14(path7, "utf8");
+ } catch (error) {
+ if (nodeErrorCode2(error) === "ENOENT")
+ return null;
+ throw error;
+ }
+}
async function exists3(path7) {
try {
await lstat8(path7);
@@ -76908,12 +77079,105 @@ function nodeErrorCode2(error) {
return typeof error.code === "string" ? error.code : null;
}
+// packages/omo-codex/src/install/link-cached-plugin-agents.ts
+var MANIFEST_FILE = ".installed-agents.json";
+async function linkCachedPluginAgents(input) {
+ const bundledAgents = await discoverBundledAgents(input.pluginRoot);
+ await purgeRetiredManagedAgentFiles({ codexHome: input.codexHome });
+ if (bundledAgents.length === 0) {
+ await writeManifest(input.pluginRoot, []);
+ return [];
+ }
+ const agentsDir = join43(input.codexHome, "agents");
+ await mkdir6(agentsDir, { recursive: true });
+ const linked = [];
+ for (const agentPath of bundledAgents) {
+ const agentFileName = basename9(agentPath);
+ const agentName = agentNameFromToml2(agentFileName);
+ const linkPath = join43(agentsDir, agentFileName);
+ await replaceWithCopy(linkPath, agentPath);
+ await restorePreservedReasoning({
+ agentName,
+ linkPath,
+ target: agentPath,
+ value: input.preservedReasoning?.get(agentName)
+ });
+ await restorePreservedServiceTier({
+ linkPath,
+ preserved: input.preservedServiceTier?.has(agentName) ?? false,
+ value: input.preservedServiceTier?.get(agentName) ?? null
+ });
+ linked.push({ name: agentFileName, path: linkPath, target: agentPath });
+ }
+ await writeManifest(input.pluginRoot, linked.map((entry) => entry.path));
+ return linked;
+}
+async function discoverBundledAgents(pluginRoot) {
+ const componentsRoot = join43(pluginRoot, "components");
+ if (!await exists4(componentsRoot))
+ return [];
+ const componentEntries = await readdir7(componentsRoot, { withFileTypes: true });
+ const agents = [];
+ for (const entry of componentEntries) {
+ if (!entry.isDirectory())
+ continue;
+ const agentsRoot = join43(componentsRoot, entry.name, "agents");
+ if (!await exists4(agentsRoot))
+ continue;
+ const agentEntries = await readdir7(agentsRoot, { withFileTypes: true });
+ for (const file2 of agentEntries) {
+ if (!file2.isFile() || !file2.name.endsWith(".toml"))
+ continue;
+ agents.push(join43(agentsRoot, file2.name));
+ }
+ }
+ agents.sort();
+ return agents;
+}
+async function replaceWithCopy(linkPath, target) {
+ await prepareReplacement(linkPath);
+ await copyFile(target, linkPath);
+}
+async function prepareReplacement(linkPath) {
+ if (!await exists4(linkPath))
+ return;
+ const entryStat = await lstat9(linkPath);
+ if (entryStat.isDirectory() && !entryStat.isSymbolicLink()) {
+ throw new Error(`${linkPath} already exists and is a directory; refusing to replace`);
+ }
+ await rm8(linkPath, { force: true });
+}
+async function writeManifest(pluginRoot, agentPaths) {
+ const manifestPath = join43(pluginRoot, MANIFEST_FILE);
+ const payload = { agents: [...agentPaths].sort() };
+ await writeFile7(manifestPath, `${JSON.stringify(payload, null, "\t")}
+`);
+}
+function agentNameFromToml2(fileName) {
+ return fileName.endsWith(".toml") ? fileName.slice(0, -".toml".length) : fileName;
+}
+async function exists4(path7) {
+ try {
+ await lstat9(path7);
+ return true;
+ } catch (error) {
+ if (nodeErrorCode3(error) !== "ENOENT")
+ throw error;
+ return false;
+ }
+}
+function nodeErrorCode3(error) {
+ if (!(error instanceof Error) || !("code" in error))
+ return null;
+ return typeof error.code === "string" ? error.code : null;
+}
+
// packages/omo-codex/src/install/codex-marketplace.ts
import { readFile as readFile15 } from "node:fs/promises";
-import { join as join42 } from "node:path";
+import { join as join44 } from "node:path";
var DEFAULT_MARKETPLACE_PATH = "packages/omo-codex/marketplace.json";
async function readMarketplace(repoRoot, options) {
- const marketplacePath = options?.marketplacePath ?? join42(repoRoot, DEFAULT_MARKETPLACE_PATH);
+ const marketplacePath = options?.marketplacePath ?? join44(repoRoot, DEFAULT_MARKETPLACE_PATH);
const raw = await readFile15(marketplacePath, "utf8");
const parsed = JSON.parse(raw);
if (!isPlainRecord3(parsed))
@@ -76932,10 +77196,10 @@ async function readMarketplace(repoRoot, options) {
function resolvePluginSource(repoRoot, plugin, options) {
const sourcePath = localSourcePath(options?.pathOverride ?? plugin.source);
const relativePath = sourcePath.slice(2);
- return join42(repoRoot, ...relativePath.split(/[\\/]/));
+ return join44(repoRoot, ...relativePath.split(/[\\/]/));
}
async function readPluginManifest(pluginRoot) {
- const raw = await readFile15(join42(pluginRoot, ".codex-plugin", "plugin.json"), "utf8");
+ const raw = await readFile15(join44(pluginRoot, ".codex-plugin", "plugin.json"), "utf8");
const parsed = JSON.parse(raw);
if (!isPlainRecord3(parsed))
throw new Error(`${pluginRoot} plugin.json must be an object`);
@@ -77016,8 +77280,8 @@ function validateLocalSourcePath(path7) {
}
// packages/omo-codex/src/install/codex-marketplace-snapshot.ts
-import { cp as cp3, mkdir as mkdir7, rename as rename4, rm as rm9, writeFile as writeFile7 } from "node:fs/promises";
-import { join as join43, sep as sep6 } from "node:path";
+import { cp as cp3, mkdir as mkdir7, rename as rename4, rm as rm9, writeFile as writeFile8 } from "node:fs/promises";
+import { join as join45, sep as sep6 } from "node:path";
var INSTALLED_MARKETPLACES_DIR = ".tmp/marketplaces";
async function writeInstalledMarketplaceSnapshot(input) {
const marketplaceRoot = installedMarketplaceRoot(input.codexHome, input.marketplace.name);
@@ -77030,21 +77294,21 @@ async function writeInstalledMarketplaceSnapshot(input) {
return snapshotPlugins;
}
function installedMarketplaceRoot(codexHome, marketplaceName) {
- return join43(codexHome, INSTALLED_MARKETPLACES_DIR, marketplaceName);
+ return join45(codexHome, INSTALLED_MARKETPLACES_DIR, marketplaceName);
}
async function writeMarketplaceManifest(marketplaceRoot, marketplace) {
- const manifestDir = join43(marketplaceRoot, ".agents", "plugins");
+ const manifestDir = join45(marketplaceRoot, ".agents", "plugins");
await mkdir7(manifestDir, { recursive: true });
- const tempPath = join43(manifestDir, `.marketplace-${process.pid}-${Date.now()}.json.tmp`);
- await writeFile7(tempPath, `${JSON.stringify(marketplace, null, "\t")}
+ const tempPath = join45(manifestDir, `.marketplace-${process.pid}-${Date.now()}.json.tmp`);
+ await writeFile8(tempPath, `${JSON.stringify(marketplace, null, "\t")}
`);
- await rename4(tempPath, join43(manifestDir, "marketplace.json"));
+ await rename4(tempPath, join45(manifestDir, "marketplace.json"));
}
async function writeSnapshotPlugin(marketplaceRoot, plugin) {
- const pluginsDir = join43(marketplaceRoot, "plugins");
+ const pluginsDir = join45(marketplaceRoot, "plugins");
await mkdir7(pluginsDir, { recursive: true });
- const targetPath = join43(pluginsDir, plugin.name);
- const tempPath = join43(pluginsDir, `.tmp-${plugin.name}-${process.pid}-${Date.now()}`);
+ const targetPath = join45(pluginsDir, plugin.name);
+ const tempPath = join45(pluginsDir, `.tmp-${plugin.name}-${process.pid}-${Date.now()}`);
await rm9(tempPath, { recursive: true, force: true });
await cp3(plugin.sourcePath, tempPath, {
recursive: true,
@@ -77065,11 +77329,11 @@ function shouldCopyMarketplaceSourcePath(path7, root) {
}
// packages/omo-codex/src/install/lazycodex-version-stamp.ts
-import { readdir as readdir7, readFile as readFile16, writeFile as writeFile8 } from "node:fs/promises";
-import { join as join44 } from "node:path";
+import { readdir as readdir8, readFile as readFile16, writeFile as writeFile9 } from "node:fs/promises";
+import { join as join46 } from "node:path";
async function readDistributionManifest(repoRoot) {
try {
- const parsed = JSON.parse(await readFile16(join44(repoRoot, "package.json"), "utf8"));
+ const parsed = JSON.parse(await readFile16(join46(repoRoot, "package.json"), "utf8"));
if (!isPlainRecord3(parsed) || typeof parsed.version !== "string" || parsed.version.trim().length === 0)
return;
return {
@@ -77089,19 +77353,19 @@ function resolveLazyCodexPluginVersion(input) {
return input.manifestVersion ?? "local";
}
async function stampLazyCodexPluginVersion(input) {
- const manifestPath = join44(input.pluginRoot, ".codex-plugin", "plugin.json");
+ const manifestPath = join46(input.pluginRoot, ".codex-plugin", "plugin.json");
const hookPaths = await readPluginHookPaths(manifestPath);
await stampJsonVersion(manifestPath, input.version);
- await stampJsonVersion(join44(input.pluginRoot, "package.json"), input.version);
+ await stampJsonVersion(join46(input.pluginRoot, "package.json"), input.version);
for (const hookPath of hookPaths) {
- await stampHookStatusMessages(join44(input.pluginRoot, hookPath), input.version);
+ await stampHookStatusMessages(join46(input.pluginRoot, hookPath), input.version);
}
await stampComponentVersions(input);
}
async function writeLazyCodexInstallSnapshot(input) {
if (input.distributionManifest === undefined)
return;
- await writeFile8(join44(input.pluginRoot, "lazycodex-install.json"), `${JSON.stringify({
+ await writeFile9(join46(input.pluginRoot, "lazycodex-install.json"), `${JSON.stringify({
packageName: input.distributionManifest.name,
version: input.distributionManifest.version
}, null, "\t")}
@@ -77113,7 +77377,7 @@ async function stampJsonVersion(path7, version) {
if (!isPlainRecord3(parsed))
return;
parsed.version = version;
- await writeFile8(path7, `${JSON.stringify(parsed, null, "\t")}
+ await writeFile9(path7, `${JSON.stringify(parsed, null, "\t")}
`);
} catch (error) {
if (error instanceof Error)
@@ -77147,7 +77411,7 @@ async function stampHookStatusMessages(path7, version) {
if (!isPlainRecord3(parsed))
return;
stampHookGroups(parsed.hooks, version);
- await writeFile8(path7, `${JSON.stringify(parsed, null, "\t")}
+ await writeFile9(path7, `${JSON.stringify(parsed, null, "\t")}
`);
} catch (error) {
if (error instanceof Error)
@@ -77158,16 +77422,16 @@ async function stampHookStatusMessages(path7, version) {
async function stampComponentVersions(input) {
let entries;
try {
- entries = await readdir7(join44(input.pluginRoot, "components"));
+ entries = await readdir8(join46(input.pluginRoot, "components"));
} catch (error) {
if (error instanceof Error)
return;
throw error;
}
for (const entry of entries) {
- const componentRoot = join44(input.pluginRoot, "components", entry);
- await stampJsonVersion(join44(componentRoot, "package.json"), input.version);
- await stampHookStatusMessages(join44(componentRoot, "hooks", "hooks.json"), input.version);
+ const componentRoot = join46(input.pluginRoot, "components", entry);
+ await stampJsonVersion(join46(componentRoot, "package.json"), input.version);
+ await stampHookStatusMessages(join46(componentRoot, "hooks", "hooks.json"), input.version);
}
}
function stampHookGroups(hooks, version) {
@@ -77224,8 +77488,8 @@ var defaultRunCommand = async (command, args, options) => {
};
// packages/omo-codex/src/install/codex-project-local-cleanup.ts
-import { copyFile as copyFile2, lstat as lstat9, readFile as readFile17, writeFile as writeFile9 } from "node:fs/promises";
-import { dirname as dirname16, join as join45, resolve as resolve13 } from "node:path";
+import { copyFile as copyFile2, lstat as lstat10, readFile as readFile17, writeFile as writeFile10 } from "node:fs/promises";
+import { dirname as dirname17, join as join47, resolve as resolve13 } from "node:path";
var LEGACY_AGENT_CONFLICT_KEYS = ["max_threads"];
var PROJECT_LOCAL_ARTIFACT_PATHS = [
".codex/hooks.json",
@@ -77257,7 +77521,7 @@ async function repairNearestProjectLocalCodexArtifacts(input) {
}
const backupPath = `${configPath}.backup-${formatBackupTimestamp(input.now?.() ?? new Date)}`;
await copyFile2(configPath, backupPath);
- await writeFile9(configPath, `${repair.config.trimEnd()}
+ await writeFile10(configPath, `${repair.config.trimEnd()}
`);
configs.push({
projectRoot: project.projectRoot,
@@ -77328,37 +77592,37 @@ async function findProjectLocalCodexConfigs(startDirectory, codexHome) {
if (startDirectoryStat !== null && !startDirectoryStat.isDirectory()) {
throw new ProjectLocalCleanupStartDirectoryError(startDirectory);
}
- const codexHomeConfigPath = codexHome === undefined ? null : join45(resolve13(codexHome), "config.toml");
+ const codexHomeConfigPath = codexHome === undefined ? null : join47(resolve13(codexHome), "config.toml");
let current = resolve13(startDirectory);
const configPathsFromCwd = [];
while (true) {
- const configPath = join45(current, ".codex", "config.toml");
+ const configPath = join47(current, ".codex", "config.toml");
if (await isRegularProjectLocalConfig(current, configPath)) {
if (codexHomeConfigPath === null || resolve13(configPath) !== codexHomeConfigPath) {
configPathsFromCwd.push(configPath);
}
}
- if (await exists4(join45(current, ".git"))) {
+ if (await exists5(join47(current, ".git"))) {
return configPathsFromCwd.length === 0 ? null : {
projectRoot: current,
configPaths: [...configPathsFromCwd].reverse(),
artifactRoots: artifactRootsForConfigPaths(configPathsFromCwd)
};
}
- const parent = dirname16(current);
+ const parent = dirname17(current);
if (parent === current) {
const nearestConfigPath = configPathsFromCwd[0];
return nearestConfigPath === undefined ? null : {
- projectRoot: dirname16(dirname16(nearestConfigPath)),
+ projectRoot: dirname17(dirname17(nearestConfigPath)),
configPaths: [nearestConfigPath],
- artifactRoots: [dirname16(dirname16(nearestConfigPath))]
+ artifactRoots: [dirname17(dirname17(nearestConfigPath))]
};
}
current = parent;
}
}
async function isRegularProjectLocalConfig(directory, configPath) {
- const codexDirStat = await maybeLstat(join45(directory, ".codex"));
+ const codexDirStat = await maybeLstat(join47(directory, ".codex"));
if (codexDirStat === null || !codexDirStat.isDirectory() || codexDirStat.isSymbolicLink())
return false;
const configStat = await maybeLstat(configPath);
@@ -77367,7 +77631,7 @@ async function isRegularProjectLocalConfig(directory, configPath) {
function artifactRootsForConfigPaths(configPaths) {
const roots = [];
for (const configPath of configPaths) {
- const root = dirname16(dirname16(configPath));
+ const root = dirname17(dirname17(configPath));
if (!roots.includes(root))
roots.push(root);
}
@@ -77378,7 +77642,7 @@ async function collectProjectLocalArtifacts(projectRoots) {
const seenPaths = new Set;
for (const projectRoot of projectRoots) {
for (const relativePath of PROJECT_LOCAL_ARTIFACT_PATHS) {
- const artifactPath = join45(projectRoot, relativePath);
+ const artifactPath = join47(projectRoot, relativePath);
if (seenPaths.has(artifactPath))
continue;
const entryStat = await maybeLstat(artifactPath);
@@ -77412,17 +77676,17 @@ function formatBackupTimestamp(date) {
}
async function maybeLstat(path7) {
try {
- return await lstat9(path7);
+ return await lstat10(path7);
} catch (error) {
- if (nodeErrorCode3(error) === "ENOENT")
+ if (nodeErrorCode4(error) === "ENOENT")
return null;
throw error;
}
}
-async function exists4(path7) {
+async function exists5(path7) {
return await maybeLstat(path7) !== null;
}
-function nodeErrorCode3(error) {
+function nodeErrorCode4(error) {
if (!(error instanceof Error) || !("code" in error))
return null;
return typeof error.code === "string" ? error.code : null;
@@ -77453,24 +77717,24 @@ function formatUnknownError(error) {
}
// packages/omo-codex/src/install/lsp-daemon-reaper.ts
-import { readFile as readFile18, readdir as readdir8, rm as rm10 } from "node:fs/promises";
+import { readFile as readFile18, readdir as readdir9, rm as rm10 } from "node:fs/promises";
import { connect } from "node:net";
-import { join as join46 } from "node:path";
+import { join as join48 } from "node:path";
async function reapLspDaemons(codexHome, deps = {}) {
const killProcess = deps.killProcess ?? sendSigterm;
const isDaemonLive = deps.isDaemonLive ?? probeSocketLive;
- const daemonRoot = join46(codexHome, "codex-lsp", "daemon");
+ const daemonRoot = join48(codexHome, "codex-lsp", "daemon");
const reaped = [];
let entries;
try {
- entries = await readdir8(daemonRoot);
+ entries = await readdir9(daemonRoot);
} catch {
return reaped;
}
for (const entry of entries) {
- const versionDir = join46(daemonRoot, entry);
- const pid = await readPidFile(join46(versionDir, "daemon.pid"));
- const socketPath = await readEndpointFile(join46(versionDir, "daemon.endpoint"));
+ const versionDir = join48(daemonRoot, entry);
+ const pid = await readPidFile(join48(versionDir, "daemon.pid"));
+ const socketPath = await readEndpointFile(join48(versionDir, "daemon.endpoint"));
if (pid !== null && socketPath !== null && await isDaemonLive(socketPath) && killProcess(pid)) {
reaped.push(pid);
}
@@ -77524,7 +77788,7 @@ function sendSigterm(pid) {
// packages/omo-codex/src/install/codex-installer-bin-dir.ts
import { homedir as homedir5 } from "node:os";
-import { join as join47, resolve as resolve14 } from "node:path";
+import { join as join49, resolve as resolve14 } from "node:path";
function resolveCodexInstallerBinDir(input) {
const explicitBinDir = input.binDir ?? input.env?.CODEX_LOCAL_BIN_DIR;
if (explicitBinDir !== undefined && explicitBinDir.trim().length > 0)
@@ -77533,13 +77797,13 @@ function resolveCodexInstallerBinDir(input) {
const defaultCodexHome = resolve14(homeDir, ".codex");
const resolvedCodexHome = resolve14(input.codexHome);
if (resolvedCodexHome !== defaultCodexHome)
- return join47(resolvedCodexHome, "bin");
+ return join49(resolvedCodexHome, "bin");
return resolve14(homeDir, ".local", "bin");
}
// packages/omo-codex/src/install/codex-git-bash-hooks.ts
-import { readFile as readFile19, writeFile as writeFile10 } from "node:fs/promises";
-import { join as join48 } from "node:path";
+import { readFile as readFile19, writeFile as writeFile11 } from "node:fs/promises";
+import { join as join50 } from "node:path";
var WINDOWS_ONLY_GIT_BASH_HOOKS = new Set([
"./hooks/pre-tool-use-recommending-git-bash-mcp.json",
"./hooks/post-compact-resetting-git-bash-mcp-reminder.json"
@@ -77547,22 +77811,22 @@ var WINDOWS_ONLY_GIT_BASH_HOOKS = new Set([
async function removeGitBashHooksOffWindows(input) {
if (input.platform === "win32")
return;
- const manifestPath = join48(input.pluginRoot, ".codex-plugin", "plugin.json");
+ const manifestPath = join50(input.pluginRoot, ".codex-plugin", "plugin.json");
const parsed = JSON.parse(await readFile19(manifestPath, "utf8"));
if (!isPlainRecord3(parsed) || !Array.isArray(parsed.hooks))
return;
const hooks = parsed.hooks.filter((hook) => typeof hook !== "string" || !WINDOWS_ONLY_GIT_BASH_HOOKS.has(hook));
if (hooks.length === parsed.hooks.length)
return;
- await writeFile10(manifestPath, `${JSON.stringify({ ...parsed, hooks }, null, "\t")}
+ await writeFile11(manifestPath, `${JSON.stringify({ ...parsed, hooks }, null, "\t")}
`);
}
// packages/omo-codex/src/install/omo-sot-migration.ts
-import { join as join49 } from "node:path";
+import { join as join51 } from "node:path";
async function seedAndMigrateOmoSot(input) {
const commandEnv = { ...input.env };
- const scriptPath = join49(input.repoRoot, "packages", "omo-codex", "plugin", "scripts", "migrate-omo-sot.mjs");
+ const scriptPath = join51(input.repoRoot, "packages", "omo-codex", "plugin", "scripts", "migrate-omo-sot.mjs");
try {
await input.runCommand(process.execPath, [scriptPath, "--seed"], {
cwd: input.repoRoot,
@@ -77577,7 +77841,7 @@ async function seedAndMigrateOmoSot(input) {
// packages/omo-codex/src/install/install-ast-grep-sg.ts
init_src();
-import { join as join50 } from "node:path";
+import { join as join52 } from "node:path";
function describeResult(result) {
if (result.kind === "succeeded")
return null;
@@ -77591,7 +77855,7 @@ async function installAstGrepForCodex(options) {
return;
const platform = options.platform ?? process.platform;
const targetDir = astGrepRuntimeDir(options.codexHome, platform, options.arch ?? process.arch);
- const skillDir = join50(plugin.path, "skills", "ast-grep");
+ const skillDir = join52(plugin.path, "skills", "ast-grep");
const installer = options.installer ?? runAstGrepSkillInstall;
try {
const result = await installer({ platform, skillDir, targetDir });
@@ -77625,7 +77889,7 @@ async function runCodexInstaller(options = {}) {
const env3 = options.env ?? process.env;
const platform = options.platform ?? process.platform;
const repoRoot = resolve15(options.repoRoot ?? findRepoRoot({ importerDir: import.meta.dir, env: env3 }));
- const codexHome = resolve15(options.codexHome ?? env3.CODEX_HOME ?? join53(homedir6(), ".codex"));
+ const codexHome = resolve15(options.codexHome ?? env3.CODEX_HOME ?? join55(homedir6(), ".codex"));
const projectDirectory = resolve15(options.projectDirectory ?? env3.OMO_CODEX_PROJECT ?? process.cwd());
const binDir = resolveCodexInstallerBinDir({ binDir: options.binDir, codexHome, env: env3 });
const runCommand = options.runCommand ?? defaultRunCommand;
@@ -77641,9 +77905,9 @@ async function runCodexInstaller(options = {}) {
if (!gitBashResolution.found) {
throw new Error(gitBashResolution.installHint);
}
- const codexPackageRoot = join53(repoRoot, "packages", "omo-codex");
+ const codexPackageRoot = join55(repoRoot, "packages", "omo-codex");
const marketplace = await readMarketplace(repoRoot, {
- marketplacePath: join53(codexPackageRoot, "marketplace.json")
+ marketplacePath: join55(codexPackageRoot, "marketplace.json")
});
const distributionManifest = await readDistributionManifest(repoRoot);
const installed = [];
@@ -77686,7 +77950,7 @@ async function runCodexInstaller(options = {}) {
if (runtimeLink !== null)
log4(`Linked ${runtimeLink.name} -> ${runtimeLink.target}`);
else
- log4(`Warning: skipped the omo runtime wrapper because ${join53(repoRoot, "dist", "cli", "index.js")} is missing; omo ulw-loop commands will be unavailable until a package shipping dist/cli is installed`);
+ log4(`Warning: skipped the omo runtime wrapper because ${join55(repoRoot, "dist", "cli", "index.js")} is missing; omo ulw-loop commands will be unavailable until a package shipping dist/cli is installed`);
}
pluginSources.push({ name: entry.name, sourcePath });
installed.push(plugin);
@@ -77717,7 +77981,7 @@ async function runCodexInstaller(options = {}) {
});
for (const link of agentLinks) {
log4(`Linked agent ${link.name} -> ${link.target}`);
- const agentName = agentNameFromToml2(link.name);
+ const agentName = agentNameFromToml3(link.name);
agentConfigs.set(agentName, { name: agentName, configFile: `./agents/${link.name}` });
}
}
@@ -77740,13 +78004,13 @@ async function runCodexInstaller(options = {}) {
});
}
await reapLspDaemons(codexHome).catch(() => []);
- const marketplaceRoot = join53(codexHome, "plugins", "cache", marketplace.name);
+ const marketplaceRoot = join55(codexHome, "plugins", "cache", marketplace.name);
await writeCachedMarketplaceManifest({
marketplaceName: marketplace.name,
marketplaceRoot,
plugins: installed
});
- const configPath = join53(codexHome, "config.toml");
+ const configPath = join55(codexHome, "config.toml");
await updateCodexConfig({
configPath,
repoRoot: codexPackageRoot,
@@ -77784,7 +78048,7 @@ async function runCodexInstaller(options = {}) {
projectCleanup
};
}
-function agentNameFromToml2(fileName) {
+function agentNameFromToml3(fileName) {
return fileName.endsWith(".toml") ? fileName.slice(0, -".toml".length) : fileName;
}
async function agentSourceRootsForInstall(input) {
@@ -77806,7 +78070,7 @@ function findRepoRootFromImporter(importerDir) {
for (let depth = 0;depth <= 7; depth += 1) {
if (isRepoRootWithCodexPlugin(current))
return current;
- for (const wrapperPackageRoot of [join53(current, "node_modules", "oh-my-openagent"), join53(current, "oh-my-openagent")]) {
+ for (const wrapperPackageRoot of [join55(current, "node_modules", "oh-my-openagent"), join55(current, "oh-my-openagent")]) {
if (isRepoRootWithCodexPlugin(wrapperPackageRoot))
return wrapperPackageRoot;
}
@@ -77824,7 +78088,7 @@ function findRepoRoot(input) {
return findRepoRootFromImporter(input.importerDir);
}
function isRepoRootWithCodexPlugin(repoRoot) {
- return existsSync30(join53(repoRoot, "packages", "omo-codex", "plugin", ".codex-plugin", "plugin.json"));
+ return existsSync30(join55(repoRoot, "packages", "omo-codex", "plugin", ".codex-plugin", "plugin.json"));
}
function codexMarketplaceSource(marketplaceRoot) {
return { sourceType: "local", source: marketplaceRoot };
@@ -77845,19 +78109,19 @@ async function detectCodexInstallation(input = {}) {
const platform = input.platform ?? process.platform;
const env3 = input.env ?? process.env;
const homeDir = input.homeDir ?? homedir7();
- const exists5 = input.exists ?? existsSync31;
+ const exists6 = input.exists ?? existsSync31;
const which2 = input.which ?? bunWhich;
const checkedPaths = [CODEX_PATH_CHECK_LABEL];
const cliPath = nonEmptyValue2(which2("codex"));
if (cliPath !== undefined)
return { found: true, source: "cli", path: cliPath };
if (platform === "darwin") {
- return detectMacCodexInstallation({ homeDir, exists: exists5, checkedPaths });
+ return detectMacCodexInstallation({ homeDir, exists: exists6, checkedPaths });
}
if (platform === "win32") {
return detectWindowsCodexInstallation({
env: env3,
- exists: exists5,
+ exists: exists6,
checkedPaths,
runCommand: input.runCommand ?? defaultRunCommand2
});
@@ -77959,13 +78223,13 @@ function defaultRunCommand2(command, args) {
});
}
// packages/omo-codex/src/install/codex-cleanup.ts
-import { lstat as lstat11, readFile as readFile21, readdir as readdir9, rm as rm11, rmdir } from "node:fs/promises";
+import { lstat as lstat12, readFile as readFile21, readdir as readdir10, rm as rm11, rmdir } from "node:fs/promises";
import { homedir as homedir8 } from "node:os";
-import { isAbsolute as isAbsolute10, join as join55, relative as relative7, resolve as resolve17 } from "node:path";
+import { isAbsolute as isAbsolute11, join as join57, relative as relative7, resolve as resolve17 } from "node:path";
// packages/omo-codex/src/install/codex-cleanup-config.ts
-import { lstat as lstat10, mkdir as mkdir8, readFile as readFile20, writeFile as writeFile11 } from "node:fs/promises";
-import { dirname as dirname18 } from "node:path";
+import { lstat as lstat11, mkdir as mkdir8, readFile as readFile20, writeFile as writeFile12 } from "node:fs/promises";
+import { dirname as dirname19 } from "node:path";
var MANAGED_MARKETPLACES = ["sisyphuslabs", "lazycodex", "code-yeongyu-codex-plugins"];
var LEGACY_MANAGED_CODEX_AGENT_NAMES_TO_PURGE2 = ["codex-ultrawork-reviewer"];
var CURRENT_MANAGED_CODEX_AGENT_NAMES2 = [
@@ -77999,9 +78263,9 @@ async function cleanupCodexConfig(configPath, now) {
if (next === original)
return { changed: false };
const backupPath = `${configPath}.backup-${formatBackupTimestamp2(now?.() ?? new Date)}`;
- await mkdir8(dirname18(configPath), { recursive: true });
- await writeFile11(backupPath, original);
- await writeFile11(configPath, `${next.trimEnd()}
+ await mkdir8(dirname19(configPath), { recursive: true });
+ await writeFile12(backupPath, original);
+ await writeFile12(configPath, `${next.trimEnd()}
`);
return { changed: true, backupPath };
}
@@ -78063,27 +78327,27 @@ function formatBackupTimestamp2(date) {
}
async function configExists(path7) {
try {
- await lstat10(path7);
+ await lstat11(path7);
return true;
} catch (error) {
- if (nodeErrorCode4(error) === "ENOENT")
+ if (nodeErrorCode5(error) === "ENOENT")
return false;
throw error;
}
}
-function nodeErrorCode4(error) {
+function nodeErrorCode5(error) {
if (!(error instanceof Error) || !("code" in error))
return null;
return typeof error.code === "string" ? error.code : null;
}
// packages/omo-codex/src/install/codex-cleanup-safety.ts
-import { dirname as dirname19, isAbsolute as isAbsolute9, join as join54, relative as relative6, resolve as resolve16 } from "node:path";
+import { dirname as dirname20, isAbsolute as isAbsolute10, join as join56, relative as relative6, resolve as resolve16 } from "node:path";
function validateManagedCleanupTarget(input) {
- if (!isAbsolute9(input.path))
+ if (!isAbsolute10(input.path))
return skipped(input.path, "outside managed Codex cleanup scope");
const codexHome = resolve16(input.codexHome);
- if (dirname19(codexHome) === codexHome)
+ if (dirname20(codexHome) === codexHome)
return skipped(input.path, "Codex home resolves to a filesystem root");
const target = resolve16(input.path);
if (!isWithinDirectory(codexHome, target))
@@ -78091,11 +78355,11 @@ function validateManagedCleanupTarget(input) {
if (target === codexHome)
return skipped(input.path, "outside managed Codex cleanup scope");
const exactManagedRoots = new Set([
- resolve16(join54(codexHome, "plugins", "cache", "sisyphuslabs")),
- resolve16(join54(codexHome, ".tmp", "marketplaces", "sisyphuslabs")),
- resolve16(join54(codexHome, "runtime", "ast-grep")),
- resolve16(join54(codexHome, "runtime", "node")),
- resolve16(join54(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap"))
+ resolve16(join56(codexHome, "plugins", "cache", "sisyphuslabs")),
+ resolve16(join56(codexHome, ".tmp", "marketplaces", "sisyphuslabs")),
+ resolve16(join56(codexHome, "runtime", "ast-grep")),
+ resolve16(join56(codexHome, "runtime", "node")),
+ resolve16(join56(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap"))
]);
if (exactManagedRoots.has(target))
return null;
@@ -78105,7 +78369,7 @@ function validateManagedCleanupTarget(input) {
}
function isWithinDirectory(parent, child) {
const relativePath = relative6(parent, child);
- return relativePath === "" || !relativePath.startsWith("..") && !isAbsolute9(relativePath);
+ return relativePath === "" || !relativePath.startsWith("..") && !isAbsolute10(relativePath);
}
function isManagedBootstrapDriftPath(codexHome, target) {
const relativePath = relative6(codexHome, target);
@@ -78125,8 +78389,8 @@ function skipped(path7, reason) {
var INSTALLED_AGENTS_MANIFEST = ".installed-agents.json";
async function cleanupCodexLight(input = {}) {
const env3 = input.env ?? process.env;
- const codexHome = resolve17(input.codexHome ?? env3.CODEX_HOME ?? join55(homedir8(), ".codex"));
- const configPath = join55(codexHome, "config.toml");
+ const codexHome = resolve17(input.codexHome ?? env3.CODEX_HOME ?? join57(homedir8(), ".codex"));
+ const configPath = join57(codexHome, "config.toml");
const agentPaths = await collectInstalledAgentPaths(codexHome, configPath);
const configCleanup = await cleanupCodexConfig(configPath, input.now);
const agentCleanup = await removeManifestListedAgentLinks(codexHome, agentPaths);
@@ -78165,32 +78429,32 @@ async function cleanupCodexLight(input = {}) {
}
function managedGlobalStatePaths(codexHome) {
return [
- join55(codexHome, "plugins", "cache", "sisyphuslabs"),
- join55(codexHome, ".tmp", "marketplaces", "sisyphuslabs"),
- join55(codexHome, "runtime", "ast-grep"),
- join55(codexHome, "runtime", "node"),
- join55(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap")
+ join57(codexHome, "plugins", "cache", "sisyphuslabs"),
+ join57(codexHome, ".tmp", "marketplaces", "sisyphuslabs"),
+ join57(codexHome, "runtime", "ast-grep"),
+ join57(codexHome, "runtime", "node"),
+ join57(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap")
];
}
var BOOTSTRAP_DATA_GLOB_MAX_DEPTH = 5;
async function collectBootstrapDataDirsByGlob(codexHome) {
const results = [];
- await walkForManagedBootstrapDirs(join55(codexHome, "plugins"), 0, results);
+ await walkForManagedBootstrapDirs(join57(codexHome, "plugins"), 0, results);
return results;
}
async function walkForManagedBootstrapDirs(directory, depth, results) {
if (depth > BOOTSTRAP_DATA_GLOB_MAX_DEPTH)
return;
- const entries = await readdir9(directory, { withFileTypes: true }).catch(() => null);
+ const entries = await readdir10(directory, { withFileTypes: true }).catch(() => null);
if (entries === null)
return;
for (const entry of entries) {
if (!entry.isDirectory())
continue;
- const childPath = join55(directory, entry.name);
+ const childPath = join57(directory, entry.name);
if (isManagedBootstrapOwnerName(entry.name)) {
- const bootstrapDir = join55(childPath, "bootstrap");
- if (await exists5(bootstrapDir))
+ const bootstrapDir = join57(childPath, "bootstrap");
+ if (await exists6(bootstrapDir))
results.push(bootstrapDir);
continue;
}
@@ -78213,7 +78477,7 @@ async function removeManagedPathBestEffort(path7, seams) {
}
async function attemptRemove(path7) {
try {
- if (await lstat11(path7).catch(() => null) === null)
+ if (await lstat12(path7).catch(() => null) === null)
return false;
await rm11(path7, { recursive: true, force: true });
return true;
@@ -78223,7 +78487,7 @@ async function attemptRemove(path7) {
}
async function pruneEmptyRuntimeDirBestEffort(codexHome) {
try {
- await rmdir(join55(codexHome, "runtime"));
+ await rmdir(join57(codexHome, "runtime"));
} catch (error) {
if (isExpectedRuntimePruneFailure(error))
return;
@@ -78231,18 +78495,18 @@ async function pruneEmptyRuntimeDirBestEffort(codexHome) {
}
}
function isExpectedRuntimePruneFailure(error) {
- return ["ENOENT", "ENOTEMPTY", "EEXIST", "EPERM", "EBUSY", "ENOTDIR"].includes(nodeErrorCode5(error) ?? "");
+ return ["ENOENT", "ENOTEMPTY", "EEXIST", "EPERM", "EBUSY", "ENOTDIR"].includes(nodeErrorCode6(error) ?? "");
}
async function collectInstalledAgentPaths(codexHome, configPath) {
const manifestPaths = [
- join55(codexHome, ".tmp", "marketplaces", "sisyphuslabs", "plugins", "omo", INSTALLED_AGENTS_MANIFEST)
+ join57(codexHome, ".tmp", "marketplaces", "sisyphuslabs", "plugins", "omo", INSTALLED_AGENTS_MANIFEST)
];
- const versionRoot = join55(codexHome, "plugins", "cache", "sisyphuslabs", "omo");
- if (await exists5(versionRoot)) {
- const entries = await readdir9(versionRoot, { withFileTypes: true });
+ const versionRoot = join57(codexHome, "plugins", "cache", "sisyphuslabs", "omo");
+ if (await exists6(versionRoot)) {
+ const entries = await readdir10(versionRoot, { withFileTypes: true });
for (const entry of entries) {
if (entry.isDirectory())
- manifestPaths.push(join55(versionRoot, entry.name, INSTALLED_AGENTS_MANIFEST));
+ manifestPaths.push(join57(versionRoot, entry.name, INSTALLED_AGENTS_MANIFEST));
}
}
const paths = new Set;
@@ -78257,13 +78521,13 @@ async function collectInstalledAgentPaths(codexHome, configPath) {
return [...paths].sort();
}
async function readManagedAgentPathsFromConfig(codexHome, configPath) {
- if (!await exists5(configPath))
+ if (!await exists6(configPath))
return [];
const config = await readFile21(configPath, "utf8");
- return MANAGED_CODEX_AGENT_NAMES2.filter((agentName) => config.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`)).map((agentName) => join55(codexHome, "agents", `${agentName}.toml`));
+ return MANAGED_CODEX_AGENT_NAMES2.filter((agentName) => config.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`)).map((agentName) => join57(codexHome, "agents", `${agentName}.toml`));
}
async function readInstalledAgentManifest(manifestPath) {
- if (!await exists5(manifestPath))
+ if (!await exists6(manifestPath))
return [];
const parsed = JSON.parse(await readFile21(manifestPath, "utf8"));
if (!isPlainRecord3(parsed) || !Array.isArray(parsed.agents))
@@ -78271,7 +78535,7 @@ async function readInstalledAgentManifest(manifestPath) {
return parsed.agents.filter((path7) => typeof path7 === "string");
}
async function removeManifestListedAgentLinks(codexHome, paths) {
- const agentsDir = join55(codexHome, "agents");
+ const agentsDir = join57(codexHome, "agents");
const removed = [];
const skipped2 = [];
for (const path7 of paths) {
@@ -78292,29 +78556,29 @@ async function removeManifestListedAgentLinks(codexHome, paths) {
return { removed, skipped: skipped2 };
}
function isSafeManagedAgentPath(agentsDir, path7) {
- if (!isAbsolute10(path7))
+ if (!isAbsolute11(path7))
return false;
const relativePath = relative7(agentsDir, path7);
- if (relativePath === "" || relativePath.startsWith("..") || isAbsolute10(relativePath))
+ if (relativePath === "" || relativePath.startsWith("..") || isAbsolute11(relativePath))
return false;
const fileName = relativePath.split(/[\\/]/).pop();
if (fileName === undefined)
return false;
return MANAGED_CODEX_AGENT_NAMES2.some((agentName) => fileName === `${agentName}.toml`);
}
-async function exists5(path7) {
+async function exists6(path7) {
return await maybeLstat2(path7) !== null;
}
async function maybeLstat2(path7) {
try {
- return await lstat11(path7);
+ return await lstat12(path7);
} catch (error) {
- if (nodeErrorCode5(error) === "ENOENT")
+ if (nodeErrorCode6(error) === "ENOENT")
return null;
throw error;
}
}
-function nodeErrorCode5(error) {
+function nodeErrorCode6(error) {
if (!(error instanceof Error) || !("code" in error))
return null;
return typeof error.code === "string" ? error.code : null;
@@ -78324,16 +78588,16 @@ var CODEGRAPH_RELATIVE_ARGS2 = new Set(["components/codegraph/dist/serve.js", ".
// packages/omo-senpi/src/install/install-senpi.ts
import { execFile as execFile3 } from "node:child_process";
import { constants as constants7, existsSync as existsSync32 } from "node:fs";
-import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile22, rename as rename5, writeFile as writeFile12 } from "node:fs/promises";
+import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile22, rename as rename5, writeFile as writeFile13 } from "node:fs/promises";
import { homedir as homedir9 } from "node:os";
-import { dirname as dirname20, join as join56, resolve as resolve18 } from "node:path";
+import { dirname as dirname21, join as join58, resolve as resolve18 } from "node:path";
import { fileURLToPath } from "node:url";
import { promisify as promisify2 } from "node:util";
var execFileAsync2 = promisify2(execFile3);
var REQUIRED_PLUGIN_ARTIFACTS = [
- join56("extensions", "omo.js"),
- join56("skills", "ultrawork", "SKILL.md"),
- join56("skills", "ulw-loop", "SKILL.md")
+ join58("extensions", "omo.js"),
+ join58("skills", "ultrawork", "SKILL.md"),
+ join58("skills", "ulw-loop", "SKILL.md")
];
async function runSenpiInstaller(options = {}) {
const context = resolveInstallContext(options);
@@ -78357,14 +78621,14 @@ async function runSenpiInstaller(options = {}) {
}
function resolveInstallContext(options) {
const env3 = options.env ?? process.env;
- const repoRoot = resolve18(options.repoRoot ?? findRepoRoot2(dirname20(fileURLToPath(import.meta.url))));
- const agentDir = resolve18(options.agentDir ?? env3.SENPI_CODING_AGENT_DIR ?? join56(homedir9(), ".senpi", "agent"));
- const pluginPath = resolve18(options.pluginPath ?? join56(repoRoot, "packages", "omo-senpi", "plugin"));
+ const repoRoot = resolve18(options.repoRoot ?? findRepoRoot2(dirname21(fileURLToPath(import.meta.url))));
+ const agentDir = resolve18(options.agentDir ?? env3.SENPI_CODING_AGENT_DIR ?? join58(homedir9(), ".senpi", "agent"));
+ const pluginPath = resolve18(options.pluginPath ?? join58(repoRoot, "packages", "omo-senpi", "plugin"));
return {
env: env3,
repoRoot,
agentDir,
- settingsPath: join56(agentDir, "settings.json"),
+ settingsPath: join58(agentDir, "settings.json"),
pluginPath,
runCommand: options.runCommand ?? defaultRunCommand3
};
@@ -78373,12 +78637,12 @@ async function ensurePluginArtifacts(context) {
const missing = await hasMissingPluginArtifact(context.pluginPath);
if (!missing)
return;
- await context.runCommand("node", [join56(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
- await context.runCommand("node", [join56(context.pluginPath, "scripts", "sync-skills.mjs")], { cwd: context.repoRoot });
+ await context.runCommand("node", [join58(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
+ await context.runCommand("node", [join58(context.pluginPath, "scripts", "sync-skills.mjs")], { cwd: context.repoRoot });
}
async function hasMissingPluginArtifact(pluginPath) {
for (const artifact of REQUIRED_PLUGIN_ARTIFACTS) {
- if (!await fileExists(join56(pluginPath, artifact)))
+ if (!await fileExists(join58(pluginPath, artifact)))
return true;
}
return false;
@@ -78417,16 +78681,16 @@ function dedupePackages(packages) {
return [...new Set(packages)];
}
async function writeSettingsAtomically(settingsPath, settings) {
- await mkdir9(dirname20(settingsPath), { recursive: true });
+ await mkdir9(dirname21(settingsPath), { recursive: true });
const backupPath = await nextBackupPath(settingsPath);
if (await fileExists(settingsPath)) {
await copyFile3(settingsPath, backupPath);
} else {
- await writeFile12(backupPath, `{}
+ await writeFile13(backupPath, `{}
`, "utf8");
}
const tempPath = `${settingsPath}.${process.pid}.${Date.now()}.tmp`;
- await writeFile12(tempPath, `${JSON.stringify(settings, null, 2)}
+ await writeFile13(tempPath, `${JSON.stringify(settings, null, 2)}
`, "utf8");
await rename5(tempPath, settingsPath);
return backupPath;
@@ -78446,7 +78710,7 @@ function timestampForBackup() {
function findRepoRoot2(importerDir) {
let current = importerDir;
for (let depth = 0;depth <= 7; depth += 1) {
- if (fileExistsSync(join56(current, "packages", "omo-senpi", "plugin", "package.json")))
+ if (fileExistsSync(join58(current, "packages", "omo-senpi", "plugin", "package.json")))
return current;
current = resolve18(current, "..");
}
@@ -78505,26 +78769,26 @@ async function starGitHubRepositories(platform = "both", runCommand = runGitHubS
init_provider_availability();
// packages/omo-opencode/src/cli/config-manager/add-tui-plugin-to-tui-config.ts
-import { existsSync as existsSync34, mkdirSync as mkdirSync10, readFileSync as readFileSync16 } from "node:fs";
-import { join as join58 } from "node:path";
+import { existsSync as existsSync34, mkdirSync as mkdirSync10, readFileSync as readFileSync17 } from "node:fs";
+import { join as join60 } from "node:path";
// packages/omo-opencode/src/cli/doctor/checks/tui-plugin-config.ts
init_shared();
-import { existsSync as existsSync33, readFileSync as readFileSync15 } from "node:fs";
-import { join as join57 } from "node:path";
+import { existsSync as existsSync33, readFileSync as readFileSync16 } from "node:fs";
+import { join as join59 } from "node:path";
var TUI_SUBPATH = "tui";
var TUI_EXPORT_SUBPATH = `./${TUI_SUBPATH}`;
function fileEntryPackageJsonPath(entry) {
let path7 = entry.slice("file:".length);
if (path7.startsWith("//"))
path7 = path7.slice(2);
- return join57(path7, "package.json");
+ return join59(path7, "package.json");
}
function packageJsonExportsTui(pkgJsonPath) {
if (!existsSync33(pkgJsonPath))
return null;
try {
- const parsed = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
+ const parsed = JSON.parse(readFileSync16(pkgJsonPath, "utf-8"));
if (parsed.exports === undefined)
return null;
if (typeof parsed.exports === "string")
@@ -78556,7 +78820,7 @@ function packageExportsTuiForServerEntry(entry) {
const packageName = packageNameFromServerEntry(entry);
if (packageName === null)
return null;
- return packageJsonExportsTui(join57(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
+ return packageJsonExportsTui(join59(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
}
function isOurFilePluginEntry(entry) {
if (typeof entry !== "string" || !entry.startsWith("file:"))
@@ -78565,7 +78829,7 @@ function isOurFilePluginEntry(entry) {
const pkgJsonPath = fileEntryPackageJsonPath(entry);
if (!existsSync33(pkgJsonPath))
return false;
- const parsed = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
+ const parsed = JSON.parse(readFileSync16(pkgJsonPath, "utf-8"));
return typeof parsed.name === "string" && ACCEPTED_PACKAGE_NAMES.includes(parsed.name);
} catch (error) {
log2("[tui-plugin-config] Failed to inspect file plugin package", {
@@ -78603,7 +78867,7 @@ function detectServerPluginRegistration() {
return { registered: false, configPath: null, entry: null, packageExportsTui: null };
}
try {
- const parsed = parseJsonc(readFileSync15(configPath, "utf-8"));
+ const parsed = parseJsonc(readFileSync16(configPath, "utf-8"));
const plugins = parsed.plugin ?? [];
const serverEntry = plugins.find(isServerPluginEntry);
return {
@@ -78621,7 +78885,7 @@ function detectServerPluginRegistration() {
}
}
function detectTuiPluginRegistration() {
- const tuiJsonPath = join57(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
+ const tuiJsonPath = join59(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
if (!existsSync33(tuiJsonPath)) {
return {
registered: false,
@@ -78633,7 +78897,7 @@ function detectTuiPluginRegistration() {
};
}
try {
- const parsed = parseJsonc(readFileSync15(tuiJsonPath, "utf-8"));
+ const parsed = parseJsonc(readFileSync16(tuiJsonPath, "utf-8"));
const plugins = parsed.plugin ?? [];
return {
registered: plugins.some(isTuiPluginEntry),
@@ -78766,7 +79030,7 @@ init_shared();
init_write_file_atomically2();
function readConfig(path7) {
try {
- const parsed = parseJsonc(readFileSync16(path7, "utf-8"));
+ const parsed = parseJsonc(readFileSync17(path7, "utf-8"));
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
return parsed;
}
@@ -78777,10 +79041,10 @@ function readConfig(path7) {
return null;
}
function readServerConfig(configDir) {
- const jsoncPath = join58(configDir, "opencode.jsonc");
+ const jsoncPath = join60(configDir, "opencode.jsonc");
if (existsSync34(jsoncPath))
return readConfig(jsoncPath);
- const jsonPath = join58(configDir, "opencode.json");
+ const jsonPath = join60(configDir, "opencode.json");
if (existsSync34(jsonPath))
return readConfig(jsonPath);
return null;
@@ -78822,7 +79086,7 @@ function ensureTuiPluginEntry(opts = {}) {
if (!desiredEntry) {
return { changed: false, reason: "no-server-entry" };
}
- const tuiJsonPath = join58(configDir, "tui.json");
+ const tuiJsonPath = join60(configDir, "tui.json");
const { config, malformed } = readTuiConfig(tuiJsonPath);
if (malformed) {
return { changed: false, reason: "malformed" };
@@ -78838,7 +79102,7 @@ function ensureTuiPluginEntry(opts = {}) {
// packages/omo-opencode/src/cli/install-ast-grep-sg.ts
import { homedir as homedir10 } from "node:os";
-import { join as join59 } from "node:path";
+import { join as join61 } from "node:path";
// packages/shared-skills/index.mjs
import { fileURLToPath as fileURLToPath2 } from "node:url";
@@ -78857,9 +79121,9 @@ function describeResult2(result) {
}
async function installAstGrepForOpenCode(options = {}) {
const platform = options.platform ?? process.platform;
- const baseDir = join59(options.homeDir ?? homedir10(), ".omo");
+ const baseDir = join61(options.homeDir ?? homedir10(), ".omo");
const targetDir = astGrepRuntimeDir(baseDir, platform, options.arch ?? process.arch);
- const skillDir = join59(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
+ const skillDir = join61(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
const installer = options.installer ?? runAstGrepSkillInstall;
try {
const result = await installer({ platform, skillDir, targetDir });
@@ -96854,7 +97118,7 @@ var import_picocolors11 = __toESM(require_picocolors(), 1);
// packages/omo-opencode/src/cli/run/opencode-binary-resolver.ts
init_bun_which_shim();
init_spawn_with_windows_hide();
-import { delimiter as delimiter2, dirname as dirname22, posix as posix4, win32 as win324 } from "node:path";
+import { delimiter as delimiter2, dirname as dirname23, posix as posix4, win32 as win324 } from "node:path";
var OPENCODE_COMMANDS = ["opencode", "opencode-desktop"];
var WINDOWS_SUFFIXES = ["", ".exe", ".cmd", ".bat", ".ps1"];
function getCommandCandidates(platform) {
@@ -96912,7 +97176,7 @@ async function findWorkingOpencodeBinary(pathEnv = process.env.PATH, probe2 = ca
return null;
}
function buildPathWithBinaryFirst(pathEnv, binaryPath) {
- const preferredDir = dirname22(binaryPath);
+ const preferredDir = dirname23(binaryPath);
const existing = (pathEnv ?? "").split(delimiter2).filter((entry) => entry.length > 0 && entry !== preferredDir);
return [preferredDir, ...existing].join(delimiter2);
}
@@ -97305,7 +97569,7 @@ var BOULDER_STATE_PATH = `${BOULDER_DIR}/${BOULDER_FILE}`;
var NOTEPAD_DIR = "notepads";
var NOTEPAD_BASE_PATH = `${BOULDER_DIR}/${NOTEPAD_DIR}`;
// packages/boulder-state/src/top-level-task.ts
-import { existsSync as existsSync37, readFileSync as readFileSync18 } from "node:fs";
+import { existsSync as existsSync37, readFileSync as readFileSync19 } from "node:fs";
var TODO_HEADING_PATTERN = /^##\s+TODOs\b/i;
var FINAL_VERIFICATION_HEADING_PATTERN = /^##\s+Final Verification Wave\b/i;
var SECOND_LEVEL_HEADING_PATTERN = /^##\s+/;
@@ -97332,7 +97596,7 @@ function readCurrentTopLevelTask(planPath) {
return null;
}
try {
- const content = readFileSync18(planPath, "utf-8");
+ const content = readFileSync19(planPath, "utf-8");
const lines = content.split(/\r?\n/);
let section = "other";
for (const line of lines) {
@@ -97358,12 +97622,12 @@ function readCurrentTopLevelTask(planPath) {
}
// packages/boulder-state/src/storage/path.ts
import { existsSync as existsSync38 } from "node:fs";
-import { isAbsolute as isAbsolute11, join as join61, relative as relative8, resolve as resolve19 } from "node:path";
+import { isAbsolute as isAbsolute12, join as join63, relative as relative8, resolve as resolve19 } from "node:path";
function getBoulderFilePath(directory) {
- return join61(directory, BOULDER_DIR, BOULDER_FILE);
+ return join63(directory, BOULDER_DIR, BOULDER_FILE);
}
function resolveTrackedPath(baseDirectory, trackedPath) {
- return isAbsolute11(trackedPath) ? resolve19(trackedPath) : resolve19(baseDirectory, trackedPath);
+ return isAbsolute12(trackedPath) ? resolve19(trackedPath) : resolve19(baseDirectory, trackedPath);
}
function resolveBoulderPlanPath(directory, state) {
const absolutePlanPath = resolveTrackedPath(directory, state.active_plan);
@@ -97373,7 +97637,7 @@ function resolveBoulderPlanPath(directory, state) {
}
const absoluteDirectory = resolve19(directory);
const relativePlanPath = relative8(absoluteDirectory, absolutePlanPath);
- if (relativePlanPath.length === 0 || relativePlanPath.startsWith("..") || isAbsolute11(relativePlanPath)) {
+ if (relativePlanPath.length === 0 || relativePlanPath.startsWith("..") || isAbsolute12(relativePlanPath)) {
return absolutePlanPath;
}
const absoluteWorktreePath = resolveTrackedPath(directory, worktreePath);
@@ -97384,7 +97648,7 @@ function resolveBoulderPlanPathForWork(directory, work) {
return resolveBoulderPlanPath(directory, work);
}
// packages/boulder-state/src/storage/plan-progress.ts
-import { existsSync as existsSync39, readFileSync as readFileSync19, readdirSync as readdirSync5, statSync as statSync5 } from "node:fs";
+import { existsSync as existsSync39, readFileSync as readFileSync20, readdirSync as readdirSync5, statSync as statSync5 } from "node:fs";
var TODO_HEADING_PATTERN2 = /^##\s+TODOs\b/i;
var FINAL_VERIFICATION_HEADING_PATTERN2 = /^##\s+Final Verification Wave\b/i;
var SECOND_LEVEL_HEADING_PATTERN2 = /^##\s+/;
@@ -97397,7 +97661,7 @@ function getPlanProgress(planPath) {
return { total: 0, completed: 0, isComplete: false };
}
try {
- const content = readFileSync19(planPath, "utf-8");
+ const content = readFileSync20(planPath, "utf-8");
const lines = content.split(/\r?\n/);
const hasStructuredSections = lines.some((line) => TODO_HEADING_PATTERN2.test(line) || FINAL_VERIFICATION_HEADING_PATTERN2.test(line));
if (hasStructuredSections) {
@@ -97513,14 +97777,14 @@ function selectMirrorWork(state) {
return sorted[0] ?? null;
}
// packages/boulder-state/src/storage/read-state.ts
-import { existsSync as existsSync40, readFileSync as readFileSync20 } from "node:fs";
+import { existsSync as existsSync40, readFileSync as readFileSync21 } from "node:fs";
function readBoulderState(directory) {
const filePath = getBoulderFilePath(directory);
if (!existsSync40(filePath)) {
return null;
}
try {
- const content = readFileSync20(filePath, "utf-8");
+ const content = readFileSync21(filePath, "utf-8");
const parsed = JSON.parse(content);
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
return null;
@@ -97586,17 +97850,17 @@ init_state();
// packages/omo-opencode/src/features/run-continuation-state/constants.ts
var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
// packages/omo-opencode/src/features/run-continuation-state/storage.ts
-import { existsSync as existsSync41, mkdirSync as mkdirSync11, readFileSync as readFileSync21, rmSync as rmSync2, writeFileSync as writeFileSync6 } from "node:fs";
-import { join as join62 } from "node:path";
+import { existsSync as existsSync41, mkdirSync as mkdirSync11, readFileSync as readFileSync22, rmSync as rmSync2, writeFileSync as writeFileSync6 } from "node:fs";
+import { join as join64 } from "node:path";
function getMarkerPath(directory, sessionID) {
- return join62(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
+ return join64(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
}
function readContinuationMarker(directory, sessionID) {
const markerPath = getMarkerPath(directory, sessionID);
if (!existsSync41(markerPath))
return null;
try {
- const raw = readFileSync21(markerPath, "utf-8");
+ const raw = readFileSync22(markerPath, "utf-8");
const parsed = JSON.parse(raw);
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
return null;
@@ -97661,8 +97925,8 @@ async function isSessionInBoulderLineage(input) {
// packages/omo-opencode/src/hooks/atlas/session-last-agent.ts
init_shared();
init_compaction_marker();
-import { readFileSync as readFileSync22, readdirSync as readdirSync6 } from "node:fs";
-import { join as join63 } from "node:path";
+import { readFileSync as readFileSync23, readdirSync as readdirSync6 } from "node:fs";
+import { join as join65 } from "node:path";
var defaultSessionLastAgentDeps = {
getMessageDir,
isSqliteBackend,
@@ -97722,7 +97986,7 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
try {
const messages = readdirSync6(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
try {
- const content = readFileSync22(join63(messageDir, fileName), "utf-8");
+ const content = readFileSync23(join65(messageDir, fileName), "utf-8");
const parsed = JSON.parse(content);
return {
fileName,
@@ -97765,8 +98029,8 @@ init_agent_display_names();
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
init_frontmatter2();
-import { existsSync as existsSync42, readFileSync as readFileSync23, writeFileSync as writeFileSync7, unlinkSync as unlinkSync5, mkdirSync as mkdirSync12 } from "node:fs";
-import { dirname as dirname23, join as join64 } from "node:path";
+import { existsSync as existsSync42, readFileSync as readFileSync24, writeFileSync as writeFileSync7, unlinkSync as unlinkSync5, mkdirSync as mkdirSync12 } from "node:fs";
+import { dirname as dirname24, join as join66 } from "node:path";
// packages/omo-opencode/src/hooks/ralph-loop/constants.ts
var DEFAULT_STATE_FILE = ".omo/ralph-loop.local.md";
@@ -97775,7 +98039,7 @@ var DEFAULT_COMPLETION_PROMISE = "DONE";
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
function getStateFilePath(directory, customPath) {
- return customPath ? join64(directory, customPath) : join64(directory, DEFAULT_STATE_FILE);
+ return customPath ? join66(directory, customPath) : join66(directory, DEFAULT_STATE_FILE);
}
function readState(directory, customPath) {
const filePath = getStateFilePath(directory, customPath);
@@ -97783,7 +98047,7 @@ function readState(directory, customPath) {
return null;
}
try {
- const content = readFileSync23(filePath, "utf-8");
+ const content = readFileSync24(filePath, "utf-8");
const { data, body } = parseFrontmatter(content);
const active = data.active;
const iteration = data.iteration;
@@ -98858,14 +99122,14 @@ async function getLocalVersion(options = {}) {
}
}
// packages/omo-opencode/src/cli/doctor/checks/system.ts
-import { existsSync as existsSync53, readFileSync as readFileSync33 } from "node:fs";
+import { existsSync as existsSync53, readFileSync as readFileSync34 } from "node:fs";
// packages/omo-opencode/src/cli/doctor/checks/system-binary.ts
init_extract_semver();
init_bun_which_shim();
import { existsSync as existsSync50, accessSync as accessSync4, constants as constants10 } from "node:fs";
import { homedir as homedir14 } from "node:os";
-import { join as join71 } from "node:path";
+import { join as join73 } from "node:path";
// packages/omo-opencode/src/cli/doctor/framework/spawn-with-timeout.ts
init_spawn_with_windows_hide();
@@ -98957,17 +99221,17 @@ function getDesktopAppPaths(platform) {
case "darwin":
return [
"/Applications/OpenCode.app/Contents/MacOS/OpenCode",
- join71(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
+ join73(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
];
case "win32": {
const programFiles = process.env.ProgramFiles;
const localAppData = process.env.LOCALAPPDATA;
const paths = [];
if (programFiles) {
- paths.push(join71(programFiles, "OpenCode", "OpenCode.exe"));
+ paths.push(join73(programFiles, "OpenCode", "OpenCode.exe"));
}
if (localAppData) {
- paths.push(join71(localAppData, "OpenCode", "OpenCode.exe"));
+ paths.push(join73(localAppData, "OpenCode", "OpenCode.exe"));
}
return paths;
}
@@ -98975,8 +99239,8 @@ function getDesktopAppPaths(platform) {
return [
"/usr/bin/opencode",
"/usr/lib/opencode/opencode",
- join71(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
- join71(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
+ join73(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
+ join73(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
];
default:
return [];
@@ -99008,7 +99272,7 @@ async function findOpenCodeBinary(platform = process.platform, checkExists = exi
const candidates = getCommandCandidates2(platform);
for (const entry of pathEnv.split(delimiter3).filter(Boolean)) {
for (const command of candidates) {
- const fullPath = join71(entry, command);
+ const fullPath = join73(entry, command);
if (checkExists(fullPath) && isExecutable2(fullPath)) {
return { binary: command, path: fullPath };
}
@@ -99054,7 +99318,7 @@ function compareVersions3(current, minimum) {
// packages/omo-opencode/src/cli/doctor/checks/system-plugin.ts
init_shared();
-import { existsSync as existsSync51, readFileSync as readFileSync31 } from "node:fs";
+import { existsSync as existsSync51, readFileSync as readFileSync32 } from "node:fs";
function detectConfigPath() {
const paths = getOpenCodeConfigPaths({ binary: "opencode", version: null });
if (existsSync51(paths.configJsonc))
@@ -99105,7 +99369,7 @@ function getPluginInfo() {
};
}
try {
- const content = readFileSync31(configPath, "utf-8");
+ const content = readFileSync32(configPath, "utf-8");
const parsedConfig = parseJsonc(content);
const pluginEntry = findPluginEntry2(parsedConfig.plugin ?? []);
if (!pluginEntry) {
@@ -99147,25 +99411,25 @@ init_file_utils2();
init_checker();
init_auto_update_checker();
init_package_json_locator();
-import { existsSync as existsSync52, readFileSync as readFileSync32, readdirSync as readdirSync8 } from "node:fs";
+import { existsSync as existsSync52, readFileSync as readFileSync33, readdirSync as readdirSync8 } from "node:fs";
import { createRequire as createRequire3 } from "node:module";
import { homedir as homedir15 } from "node:os";
-import { join as join72 } from "node:path";
+import { join as join74 } from "node:path";
import { fileURLToPath as fileURLToPath6 } from "node:url";
init_shared();
function getPlatformDefaultCacheDir(platform = process.platform) {
if (platform === "darwin")
- return join72(homedir15(), "Library", "Caches");
+ return join74(homedir15(), "Library", "Caches");
if (platform === "win32")
- return process.env.LOCALAPPDATA ?? join72(homedir15(), "AppData", "Local");
- return join72(homedir15(), ".cache");
+ return process.env.LOCALAPPDATA ?? join74(homedir15(), "AppData", "Local");
+ return join74(homedir15(), ".cache");
}
function resolveOpenCodeCacheDir() {
const xdgCacheHome = process.env.XDG_CACHE_HOME;
if (xdgCacheHome)
- return join72(xdgCacheHome, "opencode");
+ return join74(xdgCacheHome, "opencode");
const fromShared = getOpenCodeCacheDir();
- const platformDefault = join72(getPlatformDefaultCacheDir(), "opencode");
+ const platformDefault = join74(getPlatformDefaultCacheDir(), "opencode");
if (existsSync52(fromShared) || !existsSync52(platformDefault))
return fromShared;
return platformDefault;
@@ -99179,7 +99443,7 @@ function readPackageJson(filePath) {
if (!existsSync52(filePath))
return null;
try {
- const content = readFileSync32(filePath, "utf-8");
+ const content = readFileSync33(filePath, "utf-8");
return parseJsonc(content);
} catch (error51) {
if (!(error51 instanceof Error)) {
@@ -99197,11 +99461,11 @@ function normalizeVersion(value) {
function createPackageCandidates(rootDir) {
return ACCEPTED_PACKAGE_NAMES.map((packageName) => ({
packageName,
- installedPackagePath: join72(rootDir, "node_modules", packageName, "package.json")
+ installedPackagePath: join74(rootDir, "node_modules", packageName, "package.json")
}));
}
function createTaggedInstallCandidates(rootDir) {
- const packagesDir = join72(rootDir, "packages");
+ const packagesDir = join74(rootDir, "packages");
if (!existsSync52(packagesDir))
return [];
const candidates = [];
@@ -99209,14 +99473,14 @@ function createTaggedInstallCandidates(rootDir) {
const packageName = ACCEPTED_PACKAGE_NAMES.find((name) => entryName.startsWith(`${name}@`));
if (packageName === undefined)
continue;
- const installDir = join72(packagesDir, entryName);
+ const installDir = join74(packagesDir, entryName);
candidates.push({
cacheDir: installDir,
- cachePackagePath: join72(installDir, "package.json"),
+ cachePackagePath: join74(installDir, "package.json"),
packageCandidates: [
{
packageName,
- installedPackagePath: join72(installDir, "node_modules", packageName, "package.json")
+ installedPackagePath: join74(installDir, "node_modules", packageName, "package.json")
}
]
});
@@ -99261,13 +99525,13 @@ function getLoadedPluginVersion() {
const candidates = [
{
cacheDir: configDir,
- cachePackagePath: join72(configDir, "package.json"),
+ cachePackagePath: join74(configDir, "package.json"),
packageCandidates: createPackageCandidates(configDir)
},
...createTaggedInstallCandidates(configDir),
{
cacheDir,
- cachePackagePath: join72(cacheDir, "package.json"),
+ cachePackagePath: join74(cacheDir, "package.json"),
packageCandidates: createPackageCandidates(cacheDir)
},
...createTaggedInstallCandidates(cacheDir)
@@ -99313,7 +99577,7 @@ var defaultDeps6 = {
getLatestPluginVersion,
getSuggestedInstallTag,
configExists: existsSync53,
- readConfigFile: (path14) => readFileSync33(path14, "utf-8"),
+ readConfigFile: (path14) => readFileSync34(path14, "utf-8"),
parseConfigContent: (content) => parseJsonc(content)
};
var BUN_POSTINSTALL_HELPER_PACKAGE_NAME = "@code-yeongyu/comment-checker";
@@ -99458,9 +99722,9 @@ async function checkSystem(deps = defaultDeps6) {
// packages/omo-opencode/src/config/validate.ts
init_src();
-import { readFileSync as readFileSync34 } from "node:fs";
+import { readFileSync as readFileSync35 } from "node:fs";
import { homedir as homedir16 } from "node:os";
-import { dirname as dirname28, relative as relative9 } from "node:path";
+import { dirname as dirname29, relative as relative9 } from "node:path";
init_shared();
init_plugin_identity();
function resolveHomeDirectory2() {
@@ -99484,7 +99748,7 @@ function discoverProjectLayersNearestFirst(directory) {
const stopDirectory = containsPath(homeDirectory, directory) ? homeDirectory : directory;
return findProjectOpencodePluginConfigFiles(directory, stopDirectory).map((configPath) => ({
path: configPath,
- configDir: dirname28(configPath)
+ configDir: dirname29(configPath)
}));
}
function shortPath(configPath) {
@@ -99503,12 +99767,12 @@ function schemaMessages(configPath, rawConfig) {
}
function parseLayerConfig(configPath) {
try {
- const content = readFileSync34(configPath, "utf-8");
+ const content = readFileSync35(configPath, "utf-8");
const rawConfig = parseJsonc(content);
if (!isPlainRecord(rawConfig)) {
return {
path: configPath,
- configDir: dirname28(configPath),
+ configDir: dirname29(configPath),
config: null,
messages: [`${shortPath(configPath)}: <root>: Expected object`]
};
@@ -99516,7 +99780,7 @@ function parseLayerConfig(configPath) {
const result = OhMyOpenCodeConfigSchema.safeParse(rawConfig);
return {
path: configPath,
- configDir: dirname28(configPath),
+ configDir: dirname29(configPath),
config: result.success ? result.data : parseConfigPartially(rawConfig),
messages: schemaMessages(configPath, rawConfig)
};
@@ -99526,7 +99790,7 @@ function parseLayerConfig(configPath) {
}
return {
path: configPath,
- configDir: dirname28(configPath),
+ configDir: dirname29(configPath),
config: null,
messages: [`${shortPath(configPath)}: ${error51.message}`]
};
@@ -99572,26 +99836,26 @@ function validatePluginConfig(directory) {
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-cache.ts
init_shared();
-import { existsSync as existsSync54, readFileSync as readFileSync35 } from "node:fs";
+import { existsSync as existsSync54, readFileSync as readFileSync36 } from "node:fs";
import { homedir as homedir17 } from "node:os";
-import { join as join73 } from "node:path";
+import { join as join75 } from "node:path";
function getUserConfigDir2() {
const xdgConfig = process.env.XDG_CONFIG_HOME;
if (xdgConfig)
- return join73(xdgConfig, "opencode");
- return join73(homedir17(), ".config", "opencode");
+ return join75(xdgConfig, "opencode");
+ return join75(homedir17(), ".config", "opencode");
}
function loadCustomProviderNames() {
const configDir = getUserConfigDir2();
const candidatePaths = [
- join73(configDir, "opencode.json"),
- join73(configDir, "opencode.jsonc")
+ join75(configDir, "opencode.json"),
+ join75(configDir, "opencode.jsonc")
];
for (const configPath of candidatePaths) {
if (!existsSync54(configPath))
continue;
try {
- const content = readFileSync35(configPath, "utf-8");
+ const content = readFileSync36(configPath, "utf-8");
const data = parseJsonc(content);
if (data?.provider && typeof data.provider === "object") {
return Object.keys(data.provider);
@@ -99606,7 +99870,7 @@ function loadCustomProviderNames() {
return [];
}
function loadAvailableModelsFromCache() {
- const cacheFile = join73(getOpenCodeCacheDir(), "models.json");
+ const cacheFile = join75(getOpenCodeCacheDir(), "models.json");
const customProviders = loadCustomProviderNames();
if (!existsSync54(cacheFile)) {
if (customProviders.length > 0) {
@@ -99615,7 +99879,7 @@ function loadAvailableModelsFromCache() {
return { providers: [], modelCount: 0, cacheExists: false };
}
try {
- const content = readFileSync35(cacheFile, "utf-8");
+ const content = readFileSync36(cacheFile, "utf-8");
const data = parseJsonc(content);
const cacheProviders = Object.keys(data);
let modelCount = 0;
@@ -99642,9 +99906,9 @@ init_model_capabilities2();
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-config.ts
init_shared();
init_plugin_identity();
-import { readFileSync as readFileSync36 } from "node:fs";
-import { join as join74 } from "node:path";
-var PROJECT_CONFIG_DIR = join74(process.cwd(), ".opencode");
+import { readFileSync as readFileSync37 } from "node:fs";
+import { join as join76 } from "node:path";
+var PROJECT_CONFIG_DIR = join76(process.cwd(), ".opencode");
function loadOmoConfig() {
const projectDetected = detectPluginConfigFile(PROJECT_CONFIG_DIR, {
basenames: [CONFIG_BASENAME],
@@ -99652,7 +99916,7 @@ function loadOmoConfig() {
});
if (projectDetected.format !== "none") {
try {
- const content = readFileSync36(projectDetected.path, "utf-8");
+ const content = readFileSync37(projectDetected.path, "utf-8");
return parseJsonc(content);
} catch (error51) {
if (error51 instanceof Error) {
@@ -99668,7 +99932,7 @@ function loadOmoConfig() {
});
if (userDetected.format !== "none") {
try {
- const content = readFileSync36(userDetected.path, "utf-8");
+ const content = readFileSync37(userDetected.path, "utf-8");
return parseJsonc(content);
} catch (error51) {
if (error51 instanceof Error) {
@@ -99682,7 +99946,7 @@ function loadOmoConfig() {
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-details.ts
init_shared();
-import { join as join75 } from "node:path";
+import { join as join77 } from "node:path";
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-variant.ts
function formatModelWithVariant(model, variant) {
@@ -99724,7 +99988,7 @@ function formatCapabilityResolutionLabel(mode) {
}
function buildModelResolutionDetails(options) {
const details = [];
- const cacheFile = join75(getOpenCodeCacheDir(), "models.json");
+ const cacheFile = join77(getOpenCodeCacheDir(), "models.json");
details.push("═══ Available Models (from cache) ═══");
details.push("");
if (options.available.cacheExists) {
@@ -100003,25 +100267,25 @@ init_src();
import { existsSync as existsSync55 } from "node:fs";
import { createRequire as createRequire4 } from "node:module";
import { homedir as homedir19 } from "node:os";
-import { dirname as dirname29, join as join77 } from "node:path";
+import { dirname as dirname30, join as join79 } from "node:path";
// packages/omo-opencode/src/hooks/comment-checker/downloader.ts
-import { join as join76 } from "path";
+import { join as join78 } from "path";
import { homedir as homedir18, tmpdir as tmpdir3 } from "os";
init_binary_downloader();
init_logger2();
init_plugin_identity();
var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
-var DEBUG_FILE = join76(tmpdir3(), "comment-checker-debug.log");
+var DEBUG_FILE = join78(tmpdir3(), "comment-checker-debug.log");
function getCacheDir2() {
if (process.platform === "win32") {
const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
- const base2 = localAppData || join76(homedir18(), "AppData", "Local");
- return join76(base2, CACHE_DIR_NAME, "bin");
+ const base2 = localAppData || join78(homedir18(), "AppData", "Local");
+ return join78(base2, CACHE_DIR_NAME, "bin");
}
const xdgCache = process.env.XDG_CACHE_HOME;
- const base = xdgCache || join76(homedir18(), ".cache");
- return join76(base, CACHE_DIR_NAME, "bin");
+ const base = xdgCache || join78(homedir18(), ".cache");
+ return join78(base, CACHE_DIR_NAME, "bin");
}
function getBinaryName() {
return process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
@@ -100071,7 +100335,7 @@ async function getBinaryVersion(binary) {
}
}
async function checkAstGrepCli() {
- const runtimeDir = astGrepRuntimeDir(join77(homedir19(), ".omo"));
+ const runtimeDir = astGrepRuntimeDir(join79(homedir19(), ".omo"));
const sgPath = findSgBinarySync({ runtimeDir });
if (sgPath === null) {
return {
@@ -100100,11 +100364,11 @@ function findCommentCheckerPackageBinary(baseDirOverride, resolvePackageJsonPath
const binaryName = process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
const platformKey = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
try {
- const packageDir = baseDirOverride ?? dirname29(resolvePackageJsonPath());
- const vendorPath = join77(packageDir, "vendor", platformKey, binaryName);
+ const packageDir = baseDirOverride ?? dirname30(resolvePackageJsonPath());
+ const vendorPath = join79(packageDir, "vendor", platformKey, binaryName);
if (existsSync55(vendorPath))
return vendorPath;
- const binPath = join77(packageDir, "bin", binaryName);
+ const binPath = join79(packageDir, "bin", binaryName);
if (existsSync55(binPath))
return binPath;
} catch (error51) {
@@ -100249,12 +100513,12 @@ async function getGhCliInfo(dependencies = {}) {
}
// packages/omo-opencode/src/cli/doctor/checks/tools-lsp.ts
-import { readFileSync as readFileSync37 } from "node:fs";
-import { join as join78 } from "node:path";
+import { readFileSync as readFileSync38 } from "node:fs";
+import { join as join80 } from "node:path";
// packages/omo-opencode/src/mcp/lsp.ts
import { existsSync as existsSync56 } from "node:fs";
-import { delimiter as delimiter3, dirname as dirname30, resolve as resolve21 } from "node:path";
+import { delimiter as delimiter3, dirname as dirname31, resolve as resolve21 } from "node:path";
import { fileURLToPath as fileURLToPath7 } from "node:url";
// packages/omo-opencode/src/mcp/cli-suffix.ts
@@ -100376,7 +100640,7 @@ var LSP_BOOTSTRAP_SCRIPT = [
].join(";");
function getModuleDirectory(moduleUrl) {
try {
- return dirname30(fileURLToPath7(moduleUrl));
+ return dirname31(fileURLToPath7(moduleUrl));
} catch (error51) {
if (!(error51 instanceof Error))
throw error51;
@@ -100446,7 +100710,7 @@ function readOmoConfig(configDirectory) {
return null;
}
try {
- const content = readFileSync37(detected.path, "utf-8");
+ const content = readFileSync38(detected.path, "utf-8");
return parseJsonc(content);
} catch (error51) {
if (!(error51 instanceof Error)) {
@@ -100457,7 +100721,7 @@ function readOmoConfig(configDirectory) {
}
function isLspMcpDisabled(options) {
const userConfigDirectory = options.configDirectory ?? getOpenCodeConfigDir({ binary: "opencode" });
- const projectConfigDirectory = join78(options.cwd ?? process.cwd(), ".opencode");
+ const projectConfigDirectory = join80(options.cwd ?? process.cwd(), ".opencode");
const userConfig = readOmoConfig(userConfigDirectory);
const projectConfig = readOmoConfig(projectConfigDirectory);
const disabledMcps = new Set([
@@ -100476,15 +100740,15 @@ function getInstalledLspServers(options = {}) {
// packages/omo-opencode/src/cli/doctor/checks/tools-mcp.ts
init_shared();
-import { existsSync as existsSync57, readFileSync as readFileSync38 } from "node:fs";
+import { existsSync as existsSync57, readFileSync as readFileSync39 } from "node:fs";
import { homedir as homedir20 } from "node:os";
-import { join as join79 } from "node:path";
+import { join as join81 } from "node:path";
var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
function getMcpConfigPaths() {
return [
- join79(homedir20(), ".claude", ".mcp.json"),
- join79(process.cwd(), ".mcp.json"),
- join79(process.cwd(), ".claude", ".mcp.json")
+ join81(homedir20(), ".claude", ".mcp.json"),
+ join81(process.cwd(), ".mcp.json"),
+ join81(process.cwd(), ".claude", ".mcp.json")
];
}
function loadUserMcpConfig() {
@@ -100493,7 +100757,7 @@ function loadUserMcpConfig() {
if (!existsSync57(configPath))
continue;
try {
- const content = readFileSync38(configPath, "utf-8");
+ const content = readFileSync39(configPath, "utf-8");
const config3 = parseJsonc(content);
if (config3.mcpServers) {
Object.assign(servers, config3.mcpServers);
@@ -100628,7 +100892,7 @@ async function checkTools() {
// packages/omo-opencode/src/cli/doctor/checks/telemetry.ts
init_src4();
-import { existsSync as existsSync58, readFileSync as readFileSync39 } from "node:fs";
+import { existsSync as existsSync58, readFileSync as readFileSync40 } from "node:fs";
function isTelemetryState(value) {
return value !== null && typeof value === "object" && !Array.isArray(value);
}
@@ -100638,7 +100902,7 @@ function readLastActiveDay(stateFilePath) {
}
let parsed;
try {
- parsed = JSON.parse(readFileSync39(stateFilePath, "utf-8"));
+ parsed = JSON.parse(readFileSync40(stateFilePath, "utf-8"));
} catch (error51) {
if (error51 instanceof Error) {
return "unreadable";
@@ -100713,7 +100977,7 @@ function expandHomeDirectory(directoryPath) {
// packages/omo-opencode/src/cli/doctor/checks/team-mode.ts
init_shared();
init_plugin_identity();
-import { readFileSync as readFileSync40, promises as fs13 } from "node:fs";
+import { readFileSync as readFileSync41, promises as fs13 } from "node:fs";
import path15 from "node:path";
async function checkTeamMode() {
const config3 = loadTeamModeConfig();
@@ -100750,7 +101014,7 @@ function loadTeamModeConfig() {
if (!configPath)
return { team_mode: undefined };
try {
- return parseJsonc(readFileSync40(configPath, "utf-8"));
+ return parseJsonc(readFileSync41(configPath, "utf-8"));
} catch (error51) {
if (error51 instanceof Error) {
return { team_mode: undefined };
@@ -100784,9 +101048,9 @@ async function pathExists(dir) {
// packages/omo-opencode/src/cli/doctor/checks/codex.ts
init_src();
import { existsSync as existsSync59 } from "node:fs";
-import { lstat as lstat12, readdir as readdir10, readFile as readFile23 } from "node:fs/promises";
+import { lstat as lstat13, readdir as readdir11, readFile as readFile23 } from "node:fs/promises";
import { homedir as homedir22 } from "node:os";
-import { basename as basename13, join as join80, resolve as resolve22 } from "node:path";
+import { basename as basename13, join as join82, resolve as resolve22 } from "node:path";
// packages/omo-opencode/package.json
var package_default3 = {
name: "@oh-my-opencode/omo-opencode",
@@ -100844,13 +101108,13 @@ var CODEX_BIN_NAMES = [
"omo-git-bash-hook"
];
async function gatherCodexSummary(deps = {}) {
- const codexHome = resolve22(deps.codexHome ?? process.env.CODEX_HOME ?? join80(homedir22(), ".codex"));
+ const codexHome = resolve22(deps.codexHome ?? process.env.CODEX_HOME ?? join82(homedir22(), ".codex"));
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
const detection = await (deps.detectCodexInstallation ?? detectCodexInstallation)();
const pluginRoot = await resolveInstalledPluginRoot(codexHome);
- const manifest = pluginRoot === null ? null : await readJson(join80(pluginRoot, ".codex-plugin", "plugin.json"));
- const installSnapshot = pluginRoot === null ? null : await readJson(join80(pluginRoot, "lazycodex-install.json"));
- const configPath = join80(codexHome, "config.toml");
+ const manifest = pluginRoot === null ? null : await readJson(join82(pluginRoot, ".codex-plugin", "plugin.json"));
+ const installSnapshot = pluginRoot === null ? null : await readJson(join82(pluginRoot, "lazycodex-install.json"));
+ const configPath = join82(codexHome, "config.toml");
const pluginVersion = stringField(manifest, "version");
return {
codexPath: detection.found && "path" in detection ? detection.path : null,
@@ -100907,7 +101171,7 @@ function buildCodexIssues(summary) {
if (summary.pluginRoot === null) {
issues.push({
title: "OMO Codex plugin is not installed",
- description: `Expected cached plugin at ${join80("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
+ description: `Expected cached plugin at ${join82("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
fix: "Run: npx lazycodex-ai install",
severity: "error",
affects: ["plugin loading"]
@@ -100972,12 +101236,12 @@ function buildCodexIssues(summary) {
return issues;
}
async function resolveInstalledPluginRoot(codexHome) {
- const pluginRoot = join80(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
+ const pluginRoot = join82(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
if (!existsSync59(pluginRoot))
return null;
- const versions2 = await readdir10(pluginRoot, { withFileTypes: true });
+ const versions2 = await readdir11(pluginRoot, { withFileTypes: true });
const candidates = versions2.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionsDescending);
- return candidates.length === 0 ? null : join80(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
+ return candidates.length === 0 ? null : join82(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
}
async function readCodexConfigSummary(configPath) {
if (!existsSync59(configPath)) {
@@ -101005,16 +101269,16 @@ async function readCodexConfigSummary(configPath) {
async function readLinkedBins(binDir) {
const linked = [];
for (const name of CODEX_BIN_NAMES) {
- if (await pathExists2(join80(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
+ if (await pathExists2(join82(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
linked.push(name);
}
return linked;
}
async function readLinkedAgents(codexHome) {
- const agentsDir = join80(codexHome, "agents");
+ const agentsDir = join82(codexHome, "agents");
if (!existsSync59(agentsDir))
return [];
- const entries = await readdir10(agentsDir, { withFileTypes: true });
+ const entries = await readdir11(agentsDir, { withFileTypes: true });
return entries.filter((entry) => entry.isFile() || entry.isSymbolicLink()).map((entry) => basename13(entry.name, ".toml")).sort();
}
async function readJson(path16) {
@@ -101114,7 +101378,7 @@ function compareVersionsDescending(left, right) {
}
async function pathExists2(path16) {
try {
- await lstat12(path16);
+ await lstat13(path16);
return true;
} catch (error51) {
if (error51 instanceof Error)
@@ -101125,9 +101389,9 @@ async function pathExists2(path16) {
// packages/omo-opencode/src/cli/doctor/checks/codex-components.ts
init_src();
-import { readdir as readdir11, readFile as readFile24, stat as stat6 } from "node:fs/promises";
+import { readdir as readdir12, readFile as readFile24, stat as stat6 } from "node:fs/promises";
import { homedir as homedir23 } from "node:os";
-import { dirname as dirname31, isAbsolute as isAbsolute12, join as join81, relative as relative10, resolve as resolve23, sep as sep9 } from "node:path";
+import { dirname as dirname32, isAbsolute as isAbsolute13, join as join83, relative as relative10, resolve as resolve23, sep as sep9 } from "node:path";
var CODEX_COMPONENTS_CHECK_ID = "codex-components";
var CODEX_COMPONENTS_CHECK_NAME = "codex-components";
var PLUGIN_DATA_DIR_NAME = "omo-sisyphuslabs";
@@ -101137,7 +101401,7 @@ async function checkCodexComponents(deps = {}) {
const env3 = deps.env ?? process.env;
const platform = deps.platform ?? process.platform;
const arch = deps.arch ?? process.arch;
- const codexHome = resolve23(deps.codexHome ?? env3["CODEX_HOME"] ?? join81(homedir23(), ".codex"));
+ const codexHome = resolve23(deps.codexHome ?? env3["CODEX_HOME"] ?? join83(homedir23(), ".codex"));
const summary = await gatherCodexSummary({ ...deps, codexHome });
if (summary.pluginRoot === null) {
return {
@@ -101162,7 +101426,7 @@ async function checkCodexComponents(deps = {}) {
});
}
const runtimeSgDir = runtimeSgDirectory(codexHome, platform, arch);
- const runtimeSgPath = join81(runtimeSgDir, sgBinaryName(platform));
+ const runtimeSgPath = join83(runtimeSgDir, sgBinaryName(platform));
const sg = findSgBinarySync({
arch,
env: env3,
@@ -101199,12 +101463,12 @@ async function auditBundleTargets(pluginRoot) {
let referencedCount = 0;
for (const manifestPath of await findManifestPaths(pluginRoot, ".mcp.json")) {
const manifest = await readJson2(manifestPath);
- if (manifest === null || !isRecord5(manifest["mcpServers"]))
+ if (manifest === null || !isRecord6(manifest["mcpServers"]))
continue;
- const manifestRoot = dirname31(manifestPath);
+ const manifestRoot = dirname32(manifestPath);
const isRootManifest = resolve23(manifestRoot) === resolve23(pluginRoot);
for (const server2 of Object.values(manifest["mcpServers"])) {
- if (!isRecord5(server2) || !Array.isArray(server2["args"]))
+ if (!isRecord6(server2) || !Array.isArray(server2["args"]))
continue;
for (const arg of server2["args"]) {
if (typeof arg !== "string" || !isPluginRuntimePathArg(arg))
@@ -101222,7 +101486,7 @@ async function auditBundleTargets(pluginRoot) {
continue;
const commands2 = [];
collectHookCommands(manifest, commands2);
- const hookPluginRoot = dirname31(dirname31(hookManifestPath));
+ const hookPluginRoot = dirname32(dirname32(hookManifestPath));
for (const command of commands2) {
for (const relativePath of extractPluginRootPaths(command)) {
referencedCount += 1;
@@ -101261,12 +101525,12 @@ async function classifyBundleTarget(bundleRoot, baseRoot, relativePath, allowEsc
}
async function findHookManifestPaths(root) {
const paths2 = await findManifestPaths(root, "hooks.json");
- return paths2.filter((path16) => dirname31(path16).endsWith(`${sep9}hooks`));
+ return paths2.filter((path16) => dirname32(path16).endsWith(`${sep9}hooks`));
}
async function findManifestPaths(root, manifestName) {
let entries;
try {
- entries = await readdir11(root, { withFileTypes: true });
+ entries = await readdir12(root, { withFileTypes: true });
} catch {
return [];
}
@@ -101274,7 +101538,7 @@ async function findManifestPaths(root, manifestName) {
for (const entry of entries) {
if (entry.name === "node_modules" || entry.name === ".git")
continue;
- const entryPath = join81(root, entry.name);
+ const entryPath = join83(root, entry.name);
if (entry.isDirectory()) {
paths2.push(...await findManifestPaths(entryPath, manifestName));
continue;
@@ -101290,7 +101554,7 @@ function collectHookCommands(value, commands2) {
collectHookCommands(item, commands2);
return;
}
- if (!isRecord5(value))
+ if (!isRecord6(value))
return;
if (value["type"] === "command") {
if (typeof value["command"] === "string")
@@ -101315,21 +101579,21 @@ function extractPluginRootPaths(command) {
}
function isPluginRuntimePathArg(arg) {
const normalized = normalizePathSeparators(arg);
- return normalized.endsWith(".js") && normalized.includes("/dist/") && (normalized.startsWith("./") || normalized.startsWith("../") || normalized.startsWith("components/") || normalized.startsWith("/") || isAbsolute12(arg));
+ return normalized.endsWith(".js") && normalized.includes("/dist/") && (normalized.startsWith("./") || normalized.startsWith("../") || normalized.startsWith("components/") || normalized.startsWith("/") || isAbsolute13(arg));
}
function runtimeSgDirectory(codexHome, platform, arch) {
- return join81(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
+ return join83(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
}
function describeSgSource(sgPath, env3, runtimeSgDir, platform) {
const override = env3[SG_PATH_ENV_KEY]?.trim();
if (override !== undefined && override.length > 0 && sgPath === override)
return `env override ${SG_PATH_ENV_KEY}`;
- if (sgPath === join81(runtimeSgDir, sgBinaryName(platform)))
+ if (sgPath === join83(runtimeSgDir, sgBinaryName(platform)))
return "runtime dir";
return "PATH";
}
async function readBootstrapStateSummary(codexHome) {
- const statePath = join81(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
+ const statePath = join83(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
const raw = await readJson2(statePath);
if (raw === null)
return null;
@@ -101345,7 +101609,7 @@ function parseDegradedEntries(value) {
return [];
const entries = [];
for (const item of value) {
- if (!isRecord5(item))
+ if (!isRecord6(item))
continue;
if (typeof item["component"] !== "string" || typeof item["reason"] !== "string")
continue;
@@ -101379,7 +101643,7 @@ function degradedDetailLines(entries) {
async function readJson2(path16) {
try {
const parsed = JSON.parse(await readFile24(path16, "utf8"));
- return isRecord5(parsed) ? parsed : null;
+ return isRecord6(parsed) ? parsed : null;
} catch (error51) {
if (error51 instanceof Error)
return null;
@@ -101400,7 +101664,7 @@ function normalizeRelative(root, target) {
function normalizePathSeparators(path16) {
return path16.split("\\").join("/");
}
-function isRecord5(value) {
+function isRecord6(value) {
return typeof value === "object" && value !== null && !Array.isArray(value);
}
@@ -101408,15 +101672,15 @@ function isRecord5(value) {
import { existsSync as existsSync60 } from "node:fs";
import { readFile as readFile25 } from "node:fs/promises";
import { homedir as homedir24 } from "node:os";
-import { join as join82, resolve as resolve24 } from "node:path";
+import { join as join84, resolve as resolve24 } from "node:path";
var RUNTIME_WRAPPER_MARKER2 = "OMO_GENERATED_RUNTIME_WRAPPER";
var CHECK_NAME = "codex-runtime-wrapper";
var REINSTALL_COMMAND = "npx --yes lazycodex-ai@latest install --no-tui";
async function checkCodexRuntimeWrapper(deps = {}) {
- const codexHome = resolve24(deps.codexHome ?? process.env.CODEX_HOME ?? join82(homedir24(), ".codex"));
+ const codexHome = resolve24(deps.codexHome ?? process.env.CODEX_HOME ?? join84(homedir24(), ".codex"));
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
const platform = deps.platform ?? process.platform;
- const wrapperPath = join82(binDir, platform === "win32" ? "omo.cmd" : "omo");
+ const wrapperPath = join84(binDir, platform === "win32" ? "omo.cmd" : "omo");
const wrapper = await readRuntimeWrapper(wrapperPath);
const issues = [];
if (wrapper?.includes(RUNTIME_WRAPPER_MARKER2) === true) {
@@ -101923,17 +102187,17 @@ import {
existsSync as existsSync63,
mkdirSync as mkdirSync14,
readdirSync as readdirSync9,
- readFileSync as readFileSync42,
+ readFileSync as readFileSync43,
renameSync as renameSync7,
unlinkSync as unlinkSync8,
writeFileSync as writeFileSync11
} from "node:fs";
-import { basename as basename14, dirname as dirname32, join as join85 } from "node:path";
+import { basename as basename14, dirname as dirname33, join as join87 } from "node:path";
// packages/mcp-client-core/src/config-dir.ts
import { existsSync as existsSync61, realpathSync as realpathSync8 } from "node:fs";
import { homedir as homedir25 } from "node:os";
-import { join as join83, resolve as resolve25 } from "node:path";
+import { join as join85, resolve as resolve25 } from "node:path";
function resolveConfigPath2(pathValue) {
const resolvedPath = resolve25(pathValue);
if (!existsSync61(resolvedPath))
@@ -101951,13 +102215,13 @@ function getOpenCodeCliConfigDir(env3 = process.env) {
if (customConfigDir) {
return resolveConfigPath2(customConfigDir);
}
- const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() || join83(homedir25(), ".config");
- return resolveConfigPath2(join83(xdgConfigDir, "opencode"));
+ const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() || join85(homedir25(), ".config");
+ return resolveConfigPath2(join85(xdgConfigDir, "opencode"));
}
// packages/mcp-client-core/src/mcp-oauth/storage-index.ts
-import { chmodSync as chmodSync3, existsSync as existsSync62, readFileSync as readFileSync41, renameSync as renameSync6, writeFileSync as writeFileSync10 } from "node:fs";
-import { join as join84 } from "node:path";
+import { chmodSync as chmodSync3, existsSync as existsSync62, readFileSync as readFileSync42, renameSync as renameSync6, writeFileSync as writeFileSync10 } from "node:fs";
+import { join as join86 } from "node:path";
var INDEX_FILE_NAME = "index.json";
function isTokenIndex(value) {
if (typeof value !== "object" || value === null || Array.isArray(value))
@@ -101965,14 +102229,14 @@ function isTokenIndex(value) {
return Object.values(value).every((entry) => typeof entry === "string");
}
function getIndexPath(storageDir) {
- return join84(storageDir, INDEX_FILE_NAME);
+ return join86(storageDir, INDEX_FILE_NAME);
}
function readTokenIndex(storageDir) {
const indexPath = getIndexPath(storageDir);
if (!existsSync62(indexPath))
return {};
try {
- const parsed = JSON.parse(readFileSync41(indexPath, "utf-8"));
+ const parsed = JSON.parse(readFileSync42(indexPath, "utf-8"));
return isTokenIndex(parsed) ? parsed : {};
} catch (readError) {
if (!(readError instanceof Error))
@@ -102009,16 +102273,16 @@ function deleteTokenIndexEntry(storageDir, hash2) {
var STORAGE_DIR_NAME = "mcp-oauth";
var LEGACY_STORAGE_FILE_NAME = "mcp-oauth.json";
function getMcpOauthStorageDir() {
- return join85(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
+ return join87(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
}
function getMcpOauthServerHash(serverHost, resource) {
return createHash4("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
}
function getMcpOauthStoragePath(serverHost, resource) {
- return join85(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
+ return join87(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
}
function getLegacyStoragePath() {
- return join85(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
+ return join87(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
}
function normalizeHost2(serverHost) {
let host = serverHost.trim();
@@ -102082,7 +102346,7 @@ function readTokenFile(filePath) {
if (!existsSync63(filePath))
return null;
try {
- const parsed = JSON.parse(readFileSync42(filePath, "utf-8"));
+ const parsed = JSON.parse(readFileSync43(filePath, "utf-8"));
return isOAuthTokenData(parsed) ? parsed : null;
} catch (readError) {
if (!(readError instanceof Error))
@@ -102095,7 +102359,7 @@ function readLegacyStore() {
if (!existsSync63(filePath))
return null;
try {
- const parsed = JSON.parse(readFileSync42(filePath, "utf-8"));
+ const parsed = JSON.parse(readFileSync43(filePath, "utf-8"));
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed))
return null;
const result = {};
@@ -102112,7 +102376,7 @@ function readLegacyStore() {
}
function writeTokenFile(filePath, token) {
try {
- const dir = dirname32(filePath);
+ const dir = dirname33(filePath);
if (!existsSync63(dir)) {
mkdirSync14(dir, { recursive: true });
}
@@ -102197,7 +102461,7 @@ function listTokensByHost(serverHost) {
for (const [hash2, indexedKey] of Object.entries(index)) {
if (!indexedKey.startsWith(prefix))
continue;
- const indexedToken = readTokenFile(join85(getMcpOauthStorageDir(), `${hash2}.json`));
+ const indexedToken = readTokenFile(join87(getMcpOauthStorageDir(), `${hash2}.json`));
if (indexedToken)
result[indexedKey] = indexedToken;
}
@@ -102212,7 +102476,7 @@ function listAllTokens() {
for (const entry of readdirSync9(dir, { withFileTypes: true })) {
if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
continue;
- const token = readTokenFile(join85(dir, entry.name));
+ const token = readTokenFile(join87(dir, entry.name));
const hash2 = basename14(entry.name, ".json");
if (token)
result[index[hash2] ?? hash2] = token;
@@ -102936,7 +103200,7 @@ async function boulder(options) {
}
// packages/omo-opencode/src/cli/codex-ulw-loop.ts
import { spawn as spawn5 } from "node:child_process";
-import { existsSync as existsSync65, readFileSync as readFileSync43, realpathSync as realpathSync9 } from "node:fs";
+import { existsSync as existsSync65, readFileSync as readFileSync44, realpathSync as realpathSync9 } from "node:fs";
import { homedir as homedir26 } from "node:os";
var ULW_LOOP_DELEGATION_SENTINEL = "OMO_ULW_LOOP_DELEGATED";
function resolveCodexUlwLoopCommand(input = {}) {
@@ -102986,7 +103250,7 @@ function resolveLegacyLocalOmoBin(env3, homeDir, currentExecutablePaths) {
}
function isGeneratedRuntimeWrapper(candidate) {
try {
- return readFileSync43(candidate, "utf8").includes(RUNTIME_WRAPPER_MARKER);
+ return readFileSync44(candidate, "utf8").includes(RUNTIME_WRAPPER_MARKER);
} catch (error51) {
if (error51 instanceof Error)
return false;
diff --git a/plugins/omo/dist/cli/index.js b/plugins/omo/dist/cli/index.js
index 878b4335..2bae45f3 100755
--- a/plugins/omo/dist/cli/index.js
+++ b/plugins/omo/dist/cli/index.js
@@ -2145,7 +2145,7 @@ var package_default;
var init_package = __esm(() => {
package_default = {
name: "oh-my-opencode",
- version: "4.16.2",
+ version: "4.16.3",
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
main: "./dist/index.js",
types: "dist/index.d.ts",
@@ -2355,18 +2355,18 @@ var init_package = __esm(() => {
typescript: "^6.0.3"
},
optionalDependencies: {
- "oh-my-opencode-darwin-arm64": "4.16.2",
- "oh-my-opencode-darwin-x64": "4.16.2",
- "oh-my-opencode-darwin-x64-baseline": "4.16.2",
- "oh-my-opencode-linux-arm64": "4.16.2",
- "oh-my-opencode-linux-arm64-musl": "4.16.2",
- "oh-my-opencode-linux-x64": "4.16.2",
- "oh-my-opencode-linux-x64-baseline": "4.16.2",
- "oh-my-opencode-linux-x64-musl": "4.16.2",
- "oh-my-opencode-linux-x64-musl-baseline": "4.16.2",
- "oh-my-opencode-windows-arm64": "4.16.2",
- "oh-my-opencode-windows-x64": "4.16.2",
- "oh-my-opencode-windows-x64-baseline": "4.16.2"
+ "oh-my-opencode-darwin-arm64": "4.16.3",
+ "oh-my-opencode-darwin-x64": "4.16.3",
+ "oh-my-opencode-darwin-x64-baseline": "4.16.3",
+ "oh-my-opencode-linux-arm64": "4.16.3",
+ "oh-my-opencode-linux-arm64-musl": "4.16.3",
+ "oh-my-opencode-linux-x64": "4.16.3",
+ "oh-my-opencode-linux-x64-baseline": "4.16.3",
+ "oh-my-opencode-linux-x64-musl": "4.16.3",
+ "oh-my-opencode-linux-x64-musl-baseline": "4.16.3",
+ "oh-my-opencode-windows-arm64": "4.16.3",
+ "oh-my-opencode-windows-x64": "4.16.3",
+ "oh-my-opencode-windows-x64-baseline": "4.16.3"
},
overrides: {
"@earendil-works/pi-agent-core": "0.80.3",
@@ -9219,6 +9219,11 @@ var init_agent_model_requirements = __esm(() => {
},
hephaestus: {
fallbackChain: [
+ {
+ providers: ["openai", "vercel"],
+ model: "gpt-5.6-sol",
+ variant: "medium"
+ },
{
providers: ["openai", "github-copilot", "opencode", "vercel"],
model: "gpt-5.5",
@@ -9245,7 +9250,7 @@ var init_agent_model_requirements = __esm(() => {
model: "claude-opus-4-7",
variant: "max"
},
- { providers: ["opencode-go", "vercel"], model: "glm-5.1" }
+ { providers: ["opencode-go", "vercel"], model: "glm-5.2" }
]
},
librarian: {
@@ -9292,7 +9297,7 @@ var init_agent_model_requirements = __esm(() => {
model: "gpt-5.5",
variant: "high"
},
- { providers: ["opencode-go", "vercel"], model: "glm-5.1" },
+ { providers: ["opencode-go", "vercel"], model: "glm-5.2" },
{
providers: ["google", "github-copilot", "opencode", "vercel"],
model: "gemini-3.1-pro"
@@ -9315,12 +9320,17 @@ var init_agent_model_requirements = __esm(() => {
model: "gpt-5.5",
variant: "high"
},
- { providers: ["opencode-go", "vercel"], model: "glm-5.1" },
+ { providers: ["opencode-go", "vercel"], model: "glm-5.2" },
{ providers: ["kimi-for-coding"], model: "k2p5" }
]
},
momus: {
fallbackChain: [
+ {
+ providers: ["openai", "vercel"],
+ model: "gpt-5.6-sol",
+ variant: "xhigh"
+ },
{
providers: ["openai", "github-copilot", "opencode", "vercel"],
model: "gpt-5.5",
@@ -9336,7 +9346,7 @@ var init_agent_model_requirements = __esm(() => {
model: "gemini-3.1-pro",
variant: "high"
},
- { providers: ["opencode-go", "vercel"], model: "glm-5.1" }
+ { providers: ["opencode-go", "vercel"], model: "glm-5.2" }
]
},
atlas: {
@@ -9388,12 +9398,17 @@ var init_category_model_requirements = __esm(() => {
model: "claude-opus-4-7",
variant: "max"
},
- { providers: ["opencode-go", "vercel"], model: "glm-5.1" },
+ { providers: ["opencode-go", "vercel"], model: "glm-5.2" },
{ providers: ["kimi-for-coding"], model: "k2p5" }
]
},
ultrabrain: {
fallbackChain: [
+ {
+ providers: ["openai", "vercel"],
+ model: "gpt-5.6-sol",
+ variant: "xhigh"
+ },
{
providers: ["openai", "opencode", "vercel"],
model: "gpt-5.5",
@@ -9409,11 +9424,16 @@ var init_category_model_requirements = __esm(() => {
model: "claude-opus-4-7",
variant: "max"
},
- { providers: ["opencode-go", "vercel"], model: "glm-5.1" }
+ { providers: ["opencode-go", "vercel"], model: "glm-5.2" }
]
},
deep: {
fallbackChain: [
+ {
+ providers: ["openai", "vercel"],
+ model: "gpt-5.6-sol",
+ variant: "high"
+ },
{
providers: ["openai", "github-copilot", "opencode", "vercel"],
model: "gpt-5.5",
@@ -9430,7 +9450,7 @@ var init_category_model_requirements = __esm(() => {
variant: "high"
},
{ providers: ["opencode-go", "vercel"], model: "kimi-k2.6" },
- { providers: ["opencode-go", "vercel"], model: "glm-5.1" }
+ { providers: ["opencode-go", "vercel"], model: "glm-5.2" }
]
},
artistry: {
@@ -9447,7 +9467,7 @@ var init_category_model_requirements = __esm(() => {
},
{ providers: ["openai", "github-copilot", "opencode", "vercel"], model: "gpt-5.5" },
{ providers: ["opencode-go", "vercel"], model: "kimi-k2.6" },
- { providers: ["opencode-go", "vercel"], model: "glm-5.1" }
+ { providers: ["opencode-go", "vercel"], model: "glm-5.2" }
]
},
quick: {
@@ -9505,7 +9525,7 @@ var init_category_model_requirements = __esm(() => {
},
{ providers: ["zai-coding-plan", "opencode", "bailian-coding-plan", "vercel"], model: "glm-5" },
{ providers: ["kimi-for-coding"], model: "k2p5" },
- { providers: ["opencode-go", "vercel"], model: "glm-5.1" },
+ { providers: ["opencode-go", "vercel"], model: "glm-5.2" },
{ providers: ["opencode", "bailian-coding-plan", "vercel"], model: "kimi-k2.5" },
{
providers: [
@@ -10043,6 +10063,22 @@ var init_supplemental_entries = __esm(() => {
output: 262144
}
},
+ "gpt-5.6-sol": {
+ id: "gpt-5.6-sol",
+ family: "gpt",
+ reasoning: true,
+ temperature: false,
+ toolCall: true,
+ modalities: {
+ input: ["text", "image", "pdf"],
+ output: ["text"]
+ },
+ limit: {
+ context: 1050000,
+ input: 922000,
+ output: 128000
+ }
+ },
"gpt-5.5": {
id: "gpt-5.5",
family: "gpt",
@@ -10867,11 +10903,15 @@ function isGpt5_5Model(model) {
const modelName = extractModelName(model).toLowerCase();
return modelName.includes("gpt-5.5") || modelName.includes("gpt-5-5");
}
+function isGpt5_6Model(model) {
+ const modelName = extractModelName(model).toLowerCase();
+ return modelName.includes("gpt-5.6") || modelName.includes("gpt-5-6");
+}
var init_types = () => {};
// packages/omo-opencode/src/tools/delegate-task/openai-categories.ts
function resolveDeepCategoryPromptAppend(model) {
- if (model && isGpt5_5Model(model)) {
+ if (model && (isGpt5_5Model(model) || isGpt5_6Model(model))) {
return DEEP_CATEGORY_PROMPT_APPEND_GPT_5_5;
}
return DEEP_CATEGORY_PROMPT_APPEND;
@@ -10990,13 +11030,13 @@ var init_openai_categories = __esm(() => {
OPENAI_CATEGORIES = [
{
name: "ultrabrain",
- config: { model: "openai/gpt-5.5", variant: "xhigh" },
+ config: { model: "openai/gpt-5.6-sol", variant: "xhigh" },
description: "Use ONLY for genuinely hard, logic-heavy tasks. Give clear goals only, not step-by-step instructions.",
promptAppend: ULTRABRAIN_CATEGORY_PROMPT_APPEND
},
{
name: "deep",
- config: { model: "openai/gpt-5.5", variant: "medium" },
+ config: { model: "openai/gpt-5.6-sol", variant: "high" },
description: "Goal-oriented autonomous problem-solving on hairy problems requiring deep research. ONE goal + ONE deliverable per call \u2014 multiple goals must fan out as parallel `deep` calls, never bundled into one.",
promptAppend: DEEP_CATEGORY_PROMPT_APPEND,
resolvePromptAppend: resolveDeepCategoryPromptAppend
@@ -64593,6 +64633,66 @@ async function probe(registration) {
return false;
}
}
+async function probeSessionAffinity(registration, sessionID) {
+ if (!registration.serverUrl) {
+ return;
+ }
+ const probeUrl = new URL(`/session/${sessionID}`, registration.serverUrl);
+ const authHeader = getServerBasicAuthHeader();
+ const headers = authHeader ? { Authorization: authHeader } : {};
+ try {
+ const controller = new AbortController;
+ const timeoutId = setTimeout(() => controller.abort(), PROBE_ABORT_MS);
+ let response;
+ try {
+ response = await getFetch()(probeUrl, { headers, signal: controller.signal });
+ } finally {
+ clearTimeout(timeoutId);
+ }
+ if (response.ok) {
+ setSessionAffinity(registration, sessionID, true);
+ return true;
+ }
+ if (response.status === 404) {
+ setSessionAffinity(registration, sessionID, false);
+ log2("[live-server-route] live listener does not own session; falling back to in-process client", { sessionID });
+ return false;
+ }
+ return;
+ } catch {
+ return;
+ }
+}
+function setSessionAffinity(registration, sessionID, owned) {
+ const now = Date.now();
+ for (const [key, entry] of registration.sessionAffinity) {
+ if (now - entry.timestamp >= AFFINITY_TTL_MS) {
+ registration.sessionAffinity.delete(key);
+ }
+ }
+ registration.sessionAffinity.set(sessionID, { owned, timestamp: now });
+}
+function getFreshSessionAffinity(registration, sessionID) {
+ const entry = registration.sessionAffinity.get(sessionID);
+ if (!entry || Date.now() - entry.timestamp >= AFFINITY_TTL_MS) {
+ return;
+ }
+ return entry.owned;
+}
+async function resolveSessionAffinity(registration, sessionID) {
+ const cached = getFreshSessionAffinity(registration, sessionID);
+ if (cached !== undefined) {
+ return cached;
+ }
+ let inFlight = registration.inFlightAffinity.get(sessionID);
+ if (!inFlight) {
+ inFlight = probeSessionAffinity(registration, sessionID).finally(() => {
+ registration.inFlightAffinity.delete(sessionID);
+ });
+ registration.inFlightAffinity.set(sessionID, inFlight);
+ }
+ return inFlight;
+}
function getFreshProbeAvailability(registration) {
const available = registration.available;
if (available === undefined || Date.now() - registration.probeTimestamp >= PROBE_TTL_MS) {
@@ -64645,6 +64745,13 @@ function tryResolveDispatchClientSync2(client3, sessionID) {
if (!freshAvailability) {
return { client: client3, route: "in-process", reason: "unavailable" };
}
+ const cachedAffinity = getFreshSessionAffinity(registration, sessionID);
+ if (cachedAffinity === undefined) {
+ return;
+ }
+ if (!cachedAffinity) {
+ return { client: client3, route: "in-process", reason: "affinity" };
+ }
const resolvedLiveClient = getOrBuildLiveClient(registration);
if (!resolvedLiveClient) {
return { client: client3, route: "in-process", reason: "unavailable" };
@@ -64664,6 +64771,10 @@ async function resolveDispatchClient2(client3, sessionID) {
if (!isAvailable) {
return { client: client3, route: "in-process", reason: "unavailable" };
}
+ const affinity = await resolveSessionAffinity(registration, sessionID);
+ if (affinity === false) {
+ return { client: client3, route: "in-process", reason: "affinity" };
+ }
const resolvedLiveClient = getOrBuildLiveClient(registration);
if (!resolvedLiveClient) {
return { client: client3, route: "in-process", reason: "unavailable" };
@@ -64701,10 +64812,11 @@ function markLiveRouteUnavailable2(reason) {
for (const registration of registrations.values()) {
registration.available = false;
registration.probeTimestamp = Date.now();
+ registration.sessionAffinity.clear();
}
log2(`[live-server-route] marked unavailable: ${reason}`);
}
-var PROBE_TTL_MS = 60000, PROBE_ABORT_MS = 1500, registrations, liveParentWakeRoutingDisabled = false, fetchImplementationForTesting;
+var PROBE_TTL_MS = 60000, PROBE_ABORT_MS = 1500, AFFINITY_TTL_MS = 60000, registrations, liveParentWakeRoutingDisabled = false, fetchImplementationForTesting;
var init_live_server_route = __esm(() => {
init_dist();
init_state();
@@ -66633,21 +66745,21 @@ var init_config_manager = __esm(() => {
});
// packages/telemetry-core/src/activity-state.ts
-import { existsSync as existsSync28, mkdirSync as mkdirSync8, readFileSync as readFileSync13 } from "fs";
-import { basename as basename10, join as join51 } from "path";
+import { existsSync as existsSync28, mkdirSync as mkdirSync8, readFileSync as readFileSync14 } from "fs";
+import { basename as basename10, join as join53 } from "path";
function resolveTelemetryStateDir(product, options = {}) {
const dataDir = resolveXdgDataDir(product.cacheDirName, {
env: options.env,
osProvider: options.osProvider
});
- const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined : join51(options.env.XDG_DATA_HOME, product.cacheDirName);
+ const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined : join53(options.env.XDG_DATA_HOME, product.cacheDirName);
if (dataDir === xdgStateDir || xdgStateDir === undefined && basename10(dataDir) === product.cacheDirName) {
return dataDir;
}
- return join51(dataDir, product.cacheDirName);
+ return join53(dataDir, product.cacheDirName);
}
function getTelemetryActivityStateFilePath(stateDir) {
- return join51(stateDir, POSTHOG_ACTIVITY_STATE_FILE);
+ return join53(stateDir, POSTHOG_ACTIVITY_STATE_FILE);
}
function getDailyActiveCaptureState(input) {
const state = readPostHogActivityState(input.stateDir, input.diagnostics);
@@ -66676,7 +66788,7 @@ function readPostHogActivityState(stateDir, diagnostics) {
return {};
}
try {
- const stateContent = readFileSync13(stateFilePath, "utf-8");
+ const stateContent = readFileSync14(stateFilePath, "utf-8");
const stateJson = JSON.parse(stateContent);
if (!isPostHogActivityState(stateJson)) {
return {};
@@ -66717,10 +66829,10 @@ var init_activity_state = __esm(() => {
var DEFAULT_POSTHOG_HOST = "https://us.i.posthog.com", DEFAULT_POSTHOG_API_KEY = "phc_CFJhj5HyvA62QPhvyaUCtaq23aUfznnijg5VaaGkNk74";
// packages/telemetry-core/src/diagnostics.ts
-import { appendFileSync as appendFileSync2, existsSync as existsSync29, mkdirSync as mkdirSync9, readFileSync as readFileSync14 } from "fs";
-import { join as join52 } from "path";
+import { appendFileSync as appendFileSync2, existsSync as existsSync29, mkdirSync as mkdirSync9, readFileSync as readFileSync15 } from "fs";
+import { join as join54 } from "path";
function getTelemetryDiagnosticsFilePath(diagnosticsDir) {
- return join52(diagnosticsDir, DIAGNOSTICS_FILE_NAME);
+ return join54(diagnosticsDir, DIAGNOSTICS_FILE_NAME);
}
function writeTelemetryDiagnostic(input, options) {
const now = options.now ?? new Date;
@@ -66743,7 +66855,7 @@ function cleanupTelemetryDiagnostics(options) {
}
try {
const cutoffMs = (options.now ?? new Date).getTime() - DIAGNOSTICS_RETENTION_MS;
- const retainedLines = trimToMaxBytes(readFileSync14(diagnosticsFilePath, "utf-8").split(`
+ const retainedLines = trimToMaxBytes(readFileSync15(diagnosticsFilePath, "utf-8").split(`
`).filter((line) => shouldRetainLine(line, cutoffMs)));
writeFileAtomically(diagnosticsFilePath, retainedLines.length === 0 ? "" : `${retainedLines.join(`
`)}
@@ -66795,7 +66907,7 @@ function shouldRetainLine(line, cutoffMs) {
function parseDiagnosticLine(line) {
try {
const parsed = JSON.parse(line);
- if (!isRecord4(parsed)) {
+ if (!isRecord5(parsed)) {
return null;
}
return parsed;
@@ -66806,7 +66918,7 @@ function parseDiagnosticLine(line) {
throw error;
}
}
-function isRecord4(value) {
+function isRecord5(value) {
return value !== null && typeof value === "object" && !Array.isArray(value);
}
function trimToMaxBytes(lines) {
@@ -66886,7 +66998,7 @@ function getTelemetryDistinctId(machineIdPrefix, osProvider = getDefaultTelemetr
var init_machine_id = () => {};
// node_modules/.bun/[email protected]/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
-import { dirname as dirname17, posix as posix2, sep as sep7 } from "path";
+import { dirname as dirname18, posix as posix2, sep as sep7 } from "path";
function createModulerModifier() {
const getModuleFromFileName = createGetModuleFromFilename();
return async (frames) => {
@@ -66895,7 +67007,7 @@ function createModulerModifier() {
return frames;
};
}
-function createGetModuleFromFilename(basePath = process.argv[1] ? dirname17(process.argv[1]) : process.cwd(), isWindows = sep7 === "\\") {
+function createGetModuleFromFilename(basePath = process.argv[1] ? dirname18(process.argv[1]) : process.cwd(), isWindows = sep7 === "\\") {
const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;
return (filename) => {
if (!filename)
@@ -69916,7 +70028,7 @@ var init_context_lines_node = __esm(() => {
});
// node_modules/.bun/[email protected]/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/relative-path.node.mjs
-import { isAbsolute as isAbsolute8, relative as relative5, sep as sep8 } from "path";
+import { isAbsolute as isAbsolute9, relative as relative5, sep as sep8 } from "path";
function createRelativePathModifier(basePath = process.cwd()) {
const isWindows = sep8 === "\\";
const toUnix = (p) => isWindows ? p.replace(/\\/g, "/") : p;
@@ -69924,7 +70036,7 @@ function createRelativePathModifier(basePath = process.cwd()) {
return async (frames) => {
for (const frame of frames)
if (!(!frame.filename || frame.filename.startsWith("node:") || frame.filename.startsWith("data:"))) {
- if (isAbsolute8(frame.filename))
+ if (isAbsolute9(frame.filename))
frame.filename = toUnix(relative5(normalizedBase, toUnix(frame.filename)));
}
return frames;
@@ -72441,7 +72553,7 @@ var package_default2;
var init_package2 = __esm(() => {
package_default2 = {
name: "@oh-my-opencode/omo-codex",
- version: "4.16.2",
+ version: "4.16.3",
type: "module",
private: true,
description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
@@ -73411,19 +73523,19 @@ var init_update_toasts = __esm(() => {
// packages/omo-opencode/src/hooks/auto-update-checker/hook/background-update-check.ts
import { existsSync as existsSync49 } from "fs";
-import { dirname as dirname27, join as join70 } from "path";
+import { dirname as dirname28, join as join72 } from "path";
import { fileURLToPath as fileURLToPath5 } from "url";
function defaultGetModuleHostingWorkspace() {
try {
- const currentDir = dirname27(fileURLToPath5(import.meta.url));
+ const currentDir = dirname28(fileURLToPath5(import.meta.url));
const pkgJsonPath = findPackageJsonUp(currentDir);
if (!pkgJsonPath)
return null;
- const pkgDir = dirname27(pkgJsonPath);
- const nodeModulesDir = dirname27(pkgDir);
+ const pkgDir = dirname28(pkgJsonPath);
+ const nodeModulesDir = dirname28(pkgDir);
if (nodeModulesDir.split(/[\\/]/).pop() !== "node_modules")
return null;
- return dirname27(nodeModulesDir);
+ return dirname28(nodeModulesDir);
} catch (error51) {
if (error51 instanceof Error) {
return null;
@@ -73565,7 +73677,7 @@ var init_background_update_check = __esm(() => {
init_update_toasts();
defaultDeps4 = {
existsSync: existsSync49,
- join: join70,
+ join: join72,
runBunInstallWithDetails,
log: log2,
getOpenCodeCacheDir,
@@ -74174,7 +74286,7 @@ function getUnsupportedOpenCodeVersionMessage(openCodeVersion) {
}
// packages/omo-codex/src/install/install-codex.ts
-import { join as join53, resolve as resolve15 } from "path";
+import { join as join55, resolve as resolve15 } from "path";
import { existsSync as existsSync30 } from "fs";
import { homedir as homedir6 } from "os";
@@ -75464,7 +75576,7 @@ async function shouldBuildSourcePackages(repoRoot) {
// packages/omo-codex/src/install/codex-config-toml.ts
import { mkdir as mkdir5, readFile as readFile11 } from "fs/promises";
-import { dirname as dirname15 } from "path";
+import { dirname as dirname16 } from "path";
// packages/omo-codex/src/install/toml-section-editor.ts
function findTomlSection(config, header) {
@@ -76301,30 +76413,87 @@ function isRootSetting2(line, key) {
}
// packages/omo-codex/src/install/codex-multi-agent-v2-config.ts
+import { readFileSync as readFileSync13 } from "fs";
+import { dirname as dirname15, isAbsolute as isAbsolute8, join as join39 } from "path";
var CODEX_AGENTS_HEADER = "agents";
var CODEX_MULTI_AGENT_V2_HEADER = "features.multi_agent_v2";
var CODEX_SUBAGENT_THREAD_LIMIT = 1000;
-function ensureCodexMultiAgentV2Config(config) {
+function ensureCodexMultiAgentV2Config(config, options = {}) {
const featureFlag = removeFeatureFlagSetting(config, "multi_agent_v2");
- const agentsConfig = ensureAgentsMaxThreads(featureFlag.config);
- const section = findTomlSection(agentsConfig, CODEX_MULTI_AGENT_V2_HEADER);
+ const v2Preferred = options.multiAgentVersion === "v2";
+ const modelKnown = options.multiAgentVersion != null || readRootModel(featureFlag.config) !== null;
+ const agentsConfig = v2Preferred ? removeAgentsMaxThreads(featureFlag.config) : modelKnown ? ensureAgentsMaxThreads(featureFlag.config) : raiseExistingAgentsMaxThreads(featureFlag.config);
const maxThreadsValue = CODEX_SUBAGENT_THREAD_LIMIT.toString();
+ const preserveDisable = featureFlag.value === false && !v2Preferred;
+ const featureConfig = preserveDisable ? setMultiAgentV2Disable(agentsConfig) : v2Preferred ? removeMultiAgentV2Disable(agentsConfig) : agentsConfig;
+ const section = findTomlSection(featureConfig, CODEX_MULTI_AGENT_V2_HEADER);
if (!section) {
- const enabledSetting = featureFlag.value === false ? `enabled = false
+ const enabledSetting = preserveDisable ? `enabled = false
` : "";
- return appendBlock(agentsConfig, `[${CODEX_MULTI_AGENT_V2_HEADER}]
+ return appendBlock(featureConfig, `[${CODEX_MULTI_AGENT_V2_HEADER}]
${enabledSetting}max_concurrent_threads_per_session = ${maxThreadsValue}
`);
}
- const withPreservedDisable = featureFlag.value === false ? replaceOrInsertSetting(agentsConfig, section, "enabled", "false") : agentsConfig;
- const updatedSection = featureFlag.value === false ? findTomlSection(withPreservedDisable, CODEX_MULTI_AGENT_V2_HEADER) : section;
- if (!updatedSection) {
- return appendBlock(withPreservedDisable, `[${CODEX_MULTI_AGENT_V2_HEADER}]
-enabled = false
-max_concurrent_threads_per_session = ${maxThreadsValue}
-`);
+ return replaceOrInsertSetting(featureConfig, section, "max_concurrent_threads_per_session", maxThreadsValue);
+}
+function resolveCodexMultiAgentVersion(config, configPath) {
+ const model = readRootModel(config);
+ if (model === null)
+ return null;
+ const catalogPath = resolveCatalogPath(readRootModelCatalogPath(config), configPath);
+ const catalogVersion = readCatalogMultiAgentVersion(model, catalogPath);
+ if (catalogVersion !== null)
+ return catalogVersion;
+ return /^gpt-5\.6\b/i.test(model) ? "v2" : null;
+}
+function resolveCatalogPath(configuredPath, configPath) {
+ if (configuredPath === null)
+ return join39(dirname15(configPath), "models_cache.json");
+ return isAbsolute8(configuredPath) ? configuredPath : join39(dirname15(configPath), configuredPath);
+}
+function readCatalogMultiAgentVersion(model, cachePath) {
+ let raw;
+ try {
+ raw = readFileSync13(cachePath, "utf8");
+ } catch {
+ return null;
+ }
+ let cache;
+ try {
+ cache = JSON.parse(raw);
+ } catch {
+ return null;
+ }
+ if (!isRecord4(cache) || !Array.isArray(cache.models))
+ return null;
+ for (const entry of cache.models) {
+ if (!isRecord4(entry))
+ continue;
+ if (entry.slug !== model && entry.id !== model)
+ continue;
+ const version = entry.multi_agent_version;
+ if (version === "v1" || version === "v2")
+ return version;
+ return null;
}
- return replaceOrInsertSetting(withPreservedDisable, updatedSection, "max_concurrent_threads_per_session", maxThreadsValue);
+ return null;
+}
+function readRootModel(config) {
+ const double = config.match(/^\s*model\s*=\s*"([^"]+)"/m);
+ if (double !== null)
+ return double[1] ?? null;
+ const single = config.match(/^\s*model\s*=\s*'([^']+)'/m);
+ return single?.[1] ?? null;
+}
+function readRootModelCatalogPath(config) {
+ const double = config.match(/^\s*model_catalog_json\s*=\s*"([^"]+)"/m);
+ if (double !== null)
+ return double[1] ?? null;
+ const single = config.match(/^\s*model_catalog_json\s*=\s*'([^']+)'/m);
+ return single?.[1] ?? null;
+}
+function isRecord4(value) {
+ return typeof value === "object" && value !== null && !Array.isArray(value);
}
function removeFeatureFlagSetting(config, featureName) {
const section = findTomlSection(config, "features");
@@ -76345,6 +76514,36 @@ max_threads = ${maxThreadsValue}
}
return replaceOrInsertSetting(config, section, "max_threads", maxThreadsValue);
}
+function removeAgentsMaxThreads(config) {
+ const section = findTomlSection(config, CODEX_AGENTS_HEADER);
+ if (!section)
+ return config;
+ if (!/^\s*max_threads\s*=/m.test(section.text))
+ return config;
+ return removeSetting(config, section, "max_threads");
+}
+function removeMultiAgentV2Disable(config) {
+ const section = findTomlSection(config, CODEX_MULTI_AGENT_V2_HEADER);
+ if (!section)
+ return config;
+ if (!/^\s*enabled\s*=\s*false(?:\s*#.*)?$/m.test(section.text))
+ return config;
+ return removeSetting(config, section, "enabled");
+}
+function setMultiAgentV2Disable(config) {
+ const section = findTomlSection(config, CODEX_MULTI_AGENT_V2_HEADER);
+ if (!section)
+ return config;
+ return replaceOrInsertSetting(config, section, "enabled", "false");
+}
+function raiseExistingAgentsMaxThreads(config) {
+ const section = findTomlSection(config, CODEX_AGENTS_HEADER);
+ if (!section)
+ return config;
+ if (!/^\s*max_threads\s*=/m.test(section.text))
+ return config;
+ return replaceOrInsertSetting(config, section, "max_threads", CODEX_SUBAGENT_THREAD_LIMIT.toString());
+}
function readBooleanSetting(sectionText, key) {
const match = new RegExp(`^\\s*${escapeRegExp(key)}\\s*=\\s*(true|false)\\s*(?:#.*)?$`, "m").exec(sectionText);
if (!match)
@@ -76354,7 +76553,7 @@ function readBooleanSetting(sectionText, key) {
// packages/omo-codex/src/install/codex-config-toml.ts
async function updateCodexConfig(input) {
- await mkdir5(dirname15(input.configPath), { recursive: true });
+ await mkdir5(dirname16(input.configPath), { recursive: true });
let config;
try {
config = await readFile11(input.configPath, "utf8");
@@ -76377,7 +76576,9 @@ async function updateCodexConfig(input) {
config = ensureFeatureEnabled(config, "multi_agent");
config = removeUnsupportedCodexMultiAgentModeConfig(config);
config = ensureCodexReasoningConfig(config, await readCodexModelCatalog(input.repoRoot));
- config = ensureCodexMultiAgentV2Config(config);
+ config = ensureCodexMultiAgentV2Config(config, {
+ multiAgentVersion: resolveCodexMultiAgentVersion(config, input.configPath)
+ });
if (input.autonomousPermissions === true)
config = ensureAutonomousPermissions(config);
if (!(input.preserveMarketplaceSource === true && hasMarketplaceBlock(config, input.marketplaceName))) {
@@ -76403,7 +76604,7 @@ function isMissingFileError(error) {
// packages/omo-codex/src/install/codex-hook-trust.ts
import { createHash as createHash2 } from "crypto";
import { readFile as readFile12 } from "fs/promises";
-import { join as join39 } from "path";
+import { join as join40 } from "path";
var EVENT_LABELS = new Map([
["PreToolUse", "pre_tool_use"],
["PermissionRequest", "permission_request"],
@@ -76417,7 +76618,7 @@ var EVENT_LABELS = new Map([
["Stop", "stop"]
]);
async function trustedHookStatesForPlugin(input) {
- const manifestPath = join39(input.pluginRoot, ".codex-plugin", "plugin.json");
+ const manifestPath = join40(input.pluginRoot, ".codex-plugin", "plugin.json");
if (!await exists(manifestPath))
return [];
const manifest = JSON.parse(await readFile12(manifestPath, "utf8"));
@@ -76425,7 +76626,7 @@ async function trustedHookStatesForPlugin(input) {
return [];
const states = [];
for (const hookPath of hookManifestPaths2(manifest.hooks)) {
- const hooksPath = join39(input.pluginRoot, hookPath);
+ const hooksPath = join40(input.pluginRoot, hookPath);
if (!await exists(hooksPath))
continue;
const parsed = JSON.parse(await readFile12(hooksPath, "utf8"));
@@ -76551,207 +76752,125 @@ function toCodexResolution(resolution) {
}
// packages/omo-codex/src/install/link-cached-plugin-agents.ts
-import { copyFile, lstat as lstat8, mkdir as mkdir6, readFile as readFile14, readdir as readdir6, rm as rm8, writeFile as writeFile6 } from "fs/promises";
-import { basename as basename9, join as join41 } from "path";
+import { copyFile, lstat as lstat9, mkdir as mkdir6, readdir as readdir7, rm as rm8, writeFile as writeFile7 } from "fs/promises";
+import { basename as basename9, join as join43 } from "path";
-// packages/omo-codex/src/install/retired-managed-agent-purge.ts
-import { lstat as lstat7, readFile as readFile13, rm as rm7 } from "fs/promises";
-import { join as join40 } from "path";
-var RETIRED_MANAGED_AGENT_FILES = [
- {
- fileName: "codex-ultrawork-reviewer.toml",
- requiredMarkers: [
- 'name = "codex-ultrawork-reviewer"',
- 'description = "Strict ultrawork verification reviewer.',
- 'developer_instructions = """You are the ultrawork verification reviewer.'
- ]
- }
-];
-async function purgeRetiredManagedAgentFiles(input) {
- const agentsDir = join40(input.codexHome, "agents");
- if (!await exists2(agentsDir))
- return;
- for (const retiredAgent of RETIRED_MANAGED_AGENT_FILES) {
- const agentPath = join40(agentsDir, retiredAgent.fileName);
- if (!await exists2(agentPath))
- continue;
- const agentStat = await lstat7(agentPath);
- if (agentStat.isDirectory() && !agentStat.isSymbolicLink())
- continue;
- const content = await readTextIfExists(agentPath);
- if (content === null || !hasRequiredMarkers(content, retiredAgent.requiredMarkers))
- continue;
- await rm7(agentPath, { force: true });
- }
-}
-function hasRequiredMarkers(content, markers) {
- return markers.every((marker) => content.includes(marker));
-}
-async function readTextIfExists(path7) {
- try {
- return await readFile13(path7, "utf8");
- } catch (error) {
- if (nodeErrorCode(error) === "ENOENT")
- return null;
- throw error;
- }
-}
-async function exists2(path7) {
- try {
- await lstat7(path7);
- return true;
- } catch (error) {
- if (nodeErrorCode(error) !== "ENOENT")
- throw error;
- return false;
+// packages/omo-codex/src/install/preserved-agent-settings.ts
+import { lstat as lstat7, readFile as readFile13, readdir as readdir6, writeFile as writeFile6 } from "fs/promises";
+import { join as join41 } from "path";
+
+// packages/omo-codex/src/install/managed-agent-reasoning-defaults.ts
+var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
+ [
+ "explorer",
+ {
+ previous: { model: "gpt-5.4-mini", effort: "low" },
+ current: { model: "gpt-5.6-terra", effort: "medium" }
+ }
+ ],
+ [
+ "librarian",
+ {
+ previous: { model: "gpt-5.4-mini", effort: "low" },
+ current: { model: "gpt-5.6-terra", effort: "medium" }
+ }
+ ],
+ [
+ "momus",
+ {
+ previous: { model: "gpt-5.5", effort: "xhigh" },
+ current: { model: "gpt-5.6-sol", effort: "ultra" }
+ }
+ ]
+]);
+function resolveManagedAgentReasoning(input) {
+ const upgrade = MANAGED_REASONING_DEFAULT_UPGRADES.get(input.agentName);
+ if (upgrade !== undefined && input.preserved.model === upgrade.previous.model && input.preserved.effort === upgrade.previous.effort && input.bundledModel === upgrade.current.model && input.bundledEffort === upgrade.current.effort) {
+ return upgrade.current.effort;
}
-}
-function nodeErrorCode(error) {
- if (!(error instanceof Error) || !("code" in error))
- return null;
- return typeof error.code === "string" ? error.code : null;
+ return input.preserved.effort;
}
-// packages/omo-codex/src/install/link-cached-plugin-agents.ts
-var MANIFEST_FILE = ".installed-agents.json";
+// packages/omo-codex/src/install/preserved-agent-settings.ts
async function capturePreservedAgentReasoning(input) {
const agentsDir = join41(input.codexHome, "agents");
- if (!await exists3(agentsDir))
+ if (!await exists2(agentsDir))
return new Map;
const preserved = new Map;
const agentEntries = await readdir6(agentsDir, { withFileTypes: true });
for (const entry of agentEntries) {
if (!entry.name.endsWith(".toml"))
continue;
- const content = await readTextIfExists2(join41(agentsDir, entry.name));
+ const content = await readTextIfExists(join41(agentsDir, entry.name));
if (content === null)
continue;
const effort = extractReasoningEffort(content);
- if (effort !== null)
- preserved.set(agentNameFromToml(entry.name), effort);
+ if (effort !== null) {
+ preserved.set(agentNameFromToml(entry.name), {
+ model: extractModel(content),
+ effort
+ });
+ }
}
return preserved;
}
async function capturePreservedAgentServiceTier(input) {
const agentsDir = join41(input.codexHome, "agents");
- if (!await exists3(agentsDir))
+ if (!await exists2(agentsDir))
return new Map;
const preserved = new Map;
const agentEntries = await readdir6(agentsDir, { withFileTypes: true });
for (const entry of agentEntries) {
if (!entry.name.endsWith(".toml"))
continue;
- const content = await readTextIfExists2(join41(agentsDir, entry.name));
+ const content = await readTextIfExists(join41(agentsDir, entry.name));
if (content === null)
continue;
preserved.set(agentNameFromToml(entry.name), extractServiceTier(content));
}
return preserved;
}
-async function linkCachedPluginAgents(input) {
- const bundledAgents = await discoverBundledAgents(input.pluginRoot);
- await purgeRetiredManagedAgentFiles({ codexHome: input.codexHome });
- if (bundledAgents.length === 0) {
- await writeManifest(input.pluginRoot, []);
- return [];
- }
- const agentsDir = join41(input.codexHome, "agents");
- await mkdir6(agentsDir, { recursive: true });
- const linked = [];
- for (const agentPath of bundledAgents) {
- const agentFileName = basename9(agentPath);
- const agentName = agentNameFromToml(agentFileName);
- const linkPath = join41(agentsDir, agentFileName);
- await replaceWithCopy(linkPath, agentPath);
- await restorePreservedReasoning({
- agentName,
- linkPath,
- target: agentPath,
- value: input.preservedReasoning?.get(agentName)
- });
- await restorePreservedServiceTier({
- linkPath,
- preserved: input.preservedServiceTier?.has(agentName) ?? false,
- value: input.preservedServiceTier?.get(agentName) ?? null
- });
- linked.push({ name: agentFileName, path: linkPath, target: agentPath });
- }
- await writeManifest(input.pluginRoot, linked.map((entry) => entry.path));
- return linked;
-}
-async function restorePreservedServiceTier(input) {
- if (!input.preserved)
+async function restorePreservedReasoning(input) {
+ if (input.value === undefined)
return;
- const content = await readFile14(input.linkPath, "utf8");
- if (extractServiceTier(content) === input.value)
+ const content = await readFile13(input.target, "utf8");
+ const bundledEffort = extractReasoningEffort(content);
+ const effort = resolveManagedAgentReasoning({
+ agentName: input.agentName,
+ bundledModel: extractModel(content),
+ bundledEffort,
+ preserved: input.value
+ });
+ if (bundledEffort === effort)
return;
- const replacement = replaceServiceTier(content, input.value);
+ const replacement = replaceTopLevelStringSetting(content, "model_reasoning_effort", effort, { insertIfMissing: false });
if (!replacement.replaced)
return;
await writeFile6(input.linkPath, replacement.content);
}
-async function discoverBundledAgents(pluginRoot) {
- const componentsRoot = join41(pluginRoot, "components");
- if (!await exists3(componentsRoot))
- return [];
- const componentEntries = await readdir6(componentsRoot, { withFileTypes: true });
- const agents = [];
- for (const entry of componentEntries) {
- if (!entry.isDirectory())
- continue;
- const agentsRoot = join41(componentsRoot, entry.name, "agents");
- if (!await exists3(agentsRoot))
- continue;
- const agentEntries = await readdir6(agentsRoot, { withFileTypes: true });
- for (const file2 of agentEntries) {
- if (!file2.isFile() || !file2.name.endsWith(".toml"))
- continue;
- agents.push(join41(agentsRoot, file2.name));
- }
- }
- agents.sort();
- return agents;
-}
-async function replaceWithCopy(linkPath, target) {
- await prepareReplacement(linkPath);
- await copyFile(target, linkPath);
-}
-async function prepareReplacement(linkPath) {
- if (!await exists3(linkPath))
- return;
- const entryStat = await lstat8(linkPath);
- if (entryStat.isDirectory() && !entryStat.isSymbolicLink()) {
- throw new Error(`${linkPath} already exists and is a directory; refusing to replace`);
- }
- await rm8(linkPath, { force: true });
-}
-async function writeManifest(pluginRoot, agentPaths) {
- const manifestPath = join41(pluginRoot, MANIFEST_FILE);
- const payload = { agents: [...agentPaths].sort() };
- await writeFile6(manifestPath, `${JSON.stringify(payload, null, "\t")}
-`);
-}
-async function restorePreservedReasoning(input) {
- if (input.value === undefined)
+async function restorePreservedServiceTier(input) {
+ if (!input.preserved)
return;
- const content = await readFile14(input.target, "utf8");
- const bundledEffort = extractReasoningEffort(content);
- if (bundledEffort === input.value)
+ const content = await readFile13(input.linkPath, "utf8");
+ if (extractServiceTier(content) === input.value)
return;
- const replacement = replaceReasoningEffort(content, input.value);
+ const replacement = replaceTopLevelStringSetting(content, "service_tier", input.value, { insertIfMissing: true });
if (!replacement.replaced)
return;
await writeFile6(input.linkPath, replacement.content);
}
-async function readTextIfExists2(path7) {
+async function readTextIfExists(path7) {
try {
- return await readFile14(path7, "utf8");
+ return await readFile13(path7, "utf8");
} catch (error) {
- if (nodeErrorCode2(error) === "ENOENT")
+ if (nodeErrorCode(error) === "ENOENT")
return null;
throw error;
}
}
+function extractModel(content) {
+ return extractTopLevelStringSetting(content, "model");
+}
function extractReasoningEffort(content) {
return extractTopLevelStringSetting(content, "model_reasoning_effort");
}
@@ -76771,12 +76890,6 @@ function extractTopLevelStringSetting(content, key) {
}
return null;
}
-function replaceReasoningEffort(content, value) {
- return replaceTopLevelStringSetting(content, "model_reasoning_effort", value, { insertIfMissing: false });
-}
-function replaceServiceTier(content, value) {
- return replaceTopLevelStringSetting(content, "service_tier", value, { insertIfMissing: true });
-}
function replaceTopLevelStringSetting(content, key, value, options) {
const lines = content.split(/\n/);
for (let index = 0;index < lines.length; index += 1) {
@@ -76836,6 +76949,64 @@ function parseJsonString(value) {
return null;
}
}
+async function exists2(path7) {
+ try {
+ await lstat7(path7);
+ return true;
+ } catch (error) {
+ if (nodeErrorCode(error) !== "ENOENT")
+ throw error;
+ return false;
+ }
+}
+function nodeErrorCode(error) {
+ if (!(error instanceof Error) || !("code" in error))
+ return null;
+ return typeof error.code === "string" ? error.code : null;
+}
+
+// packages/omo-codex/src/install/retired-managed-agent-purge.ts
+import { lstat as lstat8, readFile as readFile14, rm as rm7 } from "fs/promises";
+import { join as join42 } from "path";
+var RETIRED_MANAGED_AGENT_FILES = [
+ {
+ fileName: "codex-ultrawork-reviewer.toml",
+ requiredMarkers: [
+ 'name = "codex-ultrawork-reviewer"',
+ 'description = "Strict ultrawork verification reviewer.',
+ 'developer_instructions = """You are the ultrawork verification reviewer.'
+ ]
+ }
+];
+async function purgeRetiredManagedAgentFiles(input) {
+ const agentsDir = join42(input.codexHome, "agents");
+ if (!await exists3(agentsDir))
+ return;
+ for (const retiredAgent of RETIRED_MANAGED_AGENT_FILES) {
+ const agentPath = join42(agentsDir, retiredAgent.fileName);
+ if (!await exists3(agentPath))
+ continue;
+ const agentStat = await lstat8(agentPath);
+ if (agentStat.isDirectory() && !agentStat.isSymbolicLink())
+ continue;
+ const content = await readTextIfExists2(agentPath);
+ if (content === null || !hasRequiredMarkers(content, retiredAgent.requiredMarkers))
+ continue;
+ await rm7(agentPath, { force: true });
+ }
+}
+function hasRequiredMarkers(content, markers) {
+ return markers.every((marker) => content.includes(marker));
+}
+async function readTextIfExists2(path7) {
+ try {
+ return await readFile14(path7, "utf8");
+ } catch (error) {
+ if (nodeErrorCode2(error) === "ENOENT")
+ return null;
+ throw error;
+ }
+}
async function exists3(path7) {
try {
await lstat8(path7);
@@ -76852,12 +77023,105 @@ function nodeErrorCode2(error) {
return typeof error.code === "string" ? error.code : null;
}
+// packages/omo-codex/src/install/link-cached-plugin-agents.ts
+var MANIFEST_FILE = ".installed-agents.json";
+async function linkCachedPluginAgents(input) {
+ const bundledAgents = await discoverBundledAgents(input.pluginRoot);
+ await purgeRetiredManagedAgentFiles({ codexHome: input.codexHome });
+ if (bundledAgents.length === 0) {
+ await writeManifest(input.pluginRoot, []);
+ return [];
+ }
+ const agentsDir = join43(input.codexHome, "agents");
+ await mkdir6(agentsDir, { recursive: true });
+ const linked = [];
+ for (const agentPath of bundledAgents) {
+ const agentFileName = basename9(agentPath);
+ const agentName = agentNameFromToml2(agentFileName);
+ const linkPath = join43(agentsDir, agentFileName);
+ await replaceWithCopy(linkPath, agentPath);
+ await restorePreservedReasoning({
+ agentName,
+ linkPath,
+ target: agentPath,
+ value: input.preservedReasoning?.get(agentName)
+ });
+ await restorePreservedServiceTier({
+ linkPath,
+ preserved: input.preservedServiceTier?.has(agentName) ?? false,
+ value: input.preservedServiceTier?.get(agentName) ?? null
+ });
+ linked.push({ name: agentFileName, path: linkPath, target: agentPath });
+ }
+ await writeManifest(input.pluginRoot, linked.map((entry) => entry.path));
+ return linked;
+}
+async function discoverBundledAgents(pluginRoot) {
+ const componentsRoot = join43(pluginRoot, "components");
+ if (!await exists4(componentsRoot))
+ return [];
+ const componentEntries = await readdir7(componentsRoot, { withFileTypes: true });
+ const agents = [];
+ for (const entry of componentEntries) {
+ if (!entry.isDirectory())
+ continue;
+ const agentsRoot = join43(componentsRoot, entry.name, "agents");
+ if (!await exists4(agentsRoot))
+ continue;
+ const agentEntries = await readdir7(agentsRoot, { withFileTypes: true });
+ for (const file2 of agentEntries) {
+ if (!file2.isFile() || !file2.name.endsWith(".toml"))
+ continue;
+ agents.push(join43(agentsRoot, file2.name));
+ }
+ }
+ agents.sort();
+ return agents;
+}
+async function replaceWithCopy(linkPath, target) {
+ await prepareReplacement(linkPath);
+ await copyFile(target, linkPath);
+}
+async function prepareReplacement(linkPath) {
+ if (!await exists4(linkPath))
+ return;
+ const entryStat = await lstat9(linkPath);
+ if (entryStat.isDirectory() && !entryStat.isSymbolicLink()) {
+ throw new Error(`${linkPath} already exists and is a directory; refusing to replace`);
+ }
+ await rm8(linkPath, { force: true });
+}
+async function writeManifest(pluginRoot, agentPaths) {
+ const manifestPath = join43(pluginRoot, MANIFEST_FILE);
+ const payload = { agents: [...agentPaths].sort() };
+ await writeFile7(manifestPath, `${JSON.stringify(payload, null, "\t")}
+`);
+}
+function agentNameFromToml2(fileName) {
+ return fileName.endsWith(".toml") ? fileName.slice(0, -".toml".length) : fileName;
+}
+async function exists4(path7) {
+ try {
+ await lstat9(path7);
+ return true;
+ } catch (error) {
+ if (nodeErrorCode3(error) !== "ENOENT")
+ throw error;
+ return false;
+ }
+}
+function nodeErrorCode3(error) {
+ if (!(error instanceof Error) || !("code" in error))
+ return null;
+ return typeof error.code === "string" ? error.code : null;
+}
+
// packages/omo-codex/src/install/codex-marketplace.ts
import { readFile as readFile15 } from "fs/promises";
-import { join as join42 } from "path";
+import { join as join44 } from "path";
var DEFAULT_MARKETPLACE_PATH = "packages/omo-codex/marketplace.json";
async function readMarketplace(repoRoot, options) {
- const marketplacePath = options?.marketplacePath ?? join42(repoRoot, DEFAULT_MARKETPLACE_PATH);
+ const marketplacePath = options?.marketplacePath ?? join44(repoRoot, DEFAULT_MARKETPLACE_PATH);
const raw = await readFile15(marketplacePath, "utf8");
const parsed = JSON.parse(raw);
if (!isPlainRecord3(parsed))
@@ -76876,10 +77140,10 @@ async function readMarketplace(repoRoot, options) {
function resolvePluginSource(repoRoot, plugin, options) {
const sourcePath = localSourcePath(options?.pathOverride ?? plugin.source);
const relativePath = sourcePath.slice(2);
- return join42(repoRoot, ...relativePath.split(/[\\/]/));
+ return join44(repoRoot, ...relativePath.split(/[\\/]/));
}
async function readPluginManifest(pluginRoot) {
- const raw = await readFile15(join42(pluginRoot, ".codex-plugin", "plugin.json"), "utf8");
+ const raw = await readFile15(join44(pluginRoot, ".codex-plugin", "plugin.json"), "utf8");
const parsed = JSON.parse(raw);
if (!isPlainRecord3(parsed))
throw new Error(`${pluginRoot} plugin.json must be an object`);
@@ -76960,8 +77224,8 @@ function validateLocalSourcePath(path7) {
}
// packages/omo-codex/src/install/codex-marketplace-snapshot.ts
-import { cp as cp3, mkdir as mkdir7, rename as rename4, rm as rm9, writeFile as writeFile7 } from "fs/promises";
-import { join as join43, sep as sep6 } from "path";
+import { cp as cp3, mkdir as mkdir7, rename as rename4, rm as rm9, writeFile as writeFile8 } from "fs/promises";
+import { join as join45, sep as sep6 } from "path";
var INSTALLED_MARKETPLACES_DIR = ".tmp/marketplaces";
async function writeInstalledMarketplaceSnapshot(input) {
const marketplaceRoot = installedMarketplaceRoot(input.codexHome, input.marketplace.name);
@@ -76974,21 +77238,21 @@ async function writeInstalledMarketplaceSnapshot(input) {
return snapshotPlugins;
}
function installedMarketplaceRoot(codexHome, marketplaceName) {
- return join43(codexHome, INSTALLED_MARKETPLACES_DIR, marketplaceName);
+ return join45(codexHome, INSTALLED_MARKETPLACES_DIR, marketplaceName);
}
async function writeMarketplaceManifest(marketplaceRoot, marketplace) {
- const manifestDir = join43(marketplaceRoot, ".agents", "plugins");
+ const manifestDir = join45(marketplaceRoot, ".agents", "plugins");
await mkdir7(manifestDir, { recursive: true });
- const tempPath = join43(manifestDir, `.marketplace-${process.pid}-${Date.now()}.json.tmp`);
- await writeFile7(tempPath, `${JSON.stringify(marketplace, null, "\t")}
+ const tempPath = join45(manifestDir, `.marketplace-${process.pid}-${Date.now()}.json.tmp`);
+ await writeFile8(tempPath, `${JSON.stringify(marketplace, null, "\t")}
`);
- await rename4(tempPath, join43(manifestDir, "marketplace.json"));
+ await rename4(tempPath, join45(manifestDir, "marketplace.json"));
}
async function writeSnapshotPlugin(marketplaceRoot, plugin) {
- const pluginsDir = join43(marketplaceRoot, "plugins");
+ const pluginsDir = join45(marketplaceRoot, "plugins");
await mkdir7(pluginsDir, { recursive: true });
- const targetPath = join43(pluginsDir, plugin.name);
- const tempPath = join43(pluginsDir, `.tmp-${plugin.name}-${process.pid}-${Date.now()}`);
+ const targetPath = join45(pluginsDir, plugin.name);
+ const tempPath = join45(pluginsDir, `.tmp-${plugin.name}-${process.pid}-${Date.now()}`);
await rm9(tempPath, { recursive: true, force: true });
await cp3(plugin.sourcePath, tempPath, {
recursive: true,
@@ -77009,11 +77273,11 @@ function shouldCopyMarketplaceSourcePath(path7, root) {
}
// packages/omo-codex/src/install/lazycodex-version-stamp.ts
-import { readdir as readdir7, readFile as readFile16, writeFile as writeFile8 } from "fs/promises";
-import { join as join44 } from "path";
+import { readdir as readdir8, readFile as readFile16, writeFile as writeFile9 } from "fs/promises";
+import { join as join46 } from "path";
async function readDistributionManifest(repoRoot) {
try {
- const parsed = JSON.parse(await readFile16(join44(repoRoot, "package.json"), "utf8"));
+ const parsed = JSON.parse(await readFile16(join46(repoRoot, "package.json"), "utf8"));
if (!isPlainRecord3(parsed) || typeof parsed.version !== "string" || parsed.version.trim().length === 0)
return;
return {
@@ -77033,19 +77297,19 @@ function resolveLazyCodexPluginVersion(input) {
return input.manifestVersion ?? "local";
}
async function stampLazyCodexPluginVersion(input) {
- const manifestPath = join44(input.pluginRoot, ".codex-plugin", "plugin.json");
+ const manifestPath = join46(input.pluginRoot, ".codex-plugin", "plugin.json");
const hookPaths = await readPluginHookPaths(manifestPath);
await stampJsonVersion(manifestPath, input.version);
- await stampJsonVersion(join44(input.pluginRoot, "package.json"), input.version);
+ await stampJsonVersion(join46(input.pluginRoot, "package.json"), input.version);
for (const hookPath of hookPaths) {
- await stampHookStatusMessages(join44(input.pluginRoot, hookPath), input.version);
+ await stampHookStatusMessages(join46(input.pluginRoot, hookPath), input.version);
}
await stampComponentVersions(input);
}
async function writeLazyCodexInstallSnapshot(input) {
if (input.distributionManifest === undefined)
return;
- await writeFile8(join44(input.pluginRoot, "lazycodex-install.json"), `${JSON.stringify({
+ await writeFile9(join46(input.pluginRoot, "lazycodex-install.json"), `${JSON.stringify({
packageName: input.distributionManifest.name,
version: input.distributionManifest.version
}, null, "\t")}
@@ -77057,7 +77321,7 @@ async function stampJsonVersion(path7, version) {
if (!isPlainRecord3(parsed))
return;
parsed.version = version;
- await writeFile8(path7, `${JSON.stringify(parsed, null, "\t")}
+ await writeFile9(path7, `${JSON.stringify(parsed, null, "\t")}
`);
} catch (error) {
if (error instanceof Error)
@@ -77091,7 +77355,7 @@ async function stampHookStatusMessages(path7, version) {
if (!isPlainRecord3(parsed))
return;
stampHookGroups(parsed.hooks, version);
- await writeFile8(path7, `${JSON.stringify(parsed, null, "\t")}
+ await writeFile9(path7, `${JSON.stringify(parsed, null, "\t")}
`);
} catch (error) {
if (error instanceof Error)
@@ -77102,16 +77366,16 @@ async function stampHookStatusMessages(path7, version) {
async function stampComponentVersions(input) {
let entries;
try {
- entries = await readdir7(join44(input.pluginRoot, "components"));
+ entries = await readdir8(join46(input.pluginRoot, "components"));
} catch (error) {
if (error instanceof Error)
return;
throw error;
}
for (const entry of entries) {
- const componentRoot = join44(input.pluginRoot, "components", entry);
- await stampJsonVersion(join44(componentRoot, "package.json"), input.version);
- await stampHookStatusMessages(join44(componentRoot, "hooks", "hooks.json"), input.version);
+ const componentRoot = join46(input.pluginRoot, "components", entry);
+ await stampJsonVersion(join46(componentRoot, "package.json"), input.version);
+ await stampHookStatusMessages(join46(componentRoot, "hooks", "hooks.json"), input.version);
}
}
function stampHookGroups(hooks, version) {
@@ -77168,8 +77432,8 @@ var defaultRunCommand = async (command, args, options) => {
};
// packages/omo-codex/src/install/codex-project-local-cleanup.ts
-import { copyFile as copyFile2, lstat as lstat9, readFile as readFile17, writeFile as writeFile9 } from "fs/promises";
-import { dirname as dirname16, join as join45, resolve as resolve13 } from "path";
+import { copyFile as copyFile2, lstat as lstat10, readFile as readFile17, writeFile as writeFile10 } from "fs/promises";
+import { dirname as dirname17, join as join47, resolve as resolve13 } from "path";
var LEGACY_AGENT_CONFLICT_KEYS = ["max_threads"];
var PROJECT_LOCAL_ARTIFACT_PATHS = [
".codex/hooks.json",
@@ -77201,7 +77465,7 @@ async function repairNearestProjectLocalCodexArtifacts(input) {
}
const backupPath = `${configPath}.backup-${formatBackupTimestamp(input.now?.() ?? new Date)}`;
await copyFile2(configPath, backupPath);
- await writeFile9(configPath, `${repair.config.trimEnd()}
+ await writeFile10(configPath, `${repair.config.trimEnd()}
`);
configs.push({
projectRoot: project.projectRoot,
@@ -77272,37 +77536,37 @@ async function findProjectLocalCodexConfigs(startDirectory, codexHome) {
if (startDirectoryStat !== null && !startDirectoryStat.isDirectory()) {
throw new ProjectLocalCleanupStartDirectoryError(startDirectory);
}
- const codexHomeConfigPath = codexHome === undefined ? null : join45(resolve13(codexHome), "config.toml");
+ const codexHomeConfigPath = codexHome === undefined ? null : join47(resolve13(codexHome), "config.toml");
let current = resolve13(startDirectory);
const configPathsFromCwd = [];
while (true) {
- const configPath = join45(current, ".codex", "config.toml");
+ const configPath = join47(current, ".codex", "config.toml");
if (await isRegularProjectLocalConfig(current, configPath)) {
if (codexHomeConfigPath === null || resolve13(configPath) !== codexHomeConfigPath) {
configPathsFromCwd.push(configPath);
}
}
- if (await exists4(join45(current, ".git"))) {
+ if (await exists5(join47(current, ".git"))) {
return configPathsFromCwd.length === 0 ? null : {
projectRoot: current,
configPaths: [...configPathsFromCwd].reverse(),
artifactRoots: artifactRootsForConfigPaths(configPathsFromCwd)
};
}
- const parent = dirname16(current);
+ const parent = dirname17(current);
if (parent === current) {
const nearestConfigPath = configPathsFromCwd[0];
return nearestConfigPath === undefined ? null : {
- projectRoot: dirname16(dirname16(nearestConfigPath)),
+ projectRoot: dirname17(dirname17(nearestConfigPath)),
configPaths: [nearestConfigPath],
- artifactRoots: [dirname16(dirname16(nearestConfigPath))]
+ artifactRoots: [dirname17(dirname17(nearestConfigPath))]
};
}
current = parent;
}
}
async function isRegularProjectLocalConfig(directory, configPath) {
- const codexDirStat = await maybeLstat(join45(directory, ".codex"));
+ const codexDirStat = await maybeLstat(join47(directory, ".codex"));
if (codexDirStat === null || !codexDirStat.isDirectory() || codexDirStat.isSymbolicLink())
return false;
const configStat = await maybeLstat(configPath);
@@ -77311,7 +77575,7 @@ async function isRegularProjectLocalConfig(directory, configPath) {
function artifactRootsForConfigPaths(configPaths) {
const roots = [];
for (const configPath of configPaths) {
- const root = dirname16(dirname16(configPath));
+ const root = dirname17(dirname17(configPath));
if (!roots.includes(root))
roots.push(root);
}
@@ -77322,7 +77586,7 @@ async function collectProjectLocalArtifacts(projectRoots) {
const seenPaths = new Set;
for (const projectRoot of projectRoots) {
for (const relativePath of PROJECT_LOCAL_ARTIFACT_PATHS) {
- const artifactPath = join45(projectRoot, relativePath);
+ const artifactPath = join47(projectRoot, relativePath);
if (seenPaths.has(artifactPath))
continue;
const entryStat = await maybeLstat(artifactPath);
@@ -77356,17 +77620,17 @@ function formatBackupTimestamp(date) {
}
async function maybeLstat(path7) {
try {
- return await lstat9(path7);
+ return await lstat10(path7);
} catch (error) {
- if (nodeErrorCode3(error) === "ENOENT")
+ if (nodeErrorCode4(error) === "ENOENT")
return null;
throw error;
}
}
-async function exists4(path7) {
+async function exists5(path7) {
return await maybeLstat(path7) !== null;
}
-function nodeErrorCode3(error) {
+function nodeErrorCode4(error) {
if (!(error instanceof Error) || !("code" in error))
return null;
return typeof error.code === "string" ? error.code : null;
@@ -77397,24 +77661,24 @@ function formatUnknownError(error) {
}
// packages/omo-codex/src/install/lsp-daemon-reaper.ts
-import { readFile as readFile18, readdir as readdir8, rm as rm10 } from "fs/promises";
+import { readFile as readFile18, readdir as readdir9, rm as rm10 } from "fs/promises";
import { connect } from "net";
-import { join as join46 } from "path";
+import { join as join48 } from "path";
async function reapLspDaemons(codexHome, deps = {}) {
const killProcess = deps.killProcess ?? sendSigterm;
const isDaemonLive = deps.isDaemonLive ?? probeSocketLive;
- const daemonRoot = join46(codexHome, "codex-lsp", "daemon");
+ const daemonRoot = join48(codexHome, "codex-lsp", "daemon");
const reaped = [];
let entries;
try {
- entries = await readdir8(daemonRoot);
+ entries = await readdir9(daemonRoot);
} catch {
return reaped;
}
for (const entry of entries) {
- const versionDir = join46(daemonRoot, entry);
- const pid = await readPidFile(join46(versionDir, "daemon.pid"));
- const socketPath = await readEndpointFile(join46(versionDir, "daemon.endpoint"));
+ const versionDir = join48(daemonRoot, entry);
+ const pid = await readPidFile(join48(versionDir, "daemon.pid"));
+ const socketPath = await readEndpointFile(join48(versionDir, "daemon.endpoint"));
if (pid !== null && socketPath !== null && await isDaemonLive(socketPath) && killProcess(pid)) {
reaped.push(pid);
}
@@ -77468,7 +77732,7 @@ function sendSigterm(pid) {
// packages/omo-codex/src/install/codex-installer-bin-dir.ts
import { homedir as homedir5 } from "os";
-import { join as join47, resolve as resolve14 } from "path";
+import { join as join49, resolve as resolve14 } from "path";
function resolveCodexInstallerBinDir(input) {
const explicitBinDir = input.binDir ?? input.env?.CODEX_LOCAL_BIN_DIR;
if (explicitBinDir !== undefined && explicitBinDir.trim().length > 0)
@@ -77477,13 +77741,13 @@ function resolveCodexInstallerBinDir(input) {
const defaultCodexHome = resolve14(homeDir, ".codex");
const resolvedCodexHome = resolve14(input.codexHome);
if (resolvedCodexHome !== defaultCodexHome)
- return join47(resolvedCodexHome, "bin");
+ return join49(resolvedCodexHome, "bin");
return resolve14(homeDir, ".local", "bin");
}
// packages/omo-codex/src/install/codex-git-bash-hooks.ts
-import { readFile as readFile19, writeFile as writeFile10 } from "fs/promises";
-import { join as join48 } from "path";
+import { readFile as readFile19, writeFile as writeFile11 } from "fs/promises";
+import { join as join50 } from "path";
var WINDOWS_ONLY_GIT_BASH_HOOKS = new Set([
"./hooks/pre-tool-use-recommending-git-bash-mcp.json",
"./hooks/post-compact-resetting-git-bash-mcp-reminder.json"
@@ -77491,22 +77755,22 @@ var WINDOWS_ONLY_GIT_BASH_HOOKS = new Set([
async function removeGitBashHooksOffWindows(input) {
if (input.platform === "win32")
return;
- const manifestPath = join48(input.pluginRoot, ".codex-plugin", "plugin.json");
+ const manifestPath = join50(input.pluginRoot, ".codex-plugin", "plugin.json");
const parsed = JSON.parse(await readFile19(manifestPath, "utf8"));
if (!isPlainRecord3(parsed) || !Array.isArray(parsed.hooks))
return;
const hooks = parsed.hooks.filter((hook) => typeof hook !== "string" || !WINDOWS_ONLY_GIT_BASH_HOOKS.has(hook));
if (hooks.length === parsed.hooks.length)
return;
- await writeFile10(manifestPath, `${JSON.stringify({ ...parsed, hooks }, null, "\t")}
+ await writeFile11(manifestPath, `${JSON.stringify({ ...parsed, hooks }, null, "\t")}
`);
}
// packages/omo-codex/src/install/omo-sot-migration.ts
-import { join as join49 } from "path";
+import { join as join51 } from "path";
async function seedAndMigrateOmoSot(input) {
const commandEnv = { ...input.env };
- const scriptPath = join49(input.repoRoot, "packages", "omo-codex", "plugin", "scripts", "migrate-omo-sot.mjs");
+ const scriptPath = join51(input.repoRoot, "packages", "omo-codex", "plugin", "scripts", "migrate-omo-sot.mjs");
try {
await input.runCommand(process.execPath, [scriptPath, "--seed"], {
cwd: input.repoRoot,
@@ -77521,7 +77785,7 @@ async function seedAndMigrateOmoSot(input) {
// packages/omo-codex/src/install/install-ast-grep-sg.ts
init_src();
-import { join as join50 } from "path";
+import { join as join52 } from "path";
function describeResult(result) {
if (result.kind === "succeeded")
return null;
@@ -77535,7 +77799,7 @@ async function installAstGrepForCodex(options) {
return;
const platform = options.platform ?? process.platform;
const targetDir = astGrepRuntimeDir(options.codexHome, platform, options.arch ?? process.arch);
- const skillDir = join50(plugin.path, "skills", "ast-grep");
+ const skillDir = join52(plugin.path, "skills", "ast-grep");
const installer = options.installer ?? runAstGrepSkillInstall;
try {
const result = await installer({ platform, skillDir, targetDir });
@@ -77569,7 +77833,7 @@ async function runCodexInstaller(options = {}) {
const env3 = options.env ?? process.env;
const platform = options.platform ?? process.platform;
const repoRoot = resolve15(options.repoRoot ?? findRepoRoot({ importerDir: import.meta.dir, env: env3 }));
- const codexHome = resolve15(options.codexHome ?? env3.CODEX_HOME ?? join53(homedir6(), ".codex"));
+ const codexHome = resolve15(options.codexHome ?? env3.CODEX_HOME ?? join55(homedir6(), ".codex"));
const projectDirectory = resolve15(options.projectDirectory ?? env3.OMO_CODEX_PROJECT ?? process.cwd());
const binDir = resolveCodexInstallerBinDir({ binDir: options.binDir, codexHome, env: env3 });
const runCommand = options.runCommand ?? defaultRunCommand;
@@ -77585,9 +77849,9 @@ async function runCodexInstaller(options = {}) {
if (!gitBashResolution.found) {
throw new Error(gitBashResolution.installHint);
}
- const codexPackageRoot = join53(repoRoot, "packages", "omo-codex");
+ const codexPackageRoot = join55(repoRoot, "packages", "omo-codex");
const marketplace = await readMarketplace(repoRoot, {
- marketplacePath: join53(codexPackageRoot, "marketplace.json")
+ marketplacePath: join55(codexPackageRoot, "marketplace.json")
});
const distributionManifest = await readDistributionManifest(repoRoot);
const installed = [];
@@ -77630,7 +77894,7 @@ async function runCodexInstaller(options = {}) {
if (runtimeLink !== null)
log4(`Linked ${runtimeLink.name} -> ${runtimeLink.target}`);
else
- log4(`Warning: skipped the omo runtime wrapper because ${join53(repoRoot, "dist", "cli", "index.js")} is missing; omo ulw-loop commands will be unavailable until a package shipping dist/cli is installed`);
+ log4(`Warning: skipped the omo runtime wrapper because ${join55(repoRoot, "dist", "cli", "index.js")} is missing; omo ulw-loop commands will be unavailable until a package shipping dist/cli is installed`);
}
pluginSources.push({ name: entry.name, sourcePath });
installed.push(plugin);
@@ -77661,7 +77925,7 @@ async function runCodexInstaller(options = {}) {
});
for (const link of agentLinks) {
log4(`Linked agent ${link.name} -> ${link.target}`);
- const agentName = agentNameFromToml2(link.name);
+ const agentName = agentNameFromToml3(link.name);
agentConfigs.set(agentName, { name: agentName, configFile: `./agents/${link.name}` });
}
}
@@ -77684,13 +77948,13 @@ async function runCodexInstaller(options = {}) {
});
}
await reapLspDaemons(codexHome).catch(() => []);
- const marketplaceRoot = join53(codexHome, "plugins", "cache", marketplace.name);
+ const marketplaceRoot = join55(codexHome, "plugins", "cache", marketplace.name);
await writeCachedMarketplaceManifest({
marketplaceName: marketplace.name,
marketplaceRoot,
plugins: installed
});
- const configPath = join53(codexHome, "config.toml");
+ const configPath = join55(codexHome, "config.toml");
await updateCodexConfig({
configPath,
repoRoot: codexPackageRoot,
@@ -77728,7 +77992,7 @@ async function runCodexInstaller(options = {}) {
projectCleanup
};
}
-function agentNameFromToml2(fileName) {
+function agentNameFromToml3(fileName) {
return fileName.endsWith(".toml") ? fileName.slice(0, -".toml".length) : fileName;
}
async function agentSourceRootsForInstall(input) {
@@ -77750,7 +78014,7 @@ function findRepoRootFromImporter(importerDir) {
for (let depth = 0;depth <= 7; depth += 1) {
if (isRepoRootWithCodexPlugin(current))
return current;
- for (const wrapperPackageRoot of [join53(current, "node_modules", "oh-my-openagent"), join53(current, "oh-my-openagent")]) {
+ for (const wrapperPackageRoot of [join55(current, "node_modules", "oh-my-openagent"), join55(current, "oh-my-openagent")]) {
if (isRepoRootWithCodexPlugin(wrapperPackageRoot))
return wrapperPackageRoot;
}
@@ -77768,7 +78032,7 @@ function findRepoRoot(input) {
return findRepoRootFromImporter(input.importerDir);
}
function isRepoRootWithCodexPlugin(repoRoot) {
- return existsSync30(join53(repoRoot, "packages", "omo-codex", "plugin", ".codex-plugin", "plugin.json"));
+ return existsSync30(join55(repoRoot, "packages", "omo-codex", "plugin", ".codex-plugin", "plugin.json"));
}
function codexMarketplaceSource(marketplaceRoot) {
return { sourceType: "local", source: marketplaceRoot };
@@ -77789,19 +78053,19 @@ async function detectCodexInstallation(input = {}) {
const platform = input.platform ?? process.platform;
const env3 = input.env ?? process.env;
const homeDir = input.homeDir ?? homedir7();
- const exists5 = input.exists ?? existsSync31;
+ const exists6 = input.exists ?? existsSync31;
const which2 = input.which ?? bunWhich;
const checkedPaths = [CODEX_PATH_CHECK_LABEL];
const cliPath = nonEmptyValue2(which2("codex"));
if (cliPath !== undefined)
return { found: true, source: "cli", path: cliPath };
if (platform === "darwin") {
- return detectMacCodexInstallation({ homeDir, exists: exists5, checkedPaths });
+ return detectMacCodexInstallation({ homeDir, exists: exists6, checkedPaths });
}
if (platform === "win32") {
return detectWindowsCodexInstallation({
env: env3,
- exists: exists5,
+ exists: exists6,
checkedPaths,
runCommand: input.runCommand ?? defaultRunCommand2
});
@@ -77903,13 +78167,13 @@ function defaultRunCommand2(command, args) {
});
}
// packages/omo-codex/src/install/codex-cleanup.ts
-import { lstat as lstat11, readFile as readFile21, readdir as readdir9, rm as rm11, rmdir } from "fs/promises";
+import { lstat as lstat12, readFile as readFile21, readdir as readdir10, rm as rm11, rmdir } from "fs/promises";
import { homedir as homedir8 } from "os";
-import { isAbsolute as isAbsolute10, join as join55, relative as relative7, resolve as resolve17 } from "path";
+import { isAbsolute as isAbsolute11, join as join57, relative as relative7, resolve as resolve17 } from "path";
// packages/omo-codex/src/install/codex-cleanup-config.ts
-import { lstat as lstat10, mkdir as mkdir8, readFile as readFile20, writeFile as writeFile11 } from "fs/promises";
-import { dirname as dirname18 } from "path";
+import { lstat as lstat11, mkdir as mkdir8, readFile as readFile20, writeFile as writeFile12 } from "fs/promises";
+import { dirname as dirname19 } from "path";
var MANAGED_MARKETPLACES = ["sisyphuslabs", "lazycodex", "code-yeongyu-codex-plugins"];
var LEGACY_MANAGED_CODEX_AGENT_NAMES_TO_PURGE2 = ["codex-ultrawork-reviewer"];
var CURRENT_MANAGED_CODEX_AGENT_NAMES2 = [
@@ -77943,9 +78207,9 @@ async function cleanupCodexConfig(configPath, now) {
if (next === original)
return { changed: false };
const backupPath = `${configPath}.backup-${formatBackupTimestamp2(now?.() ?? new Date)}`;
- await mkdir8(dirname18(configPath), { recursive: true });
- await writeFile11(backupPath, original);
- await writeFile11(configPath, `${next.trimEnd()}
+ await mkdir8(dirname19(configPath), { recursive: true });
+ await writeFile12(backupPath, original);
+ await writeFile12(configPath, `${next.trimEnd()}
`);
return { changed: true, backupPath };
}
@@ -78007,27 +78271,27 @@ function formatBackupTimestamp2(date) {
}
async function configExists(path7) {
try {
- await lstat10(path7);
+ await lstat11(path7);
return true;
} catch (error) {
- if (nodeErrorCode4(error) === "ENOENT")
+ if (nodeErrorCode5(error) === "ENOENT")
return false;
throw error;
}
}
-function nodeErrorCode4(error) {
+function nodeErrorCode5(error) {
if (!(error instanceof Error) || !("code" in error))
return null;
return typeof error.code === "string" ? error.code : null;
}
// packages/omo-codex/src/install/codex-cleanup-safety.ts
-import { dirname as dirname19, isAbsolute as isAbsolute9, join as join54, relative as relative6, resolve as resolve16 } from "path";
+import { dirname as dirname20, isAbsolute as isAbsolute10, join as join56, relative as relative6, resolve as resolve16 } from "path";
function validateManagedCleanupTarget(input) {
- if (!isAbsolute9(input.path))
+ if (!isAbsolute10(input.path))
return skipped(input.path, "outside managed Codex cleanup scope");
const codexHome = resolve16(input.codexHome);
- if (dirname19(codexHome) === codexHome)
+ if (dirname20(codexHome) === codexHome)
return skipped(input.path, "Codex home resolves to a filesystem root");
const target = resolve16(input.path);
if (!isWithinDirectory(codexHome, target))
@@ -78035,11 +78299,11 @@ function validateManagedCleanupTarget(input) {
if (target === codexHome)
return skipped(input.path, "outside managed Codex cleanup scope");
const exactManagedRoots = new Set([
- resolve16(join54(codexHome, "plugins", "cache", "sisyphuslabs")),
- resolve16(join54(codexHome, ".tmp", "marketplaces", "sisyphuslabs")),
- resolve16(join54(codexHome, "runtime", "ast-grep")),
- resolve16(join54(codexHome, "runtime", "node")),
- resolve16(join54(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap"))
+ resolve16(join56(codexHome, "plugins", "cache", "sisyphuslabs")),
+ resolve16(join56(codexHome, ".tmp", "marketplaces", "sisyphuslabs")),
+ resolve16(join56(codexHome, "runtime", "ast-grep")),
+ resolve16(join56(codexHome, "runtime", "node")),
+ resolve16(join56(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap"))
]);
if (exactManagedRoots.has(target))
return null;
@@ -78049,7 +78313,7 @@ function validateManagedCleanupTarget(input) {
}
function isWithinDirectory(parent, child) {
const relativePath = relative6(parent, child);
- return relativePath === "" || !relativePath.startsWith("..") && !isAbsolute9(relativePath);
+ return relativePath === "" || !relativePath.startsWith("..") && !isAbsolute10(relativePath);
}
function isManagedBootstrapDriftPath(codexHome, target) {
const relativePath = relative6(codexHome, target);
@@ -78069,8 +78333,8 @@ function skipped(path7, reason) {
var INSTALLED_AGENTS_MANIFEST = ".installed-agents.json";
async function cleanupCodexLight(input = {}) {
const env3 = input.env ?? process.env;
- const codexHome = resolve17(input.codexHome ?? env3.CODEX_HOME ?? join55(homedir8(), ".codex"));
- const configPath = join55(codexHome, "config.toml");
+ const codexHome = resolve17(input.codexHome ?? env3.CODEX_HOME ?? join57(homedir8(), ".codex"));
+ const configPath = join57(codexHome, "config.toml");
const agentPaths = await collectInstalledAgentPaths(codexHome, configPath);
const configCleanup = await cleanupCodexConfig(configPath, input.now);
const agentCleanup = await removeManifestListedAgentLinks(codexHome, agentPaths);
@@ -78109,32 +78373,32 @@ async function cleanupCodexLight(input = {}) {
}
function managedGlobalStatePaths(codexHome) {
return [
- join55(codexHome, "plugins", "cache", "sisyphuslabs"),
- join55(codexHome, ".tmp", "marketplaces", "sisyphuslabs"),
- join55(codexHome, "runtime", "ast-grep"),
- join55(codexHome, "runtime", "node"),
- join55(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap")
+ join57(codexHome, "plugins", "cache", "sisyphuslabs"),
+ join57(codexHome, ".tmp", "marketplaces", "sisyphuslabs"),
+ join57(codexHome, "runtime", "ast-grep"),
+ join57(codexHome, "runtime", "node"),
+ join57(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap")
];
}
var BOOTSTRAP_DATA_GLOB_MAX_DEPTH = 5;
async function collectBootstrapDataDirsByGlob(codexHome) {
const results = [];
- await walkForManagedBootstrapDirs(join55(codexHome, "plugins"), 0, results);
+ await walkForManagedBootstrapDirs(join57(codexHome, "plugins"), 0, results);
return results;
}
async function walkForManagedBootstrapDirs(directory, depth, results) {
if (depth > BOOTSTRAP_DATA_GLOB_MAX_DEPTH)
return;
- const entries = await readdir9(directory, { withFileTypes: true }).catch(() => null);
+ const entries = await readdir10(directory, { withFileTypes: true }).catch(() => null);
if (entries === null)
return;
for (const entry of entries) {
if (!entry.isDirectory())
continue;
- const childPath = join55(directory, entry.name);
+ const childPath = join57(directory, entry.name);
if (isManagedBootstrapOwnerName(entry.name)) {
- const bootstrapDir = join55(childPath, "bootstrap");
- if (await exists5(bootstrapDir))
+ const bootstrapDir = join57(childPath, "bootstrap");
+ if (await exists6(bootstrapDir))
results.push(bootstrapDir);
continue;
}
@@ -78157,7 +78421,7 @@ async function removeManagedPathBestEffort(path7, seams) {
}
async function attemptRemove(path7) {
try {
- if (await lstat11(path7).catch(() => null) === null)
+ if (await lstat12(path7).catch(() => null) === null)
return false;
await rm11(path7, { recursive: true, force: true });
return true;
@@ -78167,7 +78431,7 @@ async function attemptRemove(path7) {
}
async function pruneEmptyRuntimeDirBestEffort(codexHome) {
try {
- await rmdir(join55(codexHome, "runtime"));
+ await rmdir(join57(codexHome, "runtime"));
} catch (error) {
if (isExpectedRuntimePruneFailure(error))
return;
@@ -78175,18 +78439,18 @@ async function pruneEmptyRuntimeDirBestEffort(codexHome) {
}
}
function isExpectedRuntimePruneFailure(error) {
- return ["ENOENT", "ENOTEMPTY", "EEXIST", "EPERM", "EBUSY", "ENOTDIR"].includes(nodeErrorCode5(error) ?? "");
+ return ["ENOENT", "ENOTEMPTY", "EEXIST", "EPERM", "EBUSY", "ENOTDIR"].includes(nodeErrorCode6(error) ?? "");
}
async function collectInstalledAgentPaths(codexHome, configPath) {
const manifestPaths = [
- join55(codexHome, ".tmp", "marketplaces", "sisyphuslabs", "plugins", "omo", INSTALLED_AGENTS_MANIFEST)
+ join57(codexHome, ".tmp", "marketplaces", "sisyphuslabs", "plugins", "omo", INSTALLED_AGENTS_MANIFEST)
];
- const versionRoot = join55(codexHome, "plugins", "cache", "sisyphuslabs", "omo");
- if (await exists5(versionRoot)) {
- const entries = await readdir9(versionRoot, { withFileTypes: true });
+ const versionRoot = join57(codexHome, "plugins", "cache", "sisyphuslabs", "omo");
+ if (await exists6(versionRoot)) {
+ const entries = await readdir10(versionRoot, { withFileTypes: true });
for (const entry of entries) {
if (entry.isDirectory())
- manifestPaths.push(join55(versionRoot, entry.name, INSTALLED_AGENTS_MANIFEST));
+ manifestPaths.push(join57(versionRoot, entry.name, INSTALLED_AGENTS_MANIFEST));
}
}
const paths = new Set;
@@ -78201,13 +78465,13 @@ async function collectInstalledAgentPaths(codexHome, configPath) {
return [...paths].sort();
}
async function readManagedAgentPathsFromConfig(codexHome, configPath) {
- if (!await exists5(configPath))
+ if (!await exists6(configPath))
return [];
const config = await readFile21(configPath, "utf8");
- return MANAGED_CODEX_AGENT_NAMES2.filter((agentName) => config.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`)).map((agentName) => join55(codexHome, "agents", `${agentName}.toml`));
+ return MANAGED_CODEX_AGENT_NAMES2.filter((agentName) => config.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`)).map((agentName) => join57(codexHome, "agents", `${agentName}.toml`));
}
async function readInstalledAgentManifest(manifestPath) {
- if (!await exists5(manifestPath))
+ if (!await exists6(manifestPath))
return [];
const parsed = JSON.parse(await readFile21(manifestPath, "utf8"));
if (!isPlainRecord3(parsed) || !Array.isArray(parsed.agents))
@@ -78215,7 +78479,7 @@ async function readInstalledAgentManifest(manifestPath) {
return parsed.agents.filter((path7) => typeof path7 === "string");
}
async function removeManifestListedAgentLinks(codexHome, paths) {
- const agentsDir = join55(codexHome, "agents");
+ const agentsDir = join57(codexHome, "agents");
const removed = [];
const skipped2 = [];
for (const path7 of paths) {
@@ -78236,29 +78500,29 @@ async function removeManifestListedAgentLinks(codexHome, paths) {
return { removed, skipped: skipped2 };
}
function isSafeManagedAgentPath(agentsDir, path7) {
- if (!isAbsolute10(path7))
+ if (!isAbsolute11(path7))
return false;
const relativePath = relative7(agentsDir, path7);
- if (relativePath === "" || relativePath.startsWith("..") || isAbsolute10(relativePath))
+ if (relativePath === "" || relativePath.startsWith("..") || isAbsolute11(relativePath))
return false;
const fileName = relativePath.split(/[\\/]/).pop();
if (fileName === undefined)
return false;
return MANAGED_CODEX_AGENT_NAMES2.some((agentName) => fileName === `${agentName}.toml`);
}
-async function exists5(path7) {
+async function exists6(path7) {
return await maybeLstat2(path7) !== null;
}
async function maybeLstat2(path7) {
try {
- return await lstat11(path7);
+ return await lstat12(path7);
} catch (error) {
- if (nodeErrorCode5(error) === "ENOENT")
+ if (nodeErrorCode6(error) === "ENOENT")
return null;
throw error;
}
}
-function nodeErrorCode5(error) {
+function nodeErrorCode6(error) {
if (!(error instanceof Error) || !("code" in error))
return null;
return typeof error.code === "string" ? error.code : null;
@@ -78268,16 +78532,16 @@ var CODEGRAPH_RELATIVE_ARGS2 = new Set(["components/codegraph/dist/serve.js", ".
// packages/omo-senpi/src/install/install-senpi.ts
import { execFile as execFile3 } from "child_process";
import { constants as constants7, existsSync as existsSync32 } from "fs";
-import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile22, rename as rename5, writeFile as writeFile12 } from "fs/promises";
+import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile22, rename as rename5, writeFile as writeFile13 } from "fs/promises";
import { homedir as homedir9 } from "os";
-import { dirname as dirname20, join as join56, resolve as resolve18 } from "path";
+import { dirname as dirname21, join as join58, resolve as resolve18 } from "path";
import { fileURLToPath } from "url";
import { promisify as promisify2 } from "util";
var execFileAsync2 = promisify2(execFile3);
var REQUIRED_PLUGIN_ARTIFACTS = [
- join56("extensions", "omo.js"),
- join56("skills", "ultrawork", "SKILL.md"),
- join56("skills", "ulw-loop", "SKILL.md")
+ join58("extensions", "omo.js"),
+ join58("skills", "ultrawork", "SKILL.md"),
+ join58("skills", "ulw-loop", "SKILL.md")
];
async function runSenpiInstaller(options = {}) {
const context = resolveInstallContext(options);
@@ -78301,14 +78565,14 @@ async function runSenpiInstaller(options = {}) {
}
function resolveInstallContext(options) {
const env3 = options.env ?? process.env;
- const repoRoot = resolve18(options.repoRoot ?? findRepoRoot2(dirname20(fileURLToPath(import.meta.url))));
- const agentDir = resolve18(options.agentDir ?? env3.SENPI_CODING_AGENT_DIR ?? join56(homedir9(), ".senpi", "agent"));
- const pluginPath = resolve18(options.pluginPath ?? join56(repoRoot, "packages", "omo-senpi", "plugin"));
+ const repoRoot = resolve18(options.repoRoot ?? findRepoRoot2(dirname21(fileURLToPath(import.meta.url))));
+ const agentDir = resolve18(options.agentDir ?? env3.SENPI_CODING_AGENT_DIR ?? join58(homedir9(), ".senpi", "agent"));
+ const pluginPath = resolve18(options.pluginPath ?? join58(repoRoot, "packages", "omo-senpi", "plugin"));
return {
env: env3,
repoRoot,
agentDir,
- settingsPath: join56(agentDir, "settings.json"),
+ settingsPath: join58(agentDir, "settings.json"),
pluginPath,
runCommand: options.runCommand ?? defaultRunCommand3
};
@@ -78317,12 +78581,12 @@ async function ensurePluginArtifacts(context) {
const missing = await hasMissingPluginArtifact(context.pluginPath);
if (!missing)
return;
- await context.runCommand("node", [join56(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
- await context.runCommand("node", [join56(context.pluginPath, "scripts", "sync-skills.mjs")], { cwd: context.repoRoot });
+ await context.runCommand("node", [join58(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
+ await context.runCommand("node", [join58(context.pluginPath, "scripts", "sync-skills.mjs")], { cwd: context.repoRoot });
}
async function hasMissingPluginArtifact(pluginPath) {
for (const artifact of REQUIRED_PLUGIN_ARTIFACTS) {
- if (!await fileExists(join56(pluginPath, artifact)))
+ if (!await fileExists(join58(pluginPath, artifact)))
return true;
}
return false;
@@ -78361,16 +78625,16 @@ function dedupePackages(packages) {
return [...new Set(packages)];
}
async function writeSettingsAtomically(settingsPath, settings) {
- await mkdir9(dirname20(settingsPath), { recursive: true });
+ await mkdir9(dirname21(settingsPath), { recursive: true });
const backupPath = await nextBackupPath(settingsPath);
if (await fileExists(settingsPath)) {
await copyFile3(settingsPath, backupPath);
} else {
- await writeFile12(backupPath, `{}
+ await writeFile13(backupPath, `{}
`, "utf8");
}
const tempPath = `${settingsPath}.${process.pid}.${Date.now()}.tmp`;
- await writeFile12(tempPath, `${JSON.stringify(settings, null, 2)}
+ await writeFile13(tempPath, `${JSON.stringify(settings, null, 2)}
`, "utf8");
await rename5(tempPath, settingsPath);
return backupPath;
@@ -78390,7 +78654,7 @@ function timestampForBackup() {
function findRepoRoot2(importerDir) {
let current = importerDir;
for (let depth = 0;depth <= 7; depth += 1) {
- if (fileExistsSync(join56(current, "packages", "omo-senpi", "plugin", "package.json")))
+ if (fileExistsSync(join58(current, "packages", "omo-senpi", "plugin", "package.json")))
return current;
current = resolve18(current, "..");
}
@@ -78449,26 +78713,26 @@ async function starGitHubRepositories(platform = "both", runCommand = runGitHubS
init_provider_availability();
// packages/omo-opencode/src/cli/config-manager/add-tui-plugin-to-tui-config.ts
-import { existsSync as existsSync34, mkdirSync as mkdirSync10, readFileSync as readFileSync16 } from "fs";
-import { join as join58 } from "path";
+import { existsSync as existsSync34, mkdirSync as mkdirSync10, readFileSync as readFileSync17 } from "fs";
+import { join as join60 } from "path";
// packages/omo-opencode/src/cli/doctor/checks/tui-plugin-config.ts
init_shared();
-import { existsSync as existsSync33, readFileSync as readFileSync15 } from "fs";
-import { join as join57 } from "path";
+import { existsSync as existsSync33, readFileSync as readFileSync16 } from "fs";
+import { join as join59 } from "path";
var TUI_SUBPATH = "tui";
var TUI_EXPORT_SUBPATH = `./${TUI_SUBPATH}`;
function fileEntryPackageJsonPath(entry) {
let path7 = entry.slice("file:".length);
if (path7.startsWith("//"))
path7 = path7.slice(2);
- return join57(path7, "package.json");
+ return join59(path7, "package.json");
}
function packageJsonExportsTui(pkgJsonPath) {
if (!existsSync33(pkgJsonPath))
return null;
try {
- const parsed = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
+ const parsed = JSON.parse(readFileSync16(pkgJsonPath, "utf-8"));
if (parsed.exports === undefined)
return null;
if (typeof parsed.exports === "string")
@@ -78500,7 +78764,7 @@ function packageExportsTuiForServerEntry(entry) {
const packageName = packageNameFromServerEntry(entry);
if (packageName === null)
return null;
- return packageJsonExportsTui(join57(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
+ return packageJsonExportsTui(join59(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
}
function isOurFilePluginEntry(entry) {
if (typeof entry !== "string" || !entry.startsWith("file:"))
@@ -78509,7 +78773,7 @@ function isOurFilePluginEntry(entry) {
const pkgJsonPath = fileEntryPackageJsonPath(entry);
if (!existsSync33(pkgJsonPath))
return false;
- const parsed = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
+ const parsed = JSON.parse(readFileSync16(pkgJsonPath, "utf-8"));
return typeof parsed.name === "string" && ACCEPTED_PACKAGE_NAMES.includes(parsed.name);
} catch (error) {
log2("[tui-plugin-config] Failed to inspect file plugin package", {
@@ -78547,7 +78811,7 @@ function detectServerPluginRegistration() {
return { registered: false, configPath: null, entry: null, packageExportsTui: null };
}
try {
- const parsed = parseJsonc(readFileSync15(configPath, "utf-8"));
+ const parsed = parseJsonc(readFileSync16(configPath, "utf-8"));
const plugins = parsed.plugin ?? [];
const serverEntry = plugins.find(isServerPluginEntry);
return {
@@ -78565,7 +78829,7 @@ function detectServerPluginRegistration() {
}
}
function detectTuiPluginRegistration() {
- const tuiJsonPath = join57(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
+ const tuiJsonPath = join59(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
if (!existsSync33(tuiJsonPath)) {
return {
registered: false,
@@ -78577,7 +78841,7 @@ function detectTuiPluginRegistration() {
};
}
try {
- const parsed = parseJsonc(readFileSync15(tuiJsonPath, "utf-8"));
+ const parsed = parseJsonc(readFileSync16(tuiJsonPath, "utf-8"));
const plugins = parsed.plugin ?? [];
return {
registered: plugins.some(isTuiPluginEntry),
@@ -78710,7 +78974,7 @@ init_shared();
init_write_file_atomically2();
function readConfig(path7) {
try {
- const parsed = parseJsonc(readFileSync16(path7, "utf-8"));
+ const parsed = parseJsonc(readFileSync17(path7, "utf-8"));
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
return parsed;
}
@@ -78721,10 +78985,10 @@ function readConfig(path7) {
return null;
}
function readServerConfig(configDir) {
- const jsoncPath = join58(configDir, "opencode.jsonc");
+ const jsoncPath = join60(configDir, "opencode.jsonc");
if (existsSync34(jsoncPath))
return readConfig(jsoncPath);
- const jsonPath = join58(configDir, "opencode.json");
+ const jsonPath = join60(configDir, "opencode.json");
if (existsSync34(jsonPath))
return readConfig(jsonPath);
return null;
@@ -78766,7 +79030,7 @@ function ensureTuiPluginEntry(opts = {}) {
if (!desiredEntry) {
return { changed: false, reason: "no-server-entry" };
}
- const tuiJsonPath = join58(configDir, "tui.json");
+ const tuiJsonPath = join60(configDir, "tui.json");
const { config, malformed } = readTuiConfig(tuiJsonPath);
if (malformed) {
return { changed: false, reason: "malformed" };
@@ -78782,7 +79046,7 @@ function ensureTuiPluginEntry(opts = {}) {
// packages/omo-opencode/src/cli/install-ast-grep-sg.ts
import { homedir as homedir10 } from "os";
-import { join as join59 } from "path";
+import { join as join61 } from "path";
// packages/shared-skills/index.mjs
import { fileURLToPath as fileURLToPath2 } from "url";
@@ -78801,9 +79065,9 @@ function describeResult2(result) {
}
async function installAstGrepForOpenCode(options = {}) {
const platform = options.platform ?? process.platform;
- const baseDir = join59(options.homeDir ?? homedir10(), ".omo");
+ const baseDir = join61(options.homeDir ?? homedir10(), ".omo");
const targetDir = astGrepRuntimeDir(baseDir, platform, options.arch ?? process.arch);
- const skillDir = join59(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
+ const skillDir = join61(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
const installer = options.installer ?? runAstGrepSkillInstall;
try {
const result = await installer({ platform, skillDir, targetDir });
@@ -96798,7 +97062,7 @@ var import_picocolors11 = __toESM(require_picocolors(), 1);
// packages/omo-opencode/src/cli/run/opencode-binary-resolver.ts
init_bun_which_shim();
init_spawn_with_windows_hide();
-import { delimiter as delimiter2, dirname as dirname22, posix as posix4, win32 as win324 } from "path";
+import { delimiter as delimiter2, dirname as dirname23, posix as posix4, win32 as win324 } from "path";
var OPENCODE_COMMANDS = ["opencode", "opencode-desktop"];
var WINDOWS_SUFFIXES = ["", ".exe", ".cmd", ".bat", ".ps1"];
function getCommandCandidates(platform) {
@@ -96856,7 +97120,7 @@ async function findWorkingOpencodeBinary(pathEnv = process.env.PATH, probe2 = ca
return null;
}
function buildPathWithBinaryFirst(pathEnv, binaryPath) {
- const preferredDir = dirname22(binaryPath);
+ const preferredDir = dirname23(binaryPath);
const existing = (pathEnv ?? "").split(delimiter2).filter((entry) => entry.length > 0 && entry !== preferredDir);
return [preferredDir, ...existing].join(delimiter2);
}
@@ -97249,7 +97513,7 @@ var BOULDER_STATE_PATH = `${BOULDER_DIR}/${BOULDER_FILE}`;
var NOTEPAD_DIR = "notepads";
var NOTEPAD_BASE_PATH = `${BOULDER_DIR}/${NOTEPAD_DIR}`;
// packages/boulder-state/src/top-level-task.ts
-import { existsSync as existsSync37, readFileSync as readFileSync18 } from "fs";
+import { existsSync as existsSync37, readFileSync as readFileSync19 } from "fs";
var TODO_HEADING_PATTERN = /^##\s+TODOs\b/i;
var FINAL_VERIFICATION_HEADING_PATTERN = /^##\s+Final Verification Wave\b/i;
var SECOND_LEVEL_HEADING_PATTERN = /^##\s+/;
@@ -97276,7 +97540,7 @@ function readCurrentTopLevelTask(planPath) {
return null;
}
try {
- const content = readFileSync18(planPath, "utf-8");
+ const content = readFileSync19(planPath, "utf-8");
const lines = content.split(/\r?\n/);
let section = "other";
for (const line of lines) {
@@ -97302,12 +97566,12 @@ function readCurrentTopLevelTask(planPath) {
}
// packages/boulder-state/src/storage/path.ts
import { existsSync as existsSync38 } from "fs";
-import { isAbsolute as isAbsolute11, join as join61, relative as relative8, resolve as resolve19 } from "path";
+import { isAbsolute as isAbsolute12, join as join63, relative as relative8, resolve as resolve19 } from "path";
function getBoulderFilePath(directory) {
- return join61(directory, BOULDER_DIR, BOULDER_FILE);
+ return join63(directory, BOULDER_DIR, BOULDER_FILE);
}
function resolveTrackedPath(baseDirectory, trackedPath) {
- return isAbsolute11(trackedPath) ? resolve19(trackedPath) : resolve19(baseDirectory, trackedPath);
+ return isAbsolute12(trackedPath) ? resolve19(trackedPath) : resolve19(baseDirectory, trackedPath);
}
function resolveBoulderPlanPath(directory, state) {
const absolutePlanPath = resolveTrackedPath(directory, state.active_plan);
@@ -97317,7 +97581,7 @@ function resolveBoulderPlanPath(directory, state) {
}
const absoluteDirectory = resolve19(directory);
const relativePlanPath = relative8(absoluteDirectory, absolutePlanPath);
- if (relativePlanPath.length === 0 || relativePlanPath.startsWith("..") || isAbsolute11(relativePlanPath)) {
+ if (relativePlanPath.length === 0 || relativePlanPath.startsWith("..") || isAbsolute12(relativePlanPath)) {
return absolutePlanPath;
}
const absoluteWorktreePath = resolveTrackedPath(directory, worktreePath);
@@ -97328,7 +97592,7 @@ function resolveBoulderPlanPathForWork(directory, work) {
return resolveBoulderPlanPath(directory, work);
}
// packages/boulder-state/src/storage/plan-progress.ts
-import { existsSync as existsSync39, readFileSync as readFileSync19, readdirSync as readdirSync5, statSync as statSync5 } from "fs";
+import { existsSync as existsSync39, readFileSync as readFileSync20, readdirSync as readdirSync5, statSync as statSync5 } from "fs";
var TODO_HEADING_PATTERN2 = /^##\s+TODOs\b/i;
var FINAL_VERIFICATION_HEADING_PATTERN2 = /^##\s+Final Verification Wave\b/i;
var SECOND_LEVEL_HEADING_PATTERN2 = /^##\s+/;
@@ -97341,7 +97605,7 @@ function getPlanProgress(planPath) {
return { total: 0, completed: 0, isComplete: false };
}
try {
- const content = readFileSync19(planPath, "utf-8");
+ const content = readFileSync20(planPath, "utf-8");
const lines = content.split(/\r?\n/);
const hasStructuredSections = lines.some((line) => TODO_HEADING_PATTERN2.test(line) || FINAL_VERIFICATION_HEADING_PATTERN2.test(line));
if (hasStructuredSections) {
@@ -97457,14 +97721,14 @@ function selectMirrorWork(state) {
return sorted[0] ?? null;
}
// packages/boulder-state/src/storage/read-state.ts
-import { existsSync as existsSync40, readFileSync as readFileSync20 } from "fs";
+import { existsSync as existsSync40, readFileSync as readFileSync21 } from "fs";
function readBoulderState(directory) {
const filePath = getBoulderFilePath(directory);
if (!existsSync40(filePath)) {
return null;
}
try {
- const content = readFileSync20(filePath, "utf-8");
+ const content = readFileSync21(filePath, "utf-8");
const parsed = JSON.parse(content);
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
return null;
@@ -97530,17 +97794,17 @@ init_state();
// packages/omo-opencode/src/features/run-continuation-state/constants.ts
var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
// packages/omo-opencode/src/features/run-continuation-state/storage.ts
-import { existsSync as existsSync41, mkdirSync as mkdirSync11, readFileSync as readFileSync21, rmSync as rmSync2, writeFileSync as writeFileSync6 } from "fs";
-import { join as join62 } from "path";
+import { existsSync as existsSync41, mkdirSync as mkdirSync11, readFileSync as readFileSync22, rmSync as rmSync2, writeFileSync as writeFileSync6 } from "fs";
+import { join as join64 } from "path";
function getMarkerPath(directory, sessionID) {
- return join62(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
+ return join64(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
}
function readContinuationMarker(directory, sessionID) {
const markerPath = getMarkerPath(directory, sessionID);
if (!existsSync41(markerPath))
return null;
try {
- const raw = readFileSync21(markerPath, "utf-8");
+ const raw = readFileSync22(markerPath, "utf-8");
const parsed = JSON.parse(raw);
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
return null;
@@ -97605,8 +97869,8 @@ async function isSessionInBoulderLineage(input) {
// packages/omo-opencode/src/hooks/atlas/session-last-agent.ts
init_shared();
init_compaction_marker();
-import { readFileSync as readFileSync22, readdirSync as readdirSync6 } from "fs";
-import { join as join63 } from "path";
+import { readFileSync as readFileSync23, readdirSync as readdirSync6 } from "fs";
+import { join as join65 } from "path";
var defaultSessionLastAgentDeps = {
getMessageDir,
isSqliteBackend,
@@ -97666,7 +97930,7 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
try {
const messages = readdirSync6(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
try {
- const content = readFileSync22(join63(messageDir, fileName), "utf-8");
+ const content = readFileSync23(join65(messageDir, fileName), "utf-8");
const parsed = JSON.parse(content);
return {
fileName,
@@ -97709,8 +97973,8 @@ init_agent_display_names();
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
init_frontmatter2();
-import { existsSync as existsSync42, readFileSync as readFileSync23, writeFileSync as writeFileSync7, unlinkSync as unlinkSync5, mkdirSync as mkdirSync12 } from "fs";
-import { dirname as dirname23, join as join64 } from "path";
+import { existsSync as existsSync42, readFileSync as readFileSync24, writeFileSync as writeFileSync7, unlinkSync as unlinkSync5, mkdirSync as mkdirSync12 } from "fs";
+import { dirname as dirname24, join as join66 } from "path";
// packages/omo-opencode/src/hooks/ralph-loop/constants.ts
var DEFAULT_STATE_FILE = ".omo/ralph-loop.local.md";
@@ -97719,7 +97983,7 @@ var DEFAULT_COMPLETION_PROMISE = "DONE";
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
function getStateFilePath(directory, customPath) {
- return customPath ? join64(directory, customPath) : join64(directory, DEFAULT_STATE_FILE);
+ return customPath ? join66(directory, customPath) : join66(directory, DEFAULT_STATE_FILE);
}
function readState(directory, customPath) {
const filePath = getStateFilePath(directory, customPath);
@@ -97727,7 +97991,7 @@ function readState(directory, customPath) {
return null;
}
try {
- const content = readFileSync23(filePath, "utf-8");
+ const content = readFileSync24(filePath, "utf-8");
const { data, body } = parseFrontmatter(content);
const active = data.active;
const iteration = data.iteration;
@@ -98802,14 +99066,14 @@ async function getLocalVersion(options = {}) {
}
}
// packages/omo-opencode/src/cli/doctor/checks/system.ts
-import { existsSync as existsSync53, readFileSync as readFileSync33 } from "fs";
+import { existsSync as existsSync53, readFileSync as readFileSync34 } from "fs";
// packages/omo-opencode/src/cli/doctor/checks/system-binary.ts
init_extract_semver();
init_bun_which_shim();
import { existsSync as existsSync50, accessSync as accessSync4, constants as constants10 } from "fs";
import { homedir as homedir14 } from "os";
-import { join as join71 } from "path";
+import { join as join73 } from "path";
// packages/omo-opencode/src/cli/doctor/framework/spawn-with-timeout.ts
init_spawn_with_windows_hide();
@@ -98901,17 +99165,17 @@ function getDesktopAppPaths(platform) {
case "darwin":
return [
"/Applications/OpenCode.app/Contents/MacOS/OpenCode",
- join71(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
+ join73(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
];
case "win32": {
const programFiles = process.env.ProgramFiles;
const localAppData = process.env.LOCALAPPDATA;
const paths = [];
if (programFiles) {
- paths.push(join71(programFiles, "OpenCode", "OpenCode.exe"));
+ paths.push(join73(programFiles, "OpenCode", "OpenCode.exe"));
}
if (localAppData) {
- paths.push(join71(localAppData, "OpenCode", "OpenCode.exe"));
+ paths.push(join73(localAppData, "OpenCode", "OpenCode.exe"));
}
return paths;
}
@@ -98919,8 +99183,8 @@ function getDesktopAppPaths(platform) {
return [
"/usr/bin/opencode",
"/usr/lib/opencode/opencode",
- join71(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
- join71(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
+ join73(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
+ join73(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
];
default:
return [];
@@ -98952,7 +99216,7 @@ async function findOpenCodeBinary(platform = process.platform, checkExists = exi
const candidates = getCommandCandidates2(platform);
for (const entry of pathEnv.split(delimiter3).filter(Boolean)) {
for (const command of candidates) {
- const fullPath = join71(entry, command);
+ const fullPath = join73(entry, command);
if (checkExists(fullPath) && isExecutable2(fullPath)) {
return { binary: command, path: fullPath };
}
@@ -98998,7 +99262,7 @@ function compareVersions3(current, minimum) {
// packages/omo-opencode/src/cli/doctor/checks/system-plugin.ts
init_shared();
-import { existsSync as existsSync51, readFileSync as readFileSync31 } from "fs";
+import { existsSync as existsSync51, readFileSync as readFileSync32 } from "fs";
function detectConfigPath() {
const paths = getOpenCodeConfigPaths({ binary: "opencode", version: null });
if (existsSync51(paths.configJsonc))
@@ -99049,7 +99313,7 @@ function getPluginInfo() {
};
}
try {
- const content = readFileSync31(configPath, "utf-8");
+ const content = readFileSync32(configPath, "utf-8");
const parsedConfig = parseJsonc(content);
const pluginEntry = findPluginEntry2(parsedConfig.plugin ?? []);
if (!pluginEntry) {
@@ -99091,25 +99355,25 @@ init_file_utils2();
init_checker();
init_auto_update_checker();
init_package_json_locator();
-import { existsSync as existsSync52, readFileSync as readFileSync32, readdirSync as readdirSync8 } from "fs";
+import { existsSync as existsSync52, readFileSync as readFileSync33, readdirSync as readdirSync8 } from "fs";
import { createRequire as createRequire2 } from "module";
import { homedir as homedir15 } from "os";
-import { join as join72 } from "path";
+import { join as join74 } from "path";
import { fileURLToPath as fileURLToPath6 } from "url";
init_shared();
function getPlatformDefaultCacheDir(platform = process.platform) {
if (platform === "darwin")
- return join72(homedir15(), "Library", "Caches");
+ return join74(homedir15(), "Library", "Caches");
if (platform === "win32")
- return process.env.LOCALAPPDATA ?? join72(homedir15(), "AppData", "Local");
- return join72(homedir15(), ".cache");
+ return process.env.LOCALAPPDATA ?? join74(homedir15(), "AppData", "Local");
+ return join74(homedir15(), ".cache");
}
function resolveOpenCodeCacheDir() {
const xdgCacheHome = process.env.XDG_CACHE_HOME;
if (xdgCacheHome)
- return join72(xdgCacheHome, "opencode");
+ return join74(xdgCacheHome, "opencode");
const fromShared = getOpenCodeCacheDir();
- const platformDefault = join72(getPlatformDefaultCacheDir(), "opencode");
+ const platformDefault = join74(getPlatformDefaultCacheDir(), "opencode");
if (existsSync52(fromShared) || !existsSync52(platformDefault))
return fromShared;
return platformDefault;
@@ -99123,7 +99387,7 @@ function readPackageJson(filePath) {
if (!existsSync52(filePath))
return null;
try {
- const content = readFileSync32(filePath, "utf-8");
+ const content = readFileSync33(filePath, "utf-8");
return parseJsonc(content);
} catch (error51) {
if (!(error51 instanceof Error)) {
@@ -99141,11 +99405,11 @@ function normalizeVersion(value) {
function createPackageCandidates(rootDir) {
return ACCEPTED_PACKAGE_NAMES.map((packageName) => ({
packageName,
- installedPackagePath: join72(rootDir, "node_modules", packageName, "package.json")
+ installedPackagePath: join74(rootDir, "node_modules", packageName, "package.json")
}));
}
function createTaggedInstallCandidates(rootDir) {
- const packagesDir = join72(rootDir, "packages");
+ const packagesDir = join74(rootDir, "packages");
if (!existsSync52(packagesDir))
return [];
const candidates = [];
@@ -99153,14 +99417,14 @@ function createTaggedInstallCandidates(rootDir) {
const packageName = ACCEPTED_PACKAGE_NAMES.find((name) => entryName.startsWith(`${name}@`));
if (packageName === undefined)
continue;
- const installDir = join72(packagesDir, entryName);
+ const installDir = join74(packagesDir, entryName);
candidates.push({
cacheDir: installDir,
- cachePackagePath: join72(installDir, "package.json"),
+ cachePackagePath: join74(installDir, "package.json"),
packageCandidates: [
{
packageName,
- installedPackagePath: join72(installDir, "node_modules", packageName, "package.json")
+ installedPackagePath: join74(installDir, "node_modules", packageName, "package.json")
}
]
});
@@ -99205,13 +99469,13 @@ function getLoadedPluginVersion() {
const candidates = [
{
cacheDir: configDir,
- cachePackagePath: join72(configDir, "package.json"),
+ cachePackagePath: join74(configDir, "package.json"),
packageCandidates: createPackageCandidates(configDir)
},
...createTaggedInstallCandidates(configDir),
{
cacheDir,
- cachePackagePath: join72(cacheDir, "package.json"),
+ cachePackagePath: join74(cacheDir, "package.json"),
packageCandidates: createPackageCandidates(cacheDir)
},
...createTaggedInstallCandidates(cacheDir)
@@ -99257,7 +99521,7 @@ var defaultDeps6 = {
getLatestPluginVersion,
getSuggestedInstallTag,
configExists: existsSync53,
- readConfigFile: (path14) => readFileSync33(path14, "utf-8"),
+ readConfigFile: (path14) => readFileSync34(path14, "utf-8"),
parseConfigContent: (content) => parseJsonc(content)
};
var BUN_POSTINSTALL_HELPER_PACKAGE_NAME = "@code-yeongyu/comment-checker";
@@ -99402,9 +99666,9 @@ async function checkSystem(deps = defaultDeps6) {
// packages/omo-opencode/src/config/validate.ts
init_src();
-import { readFileSync as readFileSync34 } from "fs";
+import { readFileSync as readFileSync35 } from "fs";
import { homedir as homedir16 } from "os";
-import { dirname as dirname28, relative as relative9 } from "path";
+import { dirname as dirname29, relative as relative9 } from "path";
init_shared();
init_plugin_identity();
function resolveHomeDirectory2() {
@@ -99428,7 +99692,7 @@ function discoverProjectLayersNearestFirst(directory) {
const stopDirectory = containsPath(homeDirectory, directory) ? homeDirectory : directory;
return findProjectOpencodePluginConfigFiles(directory, stopDirectory).map((configPath) => ({
path: configPath,
- configDir: dirname28(configPath)
+ configDir: dirname29(configPath)
}));
}
function shortPath(configPath) {
@@ -99447,12 +99711,12 @@ function schemaMessages(configPath, rawConfig) {
}
function parseLayerConfig(configPath) {
try {
- const content = readFileSync34(configPath, "utf-8");
+ const content = readFileSync35(configPath, "utf-8");
const rawConfig = parseJsonc(content);
if (!isPlainRecord(rawConfig)) {
return {
path: configPath,
- configDir: dirname28(configPath),
+ configDir: dirname29(configPath),
config: null,
messages: [`${shortPath(configPath)}: <root>: Expected object`]
};
@@ -99460,7 +99724,7 @@ function parseLayerConfig(configPath) {
const result = OhMyOpenCodeConfigSchema.safeParse(rawConfig);
return {
path: configPath,
- configDir: dirname28(configPath),
+ configDir: dirname29(configPath),
config: result.success ? result.data : parseConfigPartially(rawConfig),
messages: schemaMessages(configPath, rawConfig)
};
@@ -99470,7 +99734,7 @@ function parseLayerConfig(configPath) {
}
return {
path: configPath,
- configDir: dirname28(configPath),
+ configDir: dirname29(configPath),
config: null,
messages: [`${shortPath(configPath)}: ${error51.message}`]
};
@@ -99516,26 +99780,26 @@ function validatePluginConfig(directory) {
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-cache.ts
init_shared();
-import { existsSync as existsSync54, readFileSync as readFileSync35 } from "fs";
+import { existsSync as existsSync54, readFileSync as readFileSync36 } from "fs";
import { homedir as homedir17 } from "os";
-import { join as join73 } from "path";
+import { join as join75 } from "path";
function getUserConfigDir2() {
const xdgConfig = process.env.XDG_CONFIG_HOME;
if (xdgConfig)
- return join73(xdgConfig, "opencode");
- return join73(homedir17(), ".config", "opencode");
+ return join75(xdgConfig, "opencode");
+ return join75(homedir17(), ".config", "opencode");
}
function loadCustomProviderNames() {
const configDir = getUserConfigDir2();
const candidatePaths = [
- join73(configDir, "opencode.json"),
- join73(configDir, "opencode.jsonc")
+ join75(configDir, "opencode.json"),
+ join75(configDir, "opencode.jsonc")
];
for (const configPath of candidatePaths) {
if (!existsSync54(configPath))
continue;
try {
- const content = readFileSync35(configPath, "utf-8");
+ const content = readFileSync36(configPath, "utf-8");
const data = parseJsonc(content);
if (data?.provider && typeof data.provider === "object") {
return Object.keys(data.provider);
@@ -99550,7 +99814,7 @@ function loadCustomProviderNames() {
return [];
}
function loadAvailableModelsFromCache() {
- const cacheFile = join73(getOpenCodeCacheDir(), "models.json");
+ const cacheFile = join75(getOpenCodeCacheDir(), "models.json");
const customProviders = loadCustomProviderNames();
if (!existsSync54(cacheFile)) {
if (customProviders.length > 0) {
@@ -99559,7 +99823,7 @@ function loadAvailableModelsFromCache() {
return { providers: [], modelCount: 0, cacheExists: false };
}
try {
- const content = readFileSync35(cacheFile, "utf-8");
+ const content = readFileSync36(cacheFile, "utf-8");
const data = parseJsonc(content);
const cacheProviders = Object.keys(data);
let modelCount = 0;
@@ -99586,9 +99850,9 @@ init_model_capabilities2();
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-config.ts
init_shared();
init_plugin_identity();
-import { readFileSync as readFileSync36 } from "fs";
-import { join as join74 } from "path";
-var PROJECT_CONFIG_DIR = join74(process.cwd(), ".opencode");
+import { readFileSync as readFileSync37 } from "fs";
+import { join as join76 } from "path";
+var PROJECT_CONFIG_DIR = join76(process.cwd(), ".opencode");
function loadOmoConfig() {
const projectDetected = detectPluginConfigFile(PROJECT_CONFIG_DIR, {
basenames: [CONFIG_BASENAME],
@@ -99596,7 +99860,7 @@ function loadOmoConfig() {
});
if (projectDetected.format !== "none") {
try {
- const content = readFileSync36(projectDetected.path, "utf-8");
+ const content = readFileSync37(projectDetected.path, "utf-8");
return parseJsonc(content);
} catch (error51) {
if (error51 instanceof Error) {
@@ -99612,7 +99876,7 @@ function loadOmoConfig() {
});
if (userDetected.format !== "none") {
try {
- const content = readFileSync36(userDetected.path, "utf-8");
+ const content = readFileSync37(userDetected.path, "utf-8");
return parseJsonc(content);
} catch (error51) {
if (error51 instanceof Error) {
@@ -99626,7 +99890,7 @@ function loadOmoConfig() {
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-details.ts
init_shared();
-import { join as join75 } from "path";
+import { join as join77 } from "path";
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-variant.ts
function formatModelWithVariant(model, variant) {
@@ -99668,7 +99932,7 @@ function formatCapabilityResolutionLabel(mode) {
}
function buildModelResolutionDetails(options) {
const details = [];
- const cacheFile = join75(getOpenCodeCacheDir(), "models.json");
+ const cacheFile = join77(getOpenCodeCacheDir(), "models.json");
details.push("\u2550\u2550\u2550 Available Models (from cache) \u2550\u2550\u2550");
details.push("");
if (options.available.cacheExists) {
@@ -99947,25 +100211,25 @@ init_src();
import { existsSync as existsSync55 } from "fs";
import { createRequire as createRequire3 } from "module";
import { homedir as homedir19 } from "os";
-import { dirname as dirname29, join as join77 } from "path";
+import { dirname as dirname30, join as join79 } from "path";
// packages/omo-opencode/src/hooks/comment-checker/downloader.ts
-import { join as join76 } from "path";
+import { join as join78 } from "path";
import { homedir as homedir18, tmpdir as tmpdir3 } from "os";
init_binary_downloader();
init_logger2();
init_plugin_identity();
var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
-var DEBUG_FILE = join76(tmpdir3(), "comment-checker-debug.log");
+var DEBUG_FILE = join78(tmpdir3(), "comment-checker-debug.log");
function getCacheDir2() {
if (process.platform === "win32") {
const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
- const base2 = localAppData || join76(homedir18(), "AppData", "Local");
- return join76(base2, CACHE_DIR_NAME, "bin");
+ const base2 = localAppData || join78(homedir18(), "AppData", "Local");
+ return join78(base2, CACHE_DIR_NAME, "bin");
}
const xdgCache = process.env.XDG_CACHE_HOME;
- const base = xdgCache || join76(homedir18(), ".cache");
- return join76(base, CACHE_DIR_NAME, "bin");
+ const base = xdgCache || join78(homedir18(), ".cache");
+ return join78(base, CACHE_DIR_NAME, "bin");
}
function getBinaryName() {
return process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
@@ -100015,7 +100279,7 @@ async function getBinaryVersion(binary) {
}
}
async function checkAstGrepCli() {
- const runtimeDir = astGrepRuntimeDir(join77(homedir19(), ".omo"));
+ const runtimeDir = astGrepRuntimeDir(join79(homedir19(), ".omo"));
const sgPath = findSgBinarySync({ runtimeDir });
if (sgPath === null) {
return {
@@ -100044,11 +100308,11 @@ function findCommentCheckerPackageBinary(baseDirOverride, resolvePackageJsonPath
const binaryName = process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
const platformKey = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
try {
- const packageDir = baseDirOverride ?? dirname29(resolvePackageJsonPath());
- const vendorPath = join77(packageDir, "vendor", platformKey, binaryName);
+ const packageDir = baseDirOverride ?? dirname30(resolvePackageJsonPath());
+ const vendorPath = join79(packageDir, "vendor", platformKey, binaryName);
if (existsSync55(vendorPath))
return vendorPath;
- const binPath = join77(packageDir, "bin", binaryName);
+ const binPath = join79(packageDir, "bin", binaryName);
if (existsSync55(binPath))
return binPath;
} catch (error51) {
@@ -100193,12 +100457,12 @@ async function getGhCliInfo(dependencies = {}) {
}
// packages/omo-opencode/src/cli/doctor/checks/tools-lsp.ts
-import { readFileSync as readFileSync37 } from "fs";
-import { join as join78 } from "path";
+import { readFileSync as readFileSync38 } from "fs";
+import { join as join80 } from "path";
// packages/omo-opencode/src/mcp/lsp.ts
import { existsSync as existsSync56 } from "fs";
-import { delimiter as delimiter3, dirname as dirname30, resolve as resolve21 } from "path";
+import { delimiter as delimiter3, dirname as dirname31, resolve as resolve21 } from "path";
import { fileURLToPath as fileURLToPath7 } from "url";
// packages/omo-opencode/src/mcp/cli-suffix.ts
@@ -100320,7 +100584,7 @@ var LSP_BOOTSTRAP_SCRIPT = [
].join(";");
function getModuleDirectory(moduleUrl) {
try {
- return dirname30(fileURLToPath7(moduleUrl));
+ return dirname31(fileURLToPath7(moduleUrl));
} catch (error51) {
if (!(error51 instanceof Error))
throw error51;
@@ -100390,7 +100654,7 @@ function readOmoConfig(configDirectory) {
return null;
}
try {
- const content = readFileSync37(detected.path, "utf-8");
+ const content = readFileSync38(detected.path, "utf-8");
return parseJsonc(content);
} catch (error51) {
if (!(error51 instanceof Error)) {
@@ -100401,7 +100665,7 @@ function readOmoConfig(configDirectory) {
}
function isLspMcpDisabled(options) {
const userConfigDirectory = options.configDirectory ?? getOpenCodeConfigDir({ binary: "opencode" });
- const projectConfigDirectory = join78(options.cwd ?? process.cwd(), ".opencode");
+ const projectConfigDirectory = join80(options.cwd ?? process.cwd(), ".opencode");
const userConfig = readOmoConfig(userConfigDirectory);
const projectConfig = readOmoConfig(projectConfigDirectory);
const disabledMcps = new Set([
@@ -100420,15 +100684,15 @@ function getInstalledLspServers(options = {}) {
// packages/omo-opencode/src/cli/doctor/checks/tools-mcp.ts
init_shared();
-import { existsSync as existsSync57, readFileSync as readFileSync38 } from "fs";
+import { existsSync as existsSync57, readFileSync as readFileSync39 } from "fs";
import { homedir as homedir20 } from "os";
-import { join as join79 } from "path";
+import { join as join81 } from "path";
var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
function getMcpConfigPaths() {
return [
- join79(homedir20(), ".claude", ".mcp.json"),
- join79(process.cwd(), ".mcp.json"),
- join79(process.cwd(), ".claude", ".mcp.json")
+ join81(homedir20(), ".claude", ".mcp.json"),
+ join81(process.cwd(), ".mcp.json"),
+ join81(process.cwd(), ".claude", ".mcp.json")
];
}
function loadUserMcpConfig() {
@@ -100437,7 +100701,7 @@ function loadUserMcpConfig() {
if (!existsSync57(configPath))
continue;
try {
- const content = readFileSync38(configPath, "utf-8");
+ const content = readFileSync39(configPath, "utf-8");
const config3 = parseJsonc(content);
if (config3.mcpServers) {
Object.assign(servers, config3.mcpServers);
@@ -100572,7 +100836,7 @@ async function checkTools() {
// packages/omo-opencode/src/cli/doctor/checks/telemetry.ts
init_src4();
-import { existsSync as existsSync58, readFileSync as readFileSync39 } from "fs";
+import { existsSync as existsSync58, readFileSync as readFileSync40 } from "fs";
function isTelemetryState(value) {
return value !== null && typeof value === "object" && !Array.isArray(value);
}
@@ -100582,7 +100846,7 @@ function readLastActiveDay(stateFilePath) {
}
let parsed;
try {
- parsed = JSON.parse(readFileSync39(stateFilePath, "utf-8"));
+ parsed = JSON.parse(readFileSync40(stateFilePath, "utf-8"));
} catch (error51) {
if (error51 instanceof Error) {
return "unreadable";
@@ -100657,7 +100921,7 @@ function expandHomeDirectory(directoryPath) {
// packages/omo-opencode/src/cli/doctor/checks/team-mode.ts
init_shared();
init_plugin_identity();
-import { readFileSync as readFileSync40, promises as fs13 } from "fs";
+import { readFileSync as readFileSync41, promises as fs13 } from "fs";
import path15 from "path";
async function checkTeamMode() {
const config3 = loadTeamModeConfig();
@@ -100694,7 +100958,7 @@ function loadTeamModeConfig() {
if (!configPath)
return { team_mode: undefined };
try {
- return parseJsonc(readFileSync40(configPath, "utf-8"));
+ return parseJsonc(readFileSync41(configPath, "utf-8"));
} catch (error51) {
if (error51 instanceof Error) {
return { team_mode: undefined };
@@ -100728,9 +100992,9 @@ async function pathExists(dir) {
// packages/omo-opencode/src/cli/doctor/checks/codex.ts
init_src();
import { existsSync as existsSync59 } from "fs";
-import { lstat as lstat12, readdir as readdir10, readFile as readFile23 } from "fs/promises";
+import { lstat as lstat13, readdir as readdir11, readFile as readFile23 } from "fs/promises";
import { homedir as homedir22 } from "os";
-import { basename as basename13, join as join80, resolve as resolve22 } from "path";
+import { basename as basename13, join as join82, resolve as resolve22 } from "path";
// packages/omo-opencode/package.json
var package_default3 = {
name: "@oh-my-opencode/omo-opencode",
@@ -100788,13 +101052,13 @@ var CODEX_BIN_NAMES = [
"omo-git-bash-hook"
];
async function gatherCodexSummary(deps = {}) {
- const codexHome = resolve22(deps.codexHome ?? process.env.CODEX_HOME ?? join80(homedir22(), ".codex"));
+ const codexHome = resolve22(deps.codexHome ?? process.env.CODEX_HOME ?? join82(homedir22(), ".codex"));
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
const detection = await (deps.detectCodexInstallation ?? detectCodexInstallation)();
const pluginRoot = await resolveInstalledPluginRoot(codexHome);
- const manifest = pluginRoot === null ? null : await readJson(join80(pluginRoot, ".codex-plugin", "plugin.json"));
- const installSnapshot = pluginRoot === null ? null : await readJson(join80(pluginRoot, "lazycodex-install.json"));
- const configPath = join80(codexHome, "config.toml");
+ const manifest = pluginRoot === null ? null : await readJson(join82(pluginRoot, ".codex-plugin", "plugin.json"));
+ const installSnapshot = pluginRoot === null ? null : await readJson(join82(pluginRoot, "lazycodex-install.json"));
+ const configPath = join82(codexHome, "config.toml");
const pluginVersion = stringField(manifest, "version");
return {
codexPath: detection.found && "path" in detection ? detection.path : null,
@@ -100851,7 +101115,7 @@ function buildCodexIssues(summary) {
if (summary.pluginRoot === null) {
issues.push({
title: "OMO Codex plugin is not installed",
- description: `Expected cached plugin at ${join80("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
+ description: `Expected cached plugin at ${join82("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
fix: "Run: npx lazycodex-ai install",
severity: "error",
affects: ["plugin loading"]
@@ -100916,12 +101180,12 @@ function buildCodexIssues(summary) {
return issues;
}
async function resolveInstalledPluginRoot(codexHome) {
- const pluginRoot = join80(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
+ const pluginRoot = join82(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
if (!existsSync59(pluginRoot))
return null;
- const versions2 = await readdir10(pluginRoot, { withFileTypes: true });
+ const versions2 = await readdir11(pluginRoot, { withFileTypes: true });
const candidates = versions2.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionsDescending);
- return candidates.length === 0 ? null : join80(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
+ return candidates.length === 0 ? null : join82(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
}
async function readCodexConfigSummary(configPath) {
if (!existsSync59(configPath)) {
@@ -100949,16 +101213,16 @@ async function readCodexConfigSummary(configPath) {
async function readLinkedBins(binDir) {
const linked = [];
for (const name of CODEX_BIN_NAMES) {
- if (await pathExists2(join80(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
+ if (await pathExists2(join82(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
linked.push(name);
}
return linked;
}
async function readLinkedAgents(codexHome) {
- const agentsDir = join80(codexHome, "agents");
+ const agentsDir = join82(codexHome, "agents");
if (!existsSync59(agentsDir))
return [];
- const entries = await readdir10(agentsDir, { withFileTypes: true });
+ const entries = await readdir11(agentsDir, { withFileTypes: true });
return entries.filter((entry) => entry.isFile() || entry.isSymbolicLink()).map((entry) => basename13(entry.name, ".toml")).sort();
}
async function readJson(path16) {
@@ -101058,7 +101322,7 @@ function compareVersionsDescending(left, right) {
}
async function pathExists2(path16) {
try {
- await lstat12(path16);
+ await lstat13(path16);
return true;
} catch (error51) {
if (error51 instanceof Error)
@@ -101069,9 +101333,9 @@ async function pathExists2(path16) {
// packages/omo-opencode/src/cli/doctor/checks/codex-components.ts
init_src();
-import { readdir as readdir11, readFile as readFile24, stat as stat6 } from "fs/promises";
+import { readdir as readdir12, readFile as readFile24, stat as stat6 } from "fs/promises";
import { homedir as homedir23 } from "os";
-import { dirname as dirname31, isAbsolute as isAbsolute12, join as join81, relative as relative10, resolve as resolve23, sep as sep9 } from "path";
+import { dirname as dirname32, isAbsolute as isAbsolute13, join as join83, relative as relative10, resolve as resolve23, sep as sep9 } from "path";
var CODEX_COMPONENTS_CHECK_ID = "codex-components";
var CODEX_COMPONENTS_CHECK_NAME = "codex-components";
var PLUGIN_DATA_DIR_NAME = "omo-sisyphuslabs";
@@ -101081,7 +101345,7 @@ async function checkCodexComponents(deps = {}) {
const env3 = deps.env ?? process.env;
const platform = deps.platform ?? process.platform;
const arch = deps.arch ?? process.arch;
- const codexHome = resolve23(deps.codexHome ?? env3["CODEX_HOME"] ?? join81(homedir23(), ".codex"));
+ const codexHome = resolve23(deps.codexHome ?? env3["CODEX_HOME"] ?? join83(homedir23(), ".codex"));
const summary = await gatherCodexSummary({ ...deps, codexHome });
if (summary.pluginRoot === null) {
return {
@@ -101106,7 +101370,7 @@ async function checkCodexComponents(deps = {}) {
});
}
const runtimeSgDir = runtimeSgDirectory(codexHome, platform, arch);
- const runtimeSgPath = join81(runtimeSgDir, sgBinaryName(platform));
+ const runtimeSgPath = join83(runtimeSgDir, sgBinaryName(platform));
const sg = findSgBinarySync({
arch,
env: env3,
@@ -101143,12 +101407,12 @@ async function auditBundleTargets(pluginRoot) {
let referencedCount = 0;
for (const manifestPath of await findManifestPaths(pluginRoot, ".mcp.json")) {
const manifest = await readJson2(manifestPath);
- if (manifest === null || !isRecord5(manifest["mcpServers"]))
+ if (manifest === null || !isRecord6(manifest["mcpServers"]))
continue;
- const manifestRoot = dirname31(manifestPath);
+ const manifestRoot = dirname32(manifestPath);
const isRootManifest = resolve23(manifestRoot) === resolve23(pluginRoot);
for (const server2 of Object.values(manifest["mcpServers"])) {
- if (!isRecord5(server2) || !Array.isArray(server2["args"]))
+ if (!isRecord6(server2) || !Array.isArray(server2["args"]))
continue;
for (const arg of server2["args"]) {
if (typeof arg !== "string" || !isPluginRuntimePathArg(arg))
@@ -101166,7 +101430,7 @@ async function auditBundleTargets(pluginRoot) {
continue;
const commands2 = [];
collectHookCommands(manifest, commands2);
- const hookPluginRoot = dirname31(dirname31(hookManifestPath));
+ const hookPluginRoot = dirname32(dirname32(hookManifestPath));
for (const command of commands2) {
for (const relativePath of extractPluginRootPaths(command)) {
referencedCount += 1;
@@ -101205,12 +101469,12 @@ async function classifyBundleTarget(bundleRoot, baseRoot, relativePath, allowEsc
}
async function findHookManifestPaths(root) {
const paths2 = await findManifestPaths(root, "hooks.json");
- return paths2.filter((path16) => dirname31(path16).endsWith(`${sep9}hooks`));
+ return paths2.filter((path16) => dirname32(path16).endsWith(`${sep9}hooks`));
}
async function findManifestPaths(root, manifestName) {
let entries;
try {
- entries = await readdir11(root, { withFileTypes: true });
+ entries = await readdir12(root, { withFileTypes: true });
} catch {
return [];
}
@@ -101218,7 +101482,7 @@ async function findManifestPaths(root, manifestName) {
for (const entry of entries) {
if (entry.name === "node_modules" || entry.name === ".git")
continue;
- const entryPath = join81(root, entry.name);
+ const entryPath = join83(root, entry.name);
if (entry.isDirectory()) {
paths2.push(...await findManifestPaths(entryPath, manifestName));
continue;
@@ -101234,7 +101498,7 @@ function collectHookCommands(value, commands2) {
collectHookCommands(item, commands2);
return;
}
- if (!isRecord5(value))
+ if (!isRecord6(value))
return;
if (value["type"] === "command") {
if (typeof value["command"] === "string")
@@ -101259,21 +101523,21 @@ function extractPluginRootPaths(command) {
}
function isPluginRuntimePathArg(arg) {
const normalized = normalizePathSeparators(arg);
- return normalized.endsWith(".js") && normalized.includes("/dist/") && (normalized.startsWith("./") || normalized.startsWith("../") || normalized.startsWith("components/") || normalized.startsWith("/") || isAbsolute12(arg));
+ return normalized.endsWith(".js") && normalized.includes("/dist/") && (normalized.startsWith("./") || normalized.startsWith("../") || normalized.startsWith("components/") || normalized.startsWith("/") || isAbsolute13(arg));
}
function runtimeSgDirectory(codexHome, platform, arch) {
- return join81(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
+ return join83(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
}
function describeSgSource(sgPath, env3, runtimeSgDir, platform) {
const override = env3[SG_PATH_ENV_KEY]?.trim();
if (override !== undefined && override.length > 0 && sgPath === override)
return `env override ${SG_PATH_ENV_KEY}`;
- if (sgPath === join81(runtimeSgDir, sgBinaryName(platform)))
+ if (sgPath === join83(runtimeSgDir, sgBinaryName(platform)))
return "runtime dir";
return "PATH";
}
async function readBootstrapStateSummary(codexHome) {
- const statePath = join81(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
+ const statePath = join83(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
const raw = await readJson2(statePath);
if (raw === null)
return null;
@@ -101289,7 +101553,7 @@ function parseDegradedEntries(value) {
return [];
const entries = [];
for (const item of value) {
- if (!isRecord5(item))
+ if (!isRecord6(item))
continue;
if (typeof item["component"] !== "string" || typeof item["reason"] !== "string")
continue;
@@ -101323,7 +101587,7 @@ function degradedDetailLines(entries) {
async function readJson2(path16) {
try {
const parsed = JSON.parse(await readFile24(path16, "utf8"));
- return isRecord5(parsed) ? parsed : null;
+ return isRecord6(parsed) ? parsed : null;
} catch (error51) {
if (error51 instanceof Error)
return null;
@@ -101344,7 +101608,7 @@ function normalizeRelative(root, target) {
function normalizePathSeparators(path16) {
return path16.split("\\").join("/");
}
-function isRecord5(value) {
+function isRecord6(value) {
return typeof value === "object" && value !== null && !Array.isArray(value);
}
@@ -101352,15 +101616,15 @@ function isRecord5(value) {
import { existsSync as existsSync60 } from "fs";
import { readFile as readFile25 } from "fs/promises";
import { homedir as homedir24 } from "os";
-import { join as join82, resolve as resolve24 } from "path";
+import { join as join84, resolve as resolve24 } from "path";
var RUNTIME_WRAPPER_MARKER2 = "OMO_GENERATED_RUNTIME_WRAPPER";
var CHECK_NAME = "codex-runtime-wrapper";
var REINSTALL_COMMAND = "npx --yes lazycodex-ai@latest install --no-tui";
async function checkCodexRuntimeWrapper(deps = {}) {
- const codexHome = resolve24(deps.codexHome ?? process.env.CODEX_HOME ?? join82(homedir24(), ".codex"));
+ const codexHome = resolve24(deps.codexHome ?? process.env.CODEX_HOME ?? join84(homedir24(), ".codex"));
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
const platform = deps.platform ?? process.platform;
- const wrapperPath = join82(binDir, platform === "win32" ? "omo.cmd" : "omo");
+ const wrapperPath = join84(binDir, platform === "win32" ? "omo.cmd" : "omo");
const wrapper = await readRuntimeWrapper(wrapperPath);
const issues = [];
if (wrapper?.includes(RUNTIME_WRAPPER_MARKER2) === true) {
@@ -101867,17 +102131,17 @@ import {
existsSync as existsSync63,
mkdirSync as mkdirSync14,
readdirSync as readdirSync9,
- readFileSync as readFileSync42,
+ readFileSync as readFileSync43,
renameSync as renameSync7,
unlinkSync as unlinkSync8,
writeFileSync as writeFileSync11
} from "fs";
-import { basename as basename14, dirname as dirname32, join as join85 } from "path";
+import { basename as basename14, dirname as dirname33, join as join87 } from "path";
// packages/mcp-client-core/src/config-dir.ts
import { existsSync as existsSync61, realpathSync as realpathSync8 } from "fs";
import { homedir as homedir25 } from "os";
-import { join as join83, resolve as resolve25 } from "path";
+import { join as join85, resolve as resolve25 } from "path";
function resolveConfigPath2(pathValue) {
const resolvedPath = resolve25(pathValue);
if (!existsSync61(resolvedPath))
@@ -101895,13 +102159,13 @@ function getOpenCodeCliConfigDir(env3 = process.env) {
if (customConfigDir) {
return resolveConfigPath2(customConfigDir);
}
- const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() || join83(homedir25(), ".config");
- return resolveConfigPath2(join83(xdgConfigDir, "opencode"));
+ const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() || join85(homedir25(), ".config");
+ return resolveConfigPath2(join85(xdgConfigDir, "opencode"));
}
// packages/mcp-client-core/src/mcp-oauth/storage-index.ts
-import { chmodSync as chmodSync3, existsSync as existsSync62, readFileSync as readFileSync41, renameSync as renameSync6, writeFileSync as writeFileSync10 } from "fs";
-import { join as join84 } from "path";
+import { chmodSync as chmodSync3, existsSync as existsSync62, readFileSync as readFileSync42, renameSync as renameSync6, writeFileSync as writeFileSync10 } from "fs";
+import { join as join86 } from "path";
var INDEX_FILE_NAME = "index.json";
function isTokenIndex(value) {
if (typeof value !== "object" || value === null || Array.isArray(value))
@@ -101909,14 +102173,14 @@ function isTokenIndex(value) {
return Object.values(value).every((entry) => typeof entry === "string");
}
function getIndexPath(storageDir) {
- return join84(storageDir, INDEX_FILE_NAME);
+ return join86(storageDir, INDEX_FILE_NAME);
}
function readTokenIndex(storageDir) {
const indexPath = getIndexPath(storageDir);
if (!existsSync62(indexPath))
return {};
try {
- const parsed = JSON.parse(readFileSync41(indexPath, "utf-8"));
+ const parsed = JSON.parse(readFileSync42(indexPath, "utf-8"));
return isTokenIndex(parsed) ? parsed : {};
} catch (readError) {
if (!(readError instanceof Error))
@@ -101953,16 +102217,16 @@ function deleteTokenIndexEntry(storageDir, hash2) {
var STORAGE_DIR_NAME = "mcp-oauth";
var LEGACY_STORAGE_FILE_NAME = "mcp-oauth.json";
function getMcpOauthStorageDir() {
- return join85(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
+ return join87(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
}
function getMcpOauthServerHash(serverHost, resource) {
return createHash4("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
}
function getMcpOauthStoragePath(serverHost, resource) {
- return join85(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
+ return join87(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
}
function getLegacyStoragePath() {
- return join85(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
+ return join87(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
}
function normalizeHost2(serverHost) {
let host = serverHost.trim();
@@ -102026,7 +102290,7 @@ function readTokenFile(filePath) {
if (!existsSync63(filePath))
return null;
try {
- const parsed = JSON.parse(readFileSync42(filePath, "utf-8"));
+ const parsed = JSON.parse(readFileSync43(filePath, "utf-8"));
return isOAuthTokenData(parsed) ? parsed : null;
} catch (readError) {
if (!(readError instanceof Error))
@@ -102039,7 +102303,7 @@ function readLegacyStore() {
if (!existsSync63(filePath))
return null;
try {
- const parsed = JSON.parse(readFileSync42(filePath, "utf-8"));
+ const parsed = JSON.parse(readFileSync43(filePath, "utf-8"));
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed))
return null;
const result = {};
@@ -102056,7 +102320,7 @@ function readLegacyStore() {
}
function writeTokenFile(filePath, token) {
try {
- const dir = dirname32(filePath);
+ const dir = dirname33(filePath);
if (!existsSync63(dir)) {
mkdirSync14(dir, { recursive: true });
}
@@ -102141,7 +102405,7 @@ function listTokensByHost(serverHost) {
for (const [hash2, indexedKey] of Object.entries(index)) {
if (!indexedKey.startsWith(prefix))
continue;
- const indexedToken = readTokenFile(join85(getMcpOauthStorageDir(), `${hash2}.json`));
+ const indexedToken = readTokenFile(join87(getMcpOauthStorageDir(), `${hash2}.json`));
if (indexedToken)
result[indexedKey] = indexedToken;
}
@@ -102156,7 +102420,7 @@ function listAllTokens() {
for (const entry of readdirSync9(dir, { withFileTypes: true })) {
if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
continue;
- const token = readTokenFile(join85(dir, entry.name));
+ const token = readTokenFile(join87(dir, entry.name));
const hash2 = basename14(entry.name, ".json");
if (token)
result[index[hash2] ?? hash2] = token;
@@ -102880,7 +103144,7 @@ async function boulder(options) {
}
// packages/omo-opencode/src/cli/codex-ulw-loop.ts
import { spawn as spawn5 } from "child_process";
-import { existsSync as existsSync65, readFileSync as readFileSync43, realpathSync as realpathSync9 } from "fs";
+import { existsSync as existsSync65, readFileSync as readFileSync44, realpathSync as realpathSync9 } from "fs";
import { homedir as homedir26 } from "os";
var ULW_LOOP_DELEGATION_SENTINEL = "OMO_ULW_LOOP_DELEGATED";
function resolveCodexUlwLoopCommand(input = {}) {
@@ -102930,7 +103194,7 @@ function resolveLegacyLocalOmoBin(env3, homeDir, currentExecutablePaths) {
}
function isGeneratedRuntimeWrapper(candidate) {
try {
- return readFileSync43(candidate, "utf8").includes(RUNTIME_WRAPPER_MARKER);
+ return readFileSync44(candidate, "utf8").includes(RUNTIME_WRAPPER_MARKER);
} catch (error51) {
if (error51 instanceof Error)
return false;
diff --git a/plugins/omo/hooks/post-compact-resetting-git-bash-mcp-reminder.json b/plugins/omo/hooks/post-compact-resetting-git-bash-mcp-reminder.json
index 22b83b95..ed2cad95 100644
--- a/plugins/omo/hooks/post-compact-resetting-git-bash-mcp-reminder.json
+++ b/plugins/omo/hooks/post-compact-resetting-git-bash-mcp-reminder.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/git-bash/dist/cli.js\" hook post-compact",
"timeout": 5,
- "statusMessage": "(OmO 4.16.2) Resetting Git Bash MCP Reminder",
+ "statusMessage": "(OmO 4.16.3) Resetting Git Bash MCP Reminder",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\git-bash\\dist\\cli.js\" hook post-compact"
}
],
diff --git a/plugins/omo/hooks/post-compact-resetting-lsp-diagnostics-cache.json b/plugins/omo/hooks/post-compact-resetting-lsp-diagnostics-cache.json
index 21230e5f..9ef966ed 100644
--- a/plugins/omo/hooks/post-compact-resetting-lsp-diagnostics-cache.json
+++ b/plugins/omo/hooks/post-compact-resetting-lsp-diagnostics-cache.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/lsp/dist/cli.js\" hook post-compact",
"timeout": 5,
- "statusMessage": "(OmO 4.16.2) Resetting LSP Diagnostics Cache",
+ "statusMessage": "(OmO 4.16.3) Resetting LSP Diagnostics Cache",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\lsp\\dist\\cli.js\" hook post-compact"
}
],
diff --git a/plugins/omo/hooks/post-compact-resetting-project-rule-cache.json b/plugins/omo/hooks/post-compact-resetting-project-rule-cache.json
index 32baa32b..4718d996 100644
--- a/plugins/omo/hooks/post-compact-resetting-project-rule-cache.json
+++ b/plugins/omo/hooks/post-compact-resetting-project-rule-cache.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/rules/dist/cli.js\" hook post-compact",
"timeout": 10,
- "statusMessage": "(OmO 4.16.2) Resetting Project Rule Cache",
+ "statusMessage": "(OmO 4.16.3) Resetting Project Rule Cache",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\rules\\dist\\cli.js\" hook post-compact"
}
],
diff --git a/plugins/omo/hooks/post-tool-use-checking-codegraph-init-guidance.json b/plugins/omo/hooks/post-tool-use-checking-codegraph-init-guidance.json
index bdf7f210..fbab9f1a 100644
--- a/plugins/omo/hooks/post-tool-use-checking-codegraph-init-guidance.json
+++ b/plugins/omo/hooks/post-tool-use-checking-codegraph-init-guidance.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/codegraph/dist/cli.js\" hook post-tool-use",
"timeout": 5,
- "statusMessage": "(OmO 4.16.2) Checking CodeGraph Init Guidance",
+ "statusMessage": "(OmO 4.16.3) Checking CodeGraph Init Guidance",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\codegraph\\dist\\cli.js\" hook post-tool-use"
}
],
diff --git a/plugins/omo/hooks/post-tool-use-checking-comments.json b/plugins/omo/hooks/post-tool-use-checking-comments.json
index 70450095..c3c5832c 100644
--- a/plugins/omo/hooks/post-tool-use-checking-comments.json
+++ b/plugins/omo/hooks/post-tool-use-checking-comments.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/comment-checker/dist/cli.js\" hook post-tool-use",
"timeout": 30,
- "statusMessage": "(OmO 4.16.2) Checking Comments",
+ "statusMessage": "(OmO 4.16.3) Checking Comments",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\comment-checker\\dist\\cli.js\" hook post-tool-use"
}
],
diff --git a/plugins/omo/hooks/post-tool-use-checking-lsp-diagnostics.json b/plugins/omo/hooks/post-tool-use-checking-lsp-diagnostics.json
index 7d0b4507..4801eb1c 100644
--- a/plugins/omo/hooks/post-tool-use-checking-lsp-diagnostics.json
+++ b/plugins/omo/hooks/post-tool-use-checking-lsp-diagnostics.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/lsp/dist/cli.js\" hook post-tool-use",
"timeout": 60,
- "statusMessage": "(OmO 4.16.2) Checking LSP Diagnostics",
+ "statusMessage": "(OmO 4.16.3) Checking LSP Diagnostics",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\lsp\\dist\\cli.js\" hook post-tool-use"
}
],
diff --git a/plugins/omo/hooks/post-tool-use-checking-thread-title-hygiene.json b/plugins/omo/hooks/post-tool-use-checking-thread-title-hygiene.json
index 434fbcf1..0d438681 100644
--- a/plugins/omo/hooks/post-tool-use-checking-thread-title-hygiene.json
+++ b/plugins/omo/hooks/post-tool-use-checking-thread-title-hygiene.json
@@ -8,7 +8,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/teammode/dist/cli.js\" hook post-tool-use",
"timeout": 10,
- "statusMessage": "(OmO 4.16.2) Checking Thread Title Hygiene",
+ "statusMessage": "(OmO 4.16.3) Checking Thread Title Hygiene",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\teammode\\dist\\cli.js\" hook post-tool-use"
}
]
diff --git a/plugins/omo/hooks/post-tool-use-matching-project-rules.json b/plugins/omo/hooks/post-tool-use-matching-project-rules.json
index eb540be4..bdda165a 100644
--- a/plugins/omo/hooks/post-tool-use-matching-project-rules.json
+++ b/plugins/omo/hooks/post-tool-use-matching-project-rules.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/rules/dist/cli.js\" hook post-tool-use",
"timeout": 10,
- "statusMessage": "(OmO 4.16.2) Matching Project Rules",
+ "statusMessage": "(OmO 4.16.3) Matching Project Rules",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\rules\\dist\\cli.js\" hook post-tool-use"
}
],
diff --git a/plugins/omo/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json b/plugins/omo/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json
index f3df1709..8ec69130 100644
--- a/plugins/omo/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json
+++ b/plugins/omo/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/ulw-loop/dist/cli.js\" hook pre-tool-use",
"timeout": 5,
- "statusMessage": "(OmO 4.16.2) Enforcing Unlimited Goal Budget",
+ "statusMessage": "(OmO 4.16.3) Enforcing Unlimited Goal Budget",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\ulw-loop\\dist\\cli.js\" hook pre-tool-use"
}
],
diff --git a/plugins/omo/hooks/pre-tool-use-recommending-git-bash-mcp.json b/plugins/omo/hooks/pre-tool-use-recommending-git-bash-mcp.json
index 7a9c6c27..5dc245b5 100644
--- a/plugins/omo/hooks/pre-tool-use-recommending-git-bash-mcp.json
+++ b/plugins/omo/hooks/pre-tool-use-recommending-git-bash-mcp.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/git-bash/dist/cli.js\" hook pre-tool-use",
"timeout": 5,
- "statusMessage": "(OmO 4.16.2) Recommending Git Bash MCP",
+ "statusMessage": "(OmO 4.16.3) Recommending Git Bash MCP",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\git-bash\\dist\\cli.js\" hook pre-tool-use"
}
],
diff --git a/plugins/omo/hooks/session-start-checking-auto-update.json b/plugins/omo/hooks/session-start-checking-auto-update.json
index 77d94966..9401224b 100644
--- a/plugins/omo/hooks/session-start-checking-auto-update.json
+++ b/plugins/omo/hooks/session-start-checking-auto-update.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/scripts/auto-update.mjs\" hook session-start",
"timeout": 5,
- "statusMessage": "(OmO 4.16.2) Checking Auto Update",
+ "statusMessage": "(OmO 4.16.3) Checking Auto Update",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\scripts\\auto-update.mjs\" hook session-start"
}
],
diff --git a/plugins/omo/hooks/session-start-checking-bootstrap-provisioning.json b/plugins/omo/hooks/session-start-checking-bootstrap-provisioning.json
index 1ceb568f..2a66ba3c 100644
--- a/plugins/omo/hooks/session-start-checking-bootstrap-provisioning.json
+++ b/plugins/omo/hooks/session-start-checking-bootstrap-provisioning.json
@@ -8,7 +8,7 @@
"command": "node \"${PLUGIN_ROOT}/components/bootstrap/dist/cli.js\" hook session-start",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\bootstrap.ps1\"",
"timeout": 30,
- "statusMessage": "(OmO 4.16.2) Checking Bootstrap Provisioning"
+ "statusMessage": "(OmO 4.16.3) Checking Bootstrap Provisioning"
}
]
}
diff --git a/plugins/omo/hooks/session-start-checking-codegraph-bootstrap.json b/plugins/omo/hooks/session-start-checking-codegraph-bootstrap.json
index 429557f1..d7a12130 100644
--- a/plugins/omo/hooks/session-start-checking-codegraph-bootstrap.json
+++ b/plugins/omo/hooks/session-start-checking-codegraph-bootstrap.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/codegraph/dist/cli.js\" hook session-start",
"timeout": 5,
- "statusMessage": "(OmO 4.16.2) Checking CodeGraph Bootstrap",
+ "statusMessage": "(OmO 4.16.3) Checking CodeGraph Bootstrap",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\codegraph\\dist\\cli.js\" hook session-start"
}
]
diff --git a/plugins/omo/hooks/session-start-loading-project-rules.json b/plugins/omo/hooks/session-start-loading-project-rules.json
index 0ed681f7..0f924622 100644
--- a/plugins/omo/hooks/session-start-loading-project-rules.json
+++ b/plugins/omo/hooks/session-start-loading-project-rules.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/rules/dist/cli.js\" hook session-start",
"timeout": 10,
- "statusMessage": "(OmO 4.16.2) Loading Project Rules",
+ "statusMessage": "(OmO 4.16.3) Loading Project Rules",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\rules\\dist\\cli.js\" hook session-start"
}
]
diff --git a/plugins/omo/hooks/session-start-recording-session-telemetry.json b/plugins/omo/hooks/session-start-recording-session-telemetry.json
index b3e464f2..4435e21e 100644
--- a/plugins/omo/hooks/session-start-recording-session-telemetry.json
+++ b/plugins/omo/hooks/session-start-recording-session-telemetry.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/telemetry/dist/cli.js\" hook session-start",
"timeout": 5,
- "statusMessage": "(OmO 4.16.2) Recording Session Telemetry",
+ "statusMessage": "(OmO 4.16.3) Recording Session Telemetry",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\telemetry\\dist\\cli.js\" hook session-start"
}
]
diff --git a/plugins/omo/hooks/stop-checking-start-work-continuation.json b/plugins/omo/hooks/stop-checking-start-work-continuation.json
index f4fb5e79..49e804d0 100644
--- a/plugins/omo/hooks/stop-checking-start-work-continuation.json
+++ b/plugins/omo/hooks/stop-checking-start-work-continuation.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/start-work-continuation/dist/cli.js\" hook stop",
"timeout": 10,
- "statusMessage": "(OmO 4.16.2) Checking Start-Work Continuation",
+ "statusMessage": "(OmO 4.16.3) Checking Start-Work Continuation",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\start-work-continuation\\dist\\cli.js\" hook stop"
}
]
diff --git a/plugins/omo/hooks/subagent-stop-checking-start-work-continuation.json b/plugins/omo/hooks/subagent-stop-checking-start-work-continuation.json
index 26102b35..1be02f5a 100644
--- a/plugins/omo/hooks/subagent-stop-checking-start-work-continuation.json
+++ b/plugins/omo/hooks/subagent-stop-checking-start-work-continuation.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/start-work-continuation/dist/cli.js\" hook subagent-stop",
"timeout": 10,
- "statusMessage": "(OmO 4.16.2) Checking Start-Work Continuation",
+ "statusMessage": "(OmO 4.16.3) Checking Start-Work Continuation",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\start-work-continuation\\dist\\cli.js\" hook subagent-stop"
}
]
diff --git a/plugins/omo/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json b/plugins/omo/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json
index 91ac0a61..b6f9ead3 100644
--- a/plugins/omo/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json
+++ b/plugins/omo/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/lazycodex-executor-verify/dist/cli.js\" hook subagent-stop",
"timeout": 10,
- "statusMessage": "(OmO 4.16.2) Verifying LazyCodex Executor Evidence",
+ "statusMessage": "(OmO 4.16.3) Verifying LazyCodex Executor Evidence",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\lazycodex-executor-verify\\dist\\cli.js\" hook subagent-stop"
}
],
diff --git a/plugins/omo/hooks/user-prompt-submit-checking-ultrawork-trigger.json b/plugins/omo/hooks/user-prompt-submit-checking-ultrawork-trigger.json
index 8d3f6cc3..ba5bb2bb 100644
--- a/plugins/omo/hooks/user-prompt-submit-checking-ultrawork-trigger.json
+++ b/plugins/omo/hooks/user-prompt-submit-checking-ultrawork-trigger.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/ultrawork/dist/cli.js\" hook user-prompt-submit",
"timeout": 5,
- "statusMessage": "(OmO 4.16.2) Checking Ultrawork Trigger",
+ "statusMessage": "(OmO 4.16.3) Checking Ultrawork Trigger",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\ultrawork\\dist\\cli.js\" hook user-prompt-submit"
}
]
diff --git a/plugins/omo/hooks/user-prompt-submit-checking-ulw-loop-steering.json b/plugins/omo/hooks/user-prompt-submit-checking-ulw-loop-steering.json
index 8016a2bf..639d95e3 100644
--- a/plugins/omo/hooks/user-prompt-submit-checking-ulw-loop-steering.json
+++ b/plugins/omo/hooks/user-prompt-submit-checking-ulw-loop-steering.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/ulw-loop/dist/cli.js\" hook user-prompt-submit",
"timeout": 10,
- "statusMessage": "(OmO 4.16.2) Checking Ulw-Loop Steering",
+ "statusMessage": "(OmO 4.16.3) Checking Ulw-Loop Steering",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\ulw-loop\\dist\\cli.js\" hook user-prompt-submit"
}
]
diff --git a/plugins/omo/hooks/user-prompt-submit-loading-project-rules.json b/plugins/omo/hooks/user-prompt-submit-loading-project-rules.json
index b35d6752..c3e41c0b 100644
--- a/plugins/omo/hooks/user-prompt-submit-loading-project-rules.json
+++ b/plugins/omo/hooks/user-prompt-submit-loading-project-rules.json
@@ -7,7 +7,7 @@
"type": "command",
"command": "node \"${PLUGIN_ROOT}/components/rules/dist/cli.js\" hook user-prompt-submit",
"timeout": 10,
- "statusMessage": "(OmO 4.16.2) Loading Project Rules",
+ "statusMessage": "(OmO 4.16.3) Loading Project Rules",
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\node-dispatch.ps1\" \"${PLUGIN_ROOT}\\components\\rules\\dist\\cli.js\" hook user-prompt-submit"
}
]
diff --git a/plugins/omo/package-lock.json b/plugins/omo/package-lock.json
index 4f1bf31c..36296bf2 100644
--- a/plugins/omo/package-lock.json
+++ b/plugins/omo/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@sisyphuslabs/omo-codex-plugin",
- "version": "4.16.2",
+ "version": "4.16.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@sisyphuslabs/omo-codex-plugin",
- "version": "4.16.2",
+ "version": "4.16.3",
"workspaces": [
"components/codegraph",
"components/comment-checker",
@@ -93,7 +93,7 @@
},
"components/codegraph": {
"name": "@sisyphuslabs/codex-codegraph",
- "version": "4.16.2",
+ "version": "4.16.3",
"bin": {
"omo-codegraph": "dist/cli.js"
},
@@ -112,7 +112,7 @@
},
"components/comment-checker": {
"name": "@code-yeongyu/codex-comment-checker",
- "version": "4.16.2",
+ "version": "4.16.3",
"license": "MIT",
"bin": {
"omo-comment-checker": "dist/cli.js"
@@ -133,7 +133,7 @@
},
"components/git-bash": {
"name": "@sisyphuslabs/codex-git-bash-hook",
- "version": "4.16.2",
+ "version": "4.16.3",
"bin": {
"omo-git-bash-hook": "dist/cli.js"
},
@@ -148,7 +148,7 @@
},
"components/lazycodex-executor-verify": {
"name": "@code-yeongyu/codex-lazycodex-executor-verify",
- "version": "4.16.2",
+ "version": "4.16.3",
"license": "MIT",
"bin": {
"lazycodex-executor-verify": "dist/cli.js"
@@ -165,7 +165,7 @@
},
"components/lsp": {
"name": "@code-yeongyu/codex-lsp",
- "version": "4.16.2",
+ "version": "4.16.3",
"license": "MIT",
"dependencies": {
"@code-yeongyu/lsp-daemon": "file:../../../../lsp-daemon"
@@ -185,7 +185,7 @@
},
"components/rules": {
"name": "@code-yeongyu/codex-rules",
- "version": "4.16.2",
+ "version": "4.16.3",
"license": "MIT",
"dependencies": {
"picomatch": "^4.0.3"
@@ -207,7 +207,7 @@
},
"components/start-work-continuation": {
"name": "@code-yeongyu/codex-start-work-continuation",
- "version": "4.16.2",
+ "version": "4.16.3",
"license": "MIT",
"bin": {
"omo-start-work-continuation": "dist/cli.js"
@@ -224,7 +224,7 @@
},
"components/teammode": {
"name": "@sisyphuslabs/codex-teammode",
- "version": "4.16.2",
+ "version": "4.16.3",
"devDependencies": {
"@types/node": "^25.9.3",
"bun-types": "^1.3.1",
@@ -237,7 +237,7 @@
},
"components/telemetry": {
"name": "@code-yeongyu/codex-telemetry",
- "version": "4.16.2",
+ "version": "4.16.3",
"license": "MIT",
"bin": {
"omo-telemetry": "dist/cli.js"
@@ -255,7 +255,7 @@
},
"components/ultrawork": {
"name": "@code-yeongyu/codex-ultrawork",
- "version": "4.16.2",
+ "version": "4.16.3",
"license": "MIT",
"bin": {
"omo-ultrawork": "dist/cli.js"
@@ -273,7 +273,7 @@
},
"components/ulw-loop": {
"name": "@code-yeongyu/codex-ulw-loop",
- "version": "4.16.2",
+ "version": "4.16.3",
"license": "MIT",
"bin": {
"omo-ulw-loop": "dist/cli.js",
diff --git a/plugins/omo/package.json b/plugins/omo/package.json
index e4012710..9ee73374 100644
--- a/plugins/omo/package.json
+++ b/plugins/omo/package.json
@@ -1,6 +1,6 @@
{
"name": "@sisyphuslabs/omo-codex-plugin",
- "version": "4.16.2",
+ "version": "4.16.3",
"description": "Aggregate Codex plugin root for OMO components.",
"type": "module",
"packageManager": "[email protected]",
diff --git a/plugins/omo/scripts/auto-update.mjs b/plugins/omo/scripts/auto-update.mjs
index 3fb1e338..adc55334 100644
--- a/plugins/omo/scripts/auto-update.mjs
+++ b/plugins/omo/scripts/auto-update.mjs
@@ -1,7 +1,7 @@
#!/usr/bin/env node
import { spawn, spawnSync } from "node:child_process";
-import { pathToFileURL } from "node:url";
+import { isCliEntry } from "./entry-guard.mjs";
import {
DEFAULT_LOCK_STALE_MS,
acquireLock,
@@ -296,8 +296,15 @@ function resolveUpdateContext({ env }) {
async function runConfigMigration({ env, sessionModel = null, requireSessionModel = false }) {
if (env.LAZYCODEX_CONFIG_MIGRATION_DISABLED === "1" || env.OMO_CODEX_CONFIG_MIGRATION_DISABLED === "1") return [];
+ // The two migrations are independent; a SoT seeding failure must never
+ // block the config.toml repair (which can be the difference between a
+ // working and a fully broken GPT-5.6 session).
try {
await migrateOmoSotConfig({ env, seed: true });
+ } catch (error) {
+ if (!(error instanceof Error)) throw error;
+ }
+ try {
const result = await migrateCodexConfig({ env, sessionModel, requireSessionModel });
if (result.modeChanged.length === 0) return [];
return [
@@ -309,7 +316,7 @@ async function runConfigMigration({ env, sessionModel = null, requireSessionMode
}
}
-if (process.argv[1] !== undefined && import.meta.url === pathToFileURL(process.argv[1]).href) {
+if (isCliEntry(import.meta.url)) {
(async () => {
const sessionModel = await readSessionModelFromStdin(process.stdin);
const { notices } = await runAutoUpdateCheck({
diff --git a/plugins/omo/scripts/entry-guard.mjs b/plugins/omo/scripts/entry-guard.mjs
new file mode 100644
index 00000000..68ac059a
--- /dev/null
+++ b/plugins/omo/scripts/entry-guard.mjs
@@ -0,0 +1,26 @@
+import { realpathSync } from "node:fs";
+import { pathToFileURL } from "node:url";
+
+/**
+ * True when the module identified by `importMetaUrl` is the process CLI
+ * entrypoint (`node <script>`).
+ *
+ * A plain `import.meta.url === pathToFileURL(process.argv[1]).href` check
+ * breaks when the script is reached through a symlink: Node resolves
+ * `import.meta.url` to the real path by default, while `process.argv[1]`
+ * keeps the symlinked spelling, so the two never match and the CLI body is
+ * silently skipped (exit 0, no output). Seen in the wild with a symlinked
+ * plugin cache dir, which turned every SessionStart hook into a no-op.
+ *
+ * @param {string} importMetaUrl the caller's `import.meta.url`
+ */
+export function isCliEntry(importMetaUrl) {
+ const argv1 = process.argv[1];
+ if (argv1 === undefined) return false;
+ if (importMetaUrl === pathToFileURL(argv1).href) return true;
+ try {
+ return importMetaUrl === pathToFileURL(realpathSync(argv1)).href;
+ } catch {
+ return false;
+ }
+}
diff --git a/plugins/omo/scripts/materialize-shared-upstreams.mjs b/plugins/omo/scripts/materialize-shared-upstreams.mjs
index 0380a295..ee38bfdc 100644
--- a/plugins/omo/scripts/materialize-shared-upstreams.mjs
+++ b/plugins/omo/scripts/materialize-shared-upstreams.mjs
@@ -2,6 +2,8 @@ import { execFileSync } from "node:child_process";
import { dirname, join } from "node:path";
import { fileURLToPath, pathToFileURL } from "node:url";
+import { isCliEntry } from "./entry-guard.mjs";
+
const pluginScriptsDir = dirname(fileURLToPath(import.meta.url));
const repoRoot = join(pluginScriptsDir, "..", "..", "..", "..");
const sharedSkillsScripts = join(repoRoot, "packages", "shared-skills", "scripts");
@@ -35,7 +37,7 @@ export async function materializeSharedUpstreams({ strict }) {
return materializeFrontendRefs({ strict });
}
-if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
+if (isCliEntry(import.meta.url)) {
// The root build materializes once up front and sets this so downstream codex-plugin
// builds in the same run do not re-run it; concurrent runs would contend on git's
// submodule index.lock and race writes into packages/shared-skills/skills.
diff --git a/plugins/omo/scripts/migrate-codex-config.mjs b/plugins/omo/scripts/migrate-codex-config.mjs
index 5a5ba988..4df6b635 100644
--- a/plugins/omo/scripts/migrate-codex-config.mjs
+++ b/plugins/omo/scripts/migrate-codex-config.mjs
@@ -2,8 +2,8 @@
import { mkdir, readFile, writeFile } from "node:fs/promises";
import { dirname } from "node:path";
-import { pathToFileURL } from "node:url";
+import { isCliEntry } from "./entry-guard.mjs";
import { FALLBACK_CATALOG, readModelCatalog } from "./migrate-codex-config/catalog.mjs";
import { configPaths } from "./migrate-codex-config/config-paths.mjs";
import { removeStaleContext7PlaceholderMcpServer } from "./migrate-codex-config/context7-placeholder-guard.mjs";
@@ -76,7 +76,7 @@ export async function migrateConfigFile(
reasoningApplied = config !== before;
}
- const multiAgentOptions = { env, sessionModel, requireSessionModel };
+ const multiAgentOptions = { env, sessionModel, requireSessionModel, configPath };
const multiAgentVersion = resolveMultiAgentVersionFromConfig(config, multiAgentOptions);
const afterMultiAgentGuard = forceDisableMultiAgentV2(config, {
...multiAgentOptions,
@@ -145,7 +145,7 @@ async function readConfig(configPath) {
}
}
-if (process.argv[1] !== undefined && import.meta.url === pathToFileURL(process.argv[1]).href) {
+if (isCliEntry(import.meta.url)) {
migrateCodexConfig().catch((error) => {
if (!(error instanceof Error)) throw error;
process.exit(0);
diff --git a/plugins/omo/scripts/migrate-codex-config/multi-agent-v2-guard.mjs b/plugins/omo/scripts/migrate-codex-config/multi-agent-v2-guard.mjs
index 67ce8632..93bd6e36 100644
--- a/plugins/omo/scripts/migrate-codex-config/multi-agent-v2-guard.mjs
+++ b/plugins/omo/scripts/migrate-codex-config/multi-agent-v2-guard.mjs
@@ -24,7 +24,7 @@
*/
import { readFileSync } from "node:fs";
import { homedir } from "node:os";
-import { join } from "node:path";
+import { dirname, isAbsolute, join } from "node:path";
const MANAGED_COMMENT_MARKER = "openai/codex#26753";
const MANAGED_DISABLE_COMMENT = [
@@ -42,6 +42,7 @@ const MANAGED_DISABLE_COMMENT = [
* requireSessionModel?: boolean,
* env?: NodeJS.ProcessEnv,
* modelsCachePath?: string,
+ * configPath?: string,
* }} [options]
*/
export function forceDisableMultiAgentV2(config, options = {}) {
@@ -55,8 +56,9 @@ export function forceDisableMultiAgentV2(config, options = {}) {
options.multiAgentVersion !== undefined
? options.multiAgentVersion
: resolveMultiAgentVersionFromConfig(normalized, options);
+ const effectiveModel = sessionModel || readRootModel(normalized);
- if (prefersMultiAgentV2(multiAgentVersion, sessionModel)) {
+ if (prefersMultiAgentV2(multiAgentVersion, effectiveModel)) {
return clearMultiAgentV2DisableForReservedSchema(normalized);
}
@@ -68,6 +70,15 @@ export function forceDisableMultiAgentV2(config, options = {}) {
return normalized;
}
+ // No model evidence at all (no session model AND no root `model` in
+ // config.toml — Codex Desktop selects the model in the UI): config alone
+ // cannot prove the session is not a GPT-5.6 reserved-schema model, and
+ // writing `enabled = false` would 400 every turn on those sessions
+ // (#6002). Leave the enable state untouched.
+ if (multiAgentVersion == null && !sessionModel && !readRootModel(normalized)) {
+ return normalized;
+ }
+
// Unknown catalog entry for an explicit session model: skip force-disable
// rather than assume the legacy encrypted-V2 failure mode.
if (sessionModel && multiAgentVersion == null) {
@@ -92,13 +103,17 @@ export function prefersMultiAgentV2(multiAgentVersion, sessionModel) {
* Resolve the effective model against Codex `models_cache.json`.
* Prefers SessionStart `model` over the root `model` in config.toml.
* @param {string} config
- * @param {{ sessionModel?: string | null, env?: NodeJS.ProcessEnv, modelsCachePath?: string }} [options]
+ * @param {{ sessionModel?: string | null, env?: NodeJS.ProcessEnv, modelsCachePath?: string, configPath?: string }} [options]
* @returns {"v1" | "v2" | null}
*/
export function resolveMultiAgentVersionFromConfig(config, options = {}) {
const model = normalizeModel(options.sessionModel) || readRootModel(config);
if (!model) return null;
- return resolveMultiAgentVersionForModel(model, options);
+ const version = resolveMultiAgentVersionForModel(model, {
+ ...options,
+ modelsCachePath: options.modelsCachePath?.trim() || resolveModelCatalogPath(readRootModelCatalogPath(config), options) || undefined,
+ });
+ return version ?? (isGpt56Family(model) ? "v2" : null);
}
/**
@@ -130,6 +145,26 @@ export function readRootModel(config) {
return single?.[1] ?? null;
}
+// Codex documents `model_catalog_json` as a COMPLETE replacement for the
+// fetched models_cache.json (codex-rs/core/src/config/mod.rs load_model_catalog
+// -> load_catalog_json -> ModelsResponse). When set, Codex resolves the model
+// only from that file, so the guard must too — otherwise Codex and the guard
+// disagree on the multi-agent version (lazycodex#120).
+export function readRootModelCatalogPath(config) {
+ const double = config.match(/^\s*model_catalog_json\s*=\s*"([^"]+)"/m);
+ if (double) return double[1];
+ const single = config.match(/^\s*model_catalog_json\s*=\s*'([^']+)'/m);
+ return single?.[1] ?? null;
+}
+
+function resolveModelCatalogPath(configuredPath, options) {
+ const trimmed = normalizeModel(configuredPath);
+ if (!trimmed) return null;
+ if (isAbsolute(trimmed)) return trimmed;
+ const baseDir = options.configPath ? dirname(options.configPath) : options.env?.CODEX_HOME?.trim() || join(homedir(), ".codex");
+ return join(baseDir, trimmed);
+}
+
function normalizeModel(value) {
if (typeof value !== "string") return null;
const trimmed = value.trim();
diff --git a/plugins/omo/scripts/migrate-codex-config/subagent-limit-guard.mjs b/plugins/omo/scripts/migrate-codex-config/subagent-limit-guard.mjs
index 428523c0..43b906b0 100644
--- a/plugins/omo/scripts/migrate-codex-config/subagent-limit-guard.mjs
+++ b/plugins/omo/scripts/migrate-codex-config/subagent-limit-guard.mjs
@@ -1,4 +1,4 @@
-import { prefersMultiAgentV2, resolveMultiAgentVersionFromConfig } from "./multi-agent-v2-guard.mjs";
+import { prefersMultiAgentV2, readRootModel, resolveMultiAgentVersionFromConfig } from "./multi-agent-v2-guard.mjs";
const CODEX_AGENTS_HEADER = "[agents]";
const CODEX_MULTI_AGENT_V2_HEADER = "[features.multi_agent_v2]";
@@ -11,6 +11,12 @@ const CODEX_SUBAGENT_THREAD_LIMIT = "1000";
* enabled in config, skip `agents.max_threads` because Codex rejects that key
* while features.multi_agent_v2 is enabled.
*
+ * When no model is resolvable at all (no session model and no root `model`
+ * in config.toml — Codex Desktop selects the model in the UI), never
+ * introduce `agents.max_threads`: it hard-fails thread/start on
+ * MultiAgentV2 sessions. An existing cap is still raised in place so the
+ * legacy low-cap repair keeps working and a hand-removed key stays removed.
+ *
* @param {string} config
* @param {{ multiAgentVersion?: string | null, sessionModel?: string | null, env?: NodeJS.ProcessEnv, modelsCachePath?: string }} [options]
*/
@@ -22,20 +28,34 @@ export function ensureSubagentConcurrencyLimit(config, options = {}) {
const v2Preferred = prefersMultiAgentV2(multiAgentVersion, options.sessionModel) || isMultiAgentV2Enabled(config);
let result = config;
- if (!v2Preferred) {
- result = ensureAgentsMaxThreads(result);
- } else {
+ if (v2Preferred) {
result = removeAgentsMaxThreads(result);
+ } else if (multiAgentVersion == null && !hasModelEvidence(config, options)) {
+ result = raiseExistingAgentsMaxThreads(result);
+ } else {
+ result = ensureAgentsMaxThreads(result);
}
return ensureMultiAgentV2ThreadLimit(result);
}
+function hasModelEvidence(config, options) {
+ const sessionModel = typeof options.sessionModel === "string" ? options.sessionModel.trim() : "";
+ return sessionModel.length > 0 || readRootModel(config) !== null;
+}
+
function isMultiAgentV2Enabled(config) {
const section = findSection(config, CODEX_MULTI_AGENT_V2_HEADER);
if (!section) return false;
return /^\s*enabled\s*=\s*true[ \t]*(?:#[^\n]*)?$/m.test(section.text);
}
+function raiseExistingAgentsMaxThreads(config) {
+ const section = findSection(config, CODEX_AGENTS_HEADER);
+ if (!section) return config;
+ if (!/^\s*max_threads\s*=/m.test(section.text)) return config;
+ return replaceOrInsertSetting(config, section, "max_threads", CODEX_SUBAGENT_THREAD_LIMIT);
+}
+
function ensureAgentsMaxThreads(config) {
const section = findSection(config, CODEX_AGENTS_HEADER);
if (!section) return appendBlock(config, `${CODEX_AGENTS_HEADER}\nmax_threads = ${CODEX_SUBAGENT_THREAD_LIMIT}\n`);
diff --git a/plugins/omo/scripts/migrate-omo-sot.mjs b/plugins/omo/scripts/migrate-omo-sot.mjs
index 6146934f..eb9300cc 100644
--- a/plugins/omo/scripts/migrate-omo-sot.mjs
+++ b/plugins/omo/scripts/migrate-omo-sot.mjs
@@ -3,8 +3,8 @@
import { access, mkdir, readFile, writeFile } from "node:fs/promises";
import { homedir } from "node:os";
import { dirname, join } from "node:path";
-import { pathToFileURL } from "node:url";
+import { isCliEntry } from "./entry-guard.mjs";
import { addCodexCodegraphValues, hasOwn, isRecord, recordAt } from "./migrate-omo-sot/editor.mjs";
import { parseJsonc } from "./migrate-omo-sot/jsonc.mjs";
import { SCAFFOLD } from "./migrate-omo-sot/scaffold.mjs";
@@ -109,7 +109,7 @@ function isValidCodegraphValue(key, value) {
return typeof value === "boolean";
}
-if (process.argv[1] !== undefined && import.meta.url === pathToFileURL(process.argv[1]).href) {
+if (isCliEntry(import.meta.url)) {
migrateOmoSotConfig({ seed: process.argv.includes("--seed") })
.then((result) => {
for (const warning of result.warnings) process.stderr.write(`${warning}\n`);
diff --git a/plugins/omo/scripts/sync-hook-status-messages.mjs b/plugins/omo/scripts/sync-hook-status-messages.mjs
index 3527d225..f3beb313 100644
--- a/plugins/omo/scripts/sync-hook-status-messages.mjs
+++ b/plugins/omo/scripts/sync-hook-status-messages.mjs
@@ -1,9 +1,9 @@
#!/usr/bin/env node
import { access, readdir, readFile, writeFile } from "node:fs/promises";
import { dirname, join } from "node:path";
-import { pathToFileURL } from "node:url";
import { fileURLToPath } from "node:url";
+import { isCliEntry } from "./entry-guard.mjs";
import { formatLazyCodexHookStatusMessage, normalizeLazyCodexHookStatusLabel } from "./hook-status-message.mjs";
const defaultRoot = dirname(dirname(fileURLToPath(import.meta.url)));
@@ -102,6 +102,6 @@ export async function syncHookStatusMessages(root = defaultRoot, options = {}) {
}
}
-if (process.argv[1] !== undefined && import.meta.url === pathToFileURL(process.argv[1]).href) {
+if (isCliEntry(import.meta.url)) {
await syncHookStatusMessages();
}
diff --git a/plugins/omo/scripts/sync-skills.mjs b/plugins/omo/scripts/sync-skills.mjs
index 071c6f27..23c5c8a6 100644
--- a/plugins/omo/scripts/sync-skills.mjs
+++ b/plugins/omo/scripts/sync-skills.mjs
@@ -1,7 +1,9 @@
#!/usr/bin/env node
import { cp, mkdir, readdir, readFile, rm, writeFile } from "node:fs/promises";
import { dirname, join } from "node:path";
-import { fileURLToPath, pathToFileURL } from "node:url";
+import { fileURLToPath } from "node:url";
+
+import { isCliEntry } from "./entry-guard.mjs";
import { sharedSkillsRootPath } from "@oh-my-opencode/shared-skills";
const root = dirname(dirname(fileURLToPath(import.meta.url)));
@@ -36,7 +38,7 @@ function shouldCopySkillSource(source) {
const opencodeOnlyOrchestrationPattern = /\b(?:call_omo_agent|background_output|team_[a-z_]+|task)\s*\(/;
-const codexHarnessToolCompatibility = `## Codex Harness Tool Compatibility
+export const codexHarnessToolCompatibility = `## Codex Harness Tool Compatibility
This skill may include examples copied from the OpenCode harness. In Codex, do not call OpenCode-only tools such as \`call_omo_agent(...)\`, \`task(...)\`, \`background_output(...)\`, or \`team_*(...)\` literally. Translate those examples to Codex native tools:
@@ -48,7 +50,7 @@ This skill may include examples copied from the OpenCode harness. In Codex, do n
| \`task(subagent_type="oracle", ...)\` for final verification | \`multi_agent_v1.spawn_agent({"message":"TASK: act as a rigorous reviewer. ...","agent_type":"lazycodex-gate-reviewer","fork_context":false})\` |
| \`task(category="...", ...)\` for implementation or QA | \`multi_agent_v1.spawn_agent({"message":"TASK: act as an implementation or QA worker. ...","fork_context":false})\` |
| \`background_output(task_id="...")\` | \`multi_agent_v1.wait_agent(...)\` for mailbox signals |
-| \`team_*(...)\` | Use Codex native subagents via \`multi_agent_v1.spawn_agent\`, \`multi_agent_v1.send_input\`, \`multi_agent_v1.wait_agent\`, and \`multi_agent_v1.close_agent\` |
+| \`team_*(...)\` | Use Codex native subagents via \`multi_agent_v1.spawn_agent\` and \`multi_agent_v1.wait_agent\`; use \`multi_agent_v1.send_input\` and \`multi_agent_v1.close_agent\` only when exposed in the active tools list |
Role-specific behavior must be described in a self-contained \`message\`. Use \`fork_context: false\` to start the child with only the initial prompt (no parent history); use \`fork_context: true\` only when full parent history is truly required. Include any required conversation context, files, diffs, constraints, and requested skill names directly in the spawned agent's \`message\`. OMO installs these selectable agent roles into \`~/.codex/agents/\`: \`explorer\`, \`librarian\`, \`plan\`, \`momus\`, \`metis\`, \`lazycodex-code-reviewer\`, \`lazycodex-qa-executor\`, and \`lazycodex-gate-reviewer\` - pass the matching name as \`agent_type\` so the child gets that role's model and instructions. If the spawn tool exposes no \`agent_type\` parameter, omit it and describe the role inside \`message\`. If a code block below conflicts with this section, this section wins.
@@ -263,6 +265,6 @@ async function syncSkills() {
}
}
-if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
+if (isCliEntry(import.meta.url)) {
await syncSkills();
}
diff --git a/plugins/omo/scripts/sync-version.mjs b/plugins/omo/scripts/sync-version.mjs
index 46471288..7f014ed7 100644
--- a/plugins/omo/scripts/sync-version.mjs
+++ b/plugins/omo/scripts/sync-version.mjs
@@ -1,7 +1,9 @@
#!/usr/bin/env node
import { readdir, readFile, writeFile } from "node:fs/promises";
import { dirname, join } from "node:path";
-import { fileURLToPath, pathToFileURL } from "node:url";
+import { fileURLToPath } from "node:url";
+
+import { isCliEntry } from "./entry-guard.mjs";
const scriptDir = dirname(fileURLToPath(import.meta.url));
const defaultPluginRoot = dirname(scriptDir);
@@ -88,7 +90,7 @@ export async function syncVersion(options = {}) {
return { version, targets, changed };
}
-if (process.argv[1] !== undefined && import.meta.url === pathToFileURL(process.argv[1]).href) {
+if (isCliEntry(import.meta.url)) {
const result = await syncVersion();
console.log(`Synced OMO Codex manifests to version ${result.version} (${result.changed.length} updated)`);
}
diff --git a/plugins/omo/skills/init-deep/SKILL.md b/plugins/omo/skills/init-deep/SKILL.md
index 61f96113..b700df08 100644
--- a/plugins/omo/skills/init-deep/SKILL.md
+++ b/plugins/omo/skills/init-deep/SKILL.md
@@ -14,7 +14,7 @@ This skill may include examples copied from the OpenCode harness. In Codex, do n
| `task(subagent_type="oracle", ...)` for final verification | `multi_agent_v1.spawn_agent({"message":"TASK: act as a rigorous reviewer. ...","agent_type":"lazycodex-gate-reviewer","fork_context":false})` |
| `task(category="...", ...)` for implementation or QA | `multi_agent_v1.spawn_agent({"message":"TASK: act as an implementation or QA worker. ...","fork_context":false})` |
| `background_output(task_id="...")` | `multi_agent_v1.wait_agent(...)` for mailbox signals |
-| `team_*(...)` | Use Codex native subagents via `multi_agent_v1.spawn_agent`, `multi_agent_v1.send_input`, `multi_agent_v1.wait_agent`, and `multi_agent_v1.close_agent` |
+| `team_*(...)` | Use Codex native subagents via `multi_agent_v1.spawn_agent` and `multi_agent_v1.wait_agent`; use `multi_agent_v1.send_input` and `multi_agent_v1.close_agent` only when exposed in the active tools list |
Role-specific behavior must be described in a self-contained `message`. Use `fork_context: false` to start the child with only the initial prompt (no parent history); use `fork_context: true` only when full parent history is truly required. Include any required conversation context, files, diffs, constraints, and requested skill names directly in the spawned agent's `message`. OMO installs these selectable agent roles into `~/.codex/agents/`: `explorer`, `librarian`, `plan`, `momus`, `metis`, `lazycodex-code-reviewer`, `lazycodex-qa-executor`, and `lazycodex-gate-reviewer` - pass the matching name as `agent_type` so the child gets that role's model and instructions. If the spawn tool exposes no `agent_type` parameter, omit it and describe the role inside `message`. If a code block below conflicts with this section, this section wins.
diff --git a/plugins/omo/skills/refactor/SKILL.md b/plugins/omo/skills/refactor/SKILL.md
index cb76c5a1..7d161732 100644
--- a/plugins/omo/skills/refactor/SKILL.md
+++ b/plugins/omo/skills/refactor/SKILL.md
@@ -15,7 +15,7 @@ This skill may include examples copied from the OpenCode harness. In Codex, do n
| `task(subagent_type="oracle", ...)` for final verification | `multi_agent_v1.spawn_agent({"message":"TASK: act as a rigorous reviewer. ...","agent_type":"lazycodex-gate-reviewer","fork_context":false})` |
| `task(category="...", ...)` for implementation or QA | `multi_agent_v1.spawn_agent({"message":"TASK: act as an implementation or QA worker. ...","fork_context":false})` |
| `background_output(task_id="...")` | `multi_agent_v1.wait_agent(...)` for mailbox signals |
-| `team_*(...)` | Use Codex native subagents via `multi_agent_v1.spawn_agent`, `multi_agent_v1.send_input`, `multi_agent_v1.wait_agent`, and `multi_agent_v1.close_agent` |
+| `team_*(...)` | Use Codex native subagents via `multi_agent_v1.spawn_agent` and `multi_agent_v1.wait_agent`; use `multi_agent_v1.send_input` and `multi_agent_v1.close_agent` only when exposed in the active tools list |
Role-specific behavior must be described in a self-contained `message`. Use `fork_context: false` to start the child with only the initial prompt (no parent history); use `fork_context: true` only when full parent history is truly required. Include any required conversation context, files, diffs, constraints, and requested skill names directly in the spawned agent's `message`. OMO installs these selectable agent roles into `~/.codex/agents/`: `explorer`, `librarian`, `plan`, `momus`, `metis`, `lazycodex-code-reviewer`, `lazycodex-qa-executor`, and `lazycodex-gate-reviewer` - pass the matching name as `agent_type` so the child gets that role's model and instructions. If the spawn tool exposes no `agent_type` parameter, omit it and describe the role inside `message`. If a code block below conflicts with this section, this section wins.
diff --git a/plugins/omo/skills/remove-ai-slops/SKILL.md b/plugins/omo/skills/remove-ai-slops/SKILL.md
index 253674f9..ba06b751 100644
--- a/plugins/omo/skills/remove-ai-slops/SKILL.md
+++ b/plugins/omo/skills/remove-ai-slops/SKILL.md
@@ -15,7 +15,7 @@ This skill may include examples copied from the OpenCode harness. In Codex, do n
| `task(subagent_type="oracle", ...)` for final verification | `multi_agent_v1.spawn_agent({"message":"TASK: act as a rigorous reviewer. ...","agent_type":"lazycodex-gate-reviewer","fork_context":false})` |
| `task(category="...", ...)` for implementation or QA | `multi_agent_v1.spawn_agent({"message":"TASK: act as an implementation or QA worker. ...","fork_context":false})` |
| `background_output(task_id="...")` | `multi_agent_v1.wait_agent(...)` for mailbox signals |
-| `team_*(...)` | Use Codex native subagents via `multi_agent_v1.spawn_agent`, `multi_agent_v1.send_input`, `multi_agent_v1.wait_agent`, and `multi_agent_v1.close_agent` |
+| `team_*(...)` | Use Codex native subagents via `multi_agent_v1.spawn_agent` and `multi_agent_v1.wait_agent`; use `multi_agent_v1.send_input` and `multi_agent_v1.close_agent` only when exposed in the active tools list |
Role-specific behavior must be described in a self-contained `message`. Use `fork_context: false` to start the child with only the initial prompt (no parent history); use `fork_context: true` only when full parent history is truly required. Include any required conversation context, files, diffs, constraints, and requested skill names directly in the spawned agent's `message`. OMO installs these selectable agent roles into `~/.codex/agents/`: `explorer`, `librarian`, `plan`, `momus`, `metis`, `lazycodex-code-reviewer`, `lazycodex-qa-executor`, and `lazycodex-gate-reviewer` - pass the matching name as `agent_type` so the child gets that role's model and instructions. If the spawn tool exposes no `agent_type` parameter, omit it and describe the role inside `message`. If a code block below conflicts with this section, this section wins.
diff --git a/plugins/omo/skills/review-work/SKILL.md b/plugins/omo/skills/review-work/SKILL.md
index e25f51b8..e2b5c2b9 100644
--- a/plugins/omo/skills/review-work/SKILL.md
+++ b/plugins/omo/skills/review-work/SKILL.md
@@ -14,7 +14,7 @@ This skill may include examples copied from the OpenCode harness. In Codex, do n
| `task(subagent_type="oracle", ...)` for final verification | `multi_agent_v1.spawn_agent({"message":"TASK: act as a rigorous reviewer. ...","agent_type":"lazycodex-gate-reviewer","fork_context":false})` |
| `task(category="...", ...)` for implementation or QA | `multi_agent_v1.spawn_agent({"message":"TASK: act as an implementation or QA worker. ...","fork_context":false})` |
| `background_output(task_id="...")` | `multi_agent_v1.wait_agent(...)` for mailbox signals |
-| `team_*(...)` | Use Codex native subagents via `multi_agent_v1.spawn_agent`, `multi_agent_v1.send_input`, `multi_agent_v1.wait_agent`, and `multi_agent_v1.close_agent` |
+| `team_*(...)` | Use Codex native subagents via `multi_agent_v1.spawn_agent` and `multi_agent_v1.wait_agent`; use `multi_agent_v1.send_input` and `multi_agent_v1.close_agent` only when exposed in the active tools list |
Role-specific behavior must be described in a self-contained `message`. Use `fork_context: false` to start the child with only the initial prompt (no parent history); use `fork_context: true` only when full parent history is truly required. Include any required conversation context, files, diffs, constraints, and requested skill names directly in the spawned agent's `message`. OMO installs these selectable agent roles into `~/.codex/agents/`: `explorer`, `librarian`, `plan`, `momus`, `metis`, `lazycodex-code-reviewer`, `lazycodex-qa-executor`, and `lazycodex-gate-reviewer` - pass the matching name as `agent_type` so the child gets that role's model and instructions. If the spawn tool exposes no `agent_type` parameter, omit it and describe the role inside `message`. If a code block below conflicts with this section, this section wins.
diff --git a/plugins/omo/skills/start-work/SKILL.md b/plugins/omo/skills/start-work/SKILL.md
index 44d25330..14202460 100644
--- a/plugins/omo/skills/start-work/SKILL.md
+++ b/plugins/omo/skills/start-work/SKILL.md
@@ -15,7 +15,7 @@ This skill may include examples copied from the OpenCode harness. In Codex, do n
| `task(subagent_type="oracle", ...)` for final verification | `multi_agent_v1.spawn_agent({"message":"TASK: act as a rigorous reviewer. ...","agent_type":"lazycodex-gate-reviewer","fork_context":false})` |
| `task(category="...", ...)` for implementation or QA | `multi_agent_v1.spawn_agent({"message":"TASK: act as an implementation or QA worker. ...","fork_context":false})` |
| `background_output(task_id="...")` | `multi_agent_v1.wait_agent(...)` for mailbox signals |
-| `team_*(...)` | Use Codex native subagents via `multi_agent_v1.spawn_agent`, `multi_agent_v1.send_input`, `multi_agent_v1.wait_agent`, and `multi_agent_v1.close_agent` |
+| `team_*(...)` | Use Codex native subagents via `multi_agent_v1.spawn_agent` and `multi_agent_v1.wait_agent`; use `multi_agent_v1.send_input` and `multi_agent_v1.close_agent` only when exposed in the active tools list |
Role-specific behavior must be described in a self-contained `message`. Use `fork_context: false` to start the child with only the initial prompt (no parent history); use `fork_context: true` only when full parent history is truly required. Include any required conversation context, files, diffs, constraints, and requested skill names directly in the spawned agent's `message`. OMO installs these selectable agent roles into `~/.codex/agents/`: `explorer`, `librarian`, `plan`, `momus`, `metis`, `lazycodex-code-reviewer`, `lazycodex-qa-executor`, and `lazycodex-gate-reviewer` - pass the matching name as `agent_type` so the child gets that role's model and instructions. If the spawn tool exposes no `agent_type` parameter, omit it and describe the role inside `message`. If a code block below conflicts with this section, this section wins.
diff --git a/plugins/omo/skills/teammode/SKILL.md b/plugins/omo/skills/teammode/SKILL.md
index 1435a9a3..7a1353a4 100644
--- a/plugins/omo/skills/teammode/SKILL.md
+++ b/plugins/omo/skills/teammode/SKILL.md
@@ -1,15 +1,15 @@
---
name: teammode
-description: "Codex-only team orchestration: run a named team of cooperating Codex threads with durable, script-managed state. MUST USE when the user asks Codex to create, run, coordinate, inspect, archive, or delete a team of threads/sessions, or to work on something as a team in parallel. The main session is always the leader; members are defined by a concrete part, ownership area, or perspective - never a vague job role; a bundled cross-platform script writes the .omo/teams state plus an auto-generated member field manual. Use a team when the work is not perfectly isolated but parallelizing helps, or when a task still needs exploration under a clear goal; use plain subagents when scope is perfectly isolated or the goal is ambiguous. Triggers: team mode, teammode, make a team, run as a team, team of agents, coordinate threads, parallel Codex threads, archive the team, delete the team."
+description: "Codex-only team orchestration: run a named team of cooperating Codex workers with durable, script-managed state. MUST USE when the user asks Codex to create, run, coordinate, inspect, archive, or delete a team of agents/threads/sessions, or to work on something as a team in parallel. FIRST inspects the active tool surface and tells the user which transport it selected: native MultiAgentV2 agents (flat spawn_agent with task_name) when available, Codex App threads as the fallback. The main session is always the leader; members are defined by a concrete part, ownership area, or perspective - never a vague job role; a bundled cross-platform script writes the .omo/teams state plus an auto-generated member field manual. Use a team when the work is not perfectly isolated but parallelizing helps; use plain subagents when scope is perfectly isolated or the goal is ambiguous. Triggers: team mode, teammode, make a team, run as a team, team of agents, coordinate threads, parallel Codex threads, archive the team."
---
# Teammode
-Run a named team of cooperating Codex threads under one leader, with durable state on disk.
-This is a Codex-only workflow. It is inspired by the lifecycle concerns in the
-Yeachan-Heo/oh-my-codex team skill, but it does not copy that runtime model and never depends
-on an external terminal runner - it coordinates through Codex's own thread tools plus a bundled
-state script.
+Run a named team of cooperating Codex workers under one leader, with durable state on disk.
+This is a Codex-only workflow. It never depends on an external terminal runner - it
+coordinates through Codex's own collaboration tools plus a bundled state script, on ONE of
+two transports chosen up front: native MultiAgentV2 agents, or Codex App threads as the
+fallback.
## When to use a team (and when to use plain subagents instead)
@@ -19,17 +19,43 @@ Use a TEAM when EITHER holds:
- one task still needs exploration, yet its GOAL is already clear - parallel investigation under
a fixed objective.
-Use plain subagents (`$ulw` / `multi_agent_v1.spawn_agent` / flat `spawn_agent` on `multi_agent_v2`) - NOT a team - when EITHER holds:
+Use plain fire-and-forget subagents (`$ulw` / one-off `spawn_agent` workers) - NOT a team - when
+EITHER holds:
- the work IS perfectly isolated, so there is no coordination cost worth paying; or
- the GOAL is still ambiguous, where one mind should resolve direction before any fan-out.
A team buys cross-member coordination at a real overhead cost; only spend it when coordination
is the thing you actually need.
+## Pick the transport FIRST - then tell the user
+
+Before creating any team state, decide which transport this session can run.
+Inspect your active tool list and select:
+
+1. **MultiAgentV2 (preferred)** - select when the flat V2 collaboration tools are ALL active:
+ flat `spawn_agent` whose schema requires `task_name`, plus `send_message`, `followup_task`,
+ `wait_agent`, `list_agents`, and `interrupt_agent`. Members are durable native agents
+ addressed by task name / agent path (`/root/<task_name>`). The namespaced
+ `multi_agent_v1.*` surface never qualifies as a team transport.
+2. **Codex App threads (fallback)** - select when flat V2 is not available but the
+ `codex_app.*` thread tools are (`create_thread`, `read_thread`, `send_message_to_thread`,
+ `set_thread_title`, `set_thread_archived`).
+3. **Neither complete set available** - STOP before `init`. Tell the user which tools are
+ missing; do not fake a team with partial tooling.
+
+Then, BEFORE running `init`, tell the user in one line which transport you selected and why,
+e.g. `Teammode transport: MultiAgentV2 (flat spawn_agent with task_name).` or
+`Teammode transport: Codex App threads (flat V2 tools not present in this session).`
+
+Pass that choice to `init` as `--transport multi_agent_v2` or `--transport codex_app`. The
+transport is recorded in `team.json` and is IMMUTABLE for the team's lifetime: a V2 spawn
+failure is a V2 blocker to report, never permission to mix Codex App threads into the same
+team. Never probe by trial-calling tools; read your tool list.
+
## You are the leader - orchestrate, do not implement
The main session is ALWAYS the team leader; you orchestrate directly and never spin up a separate
-leader thread. Your job is orchestration, NOT writing product code: split the work and assign each
+leader worker. Your job is orchestration, NOT writing product code: split the work and assign each
slice, hold live situational awareness of every member, verify and QA what they deliver, relay
findings between members, instruct and unblock, and synthesize the result. DELEGATE every code edit
to a member - if you catch yourself editing product files while the team runs, that work was a
@@ -39,7 +65,7 @@ merge), not the keystrokes.
## Compose by part, ownership, or perspective - not by job title
A team is ALWAYS two or more members - never a single-member team. One worker on an isolated
-job is a spawned subagent, not a team; if you end up with a single member,
+job is a plain subagent, not a team; if you end up with a single member,
either split off a second distinct slice or drop the team and use a subagent.
Compose the team from what you actually KNOW about the work. Ground the split in real knowledge
@@ -50,8 +76,10 @@ perspective/lens. Assigning a vague role ("backend dev", "release analyst", "the
anti-pattern - it gives the member no real boundary and invites overlap. Each member's `focus`
names what they own concretely; the `lens` is one of `area`, `ownership`, or `perspective`.
Give each member a short, distinct `--name` too - its role or what it watches (e.g.
-`app-server-lifecycle`, `mailbox-delivery`) - because that name titles its thread; never reuse
-one name for two members.
+`app-server-lifecycle`, `mailbox-delivery`) - it labels the member everywhere; never reuse
+one name for two members. On MultiAgentV2 teams also give each member a unique
+`--task-name` in `lowercase_digits_underscores` form - it becomes the member's permanent
+agent path `/root/<task_name>`.
## Run the script - never hand-write team state
@@ -60,9 +88,10 @@ the member manual by hand. Run it with `node` (or `bun`); it works on macOS, Lin
Replace `<skill-root>` with this skill's own directory.
```
-node "<skill-root>/scripts/team.mjs" init --name "<team>" --session-name "<session>" [--session <leader_session_id>] [--worktree] [--base-branch dev]
-node "<skill-root>/scripts/team.mjs" add-member --team <session_id> --id A --name "<short role>" --focus "<part/ownership/perspective>" --lens area|ownership|perspective --deliverable "<...>" [--branch <branch>]
-node "<skill-root>/scripts/team.mjs" bind-thread --team <session_id> --id A --thread <thread_id> [--cwd <path>]
+node "<skill-root>/scripts/team.mjs" init --name "<team>" --session-name "<session>" --transport multi_agent_v2|codex_app [--session <leader_thread_id>] [--worktree] [--base-branch dev]
+node "<skill-root>/scripts/team.mjs" add-member --team <session_id> --id A --name "<short role>" [--task-name <v2_task_name>] --focus "<part/ownership/perspective>" --lens area|ownership|perspective --deliverable "<...>" [--branch <branch>]
+node "<skill-root>/scripts/team.mjs" bind-agent --team <session_id> --id A --agent-path /root/<task_name> [--cwd <path>] # multi_agent_v2 teams
+node "<skill-root>/scripts/team.mjs" bind-thread --team <session_id> --id A --thread <thread_id> [--cwd <path>] # codex_app teams
node "<skill-root>/scripts/team.mjs" member-prompt --team <session_id> --id A
node "<skill-root>/scripts/team.mjs" set-status --team <session_id> --id A --status reported|blocked|active|archived [--note "<...>"]
node "<skill-root>/scripts/team.mjs" worktree-add --team <session_id> --id A [--base-branch <branch>]
@@ -74,70 +103,93 @@ node "<skill-root>/scripts/team.mjs" status --team <session_id>
```
`init` creates `.omo/teams/{session_id}/` containing `team.json` (the single durable state file:
-team id, the main-session leader, the member roster, status, worktree config, and a lifecycle
-log), `guide.md` (the auto-generated member field manual), and `artifacts/` (a shared exchange
-space). `{session_id}` is the leader's Codex session id when you can pass it via `--session`;
-otherwise the script generates a stable handle. Re-running `init` is a safe no-op. Every mutating
-subcommand rewrites `guide.md`, so the manual always matches the current team.
+team id, transport, the main-session leader, the member roster, status, worktree config, and a
+lifecycle log), `guide.md` (the auto-generated member field manual), and `artifacts/` (a shared
+exchange space). On codex_app teams `{session_id}` is the leader's Codex session id when you can
+pass it via `--session`; otherwise the script generates a stable handle. Re-running `init` is a
+safe no-op. Every mutating subcommand rewrites `guide.md`, so the manual always matches the
+current team.
Mutating subcommands take a per-team state lock before reading and rewriting `team.json`. It is
-safe to run independent `add-member`, `bind-thread`, `set-status`, `archive`, `delete`, `guide`,
-and worktree mutation commands concurrently against the same team: they serialize and each command
-reads the latest committed state before writing. If a command reports that team state is locked,
-do not treat the intended mutation as complete; retry after the named command finishes, or inspect
-`.omo/teams/{session_id}/.team.lock/owner.json` if the previous command crashed.
-
-## Create the team and its threads
-
-1. `init` the team, then `add-member` once per member.
-2. Create a durable thread per member with `codex_app.create_thread` - ALWAYS this tool for every
- member, never a spawned agent - titled `[team name] <member name>`, using THAT member's own
- name (its role / what it watches), so no two threads share a title. `add-member` prints the
- exact title to use. If `codex_app.create_thread` accepts a working directory / cwd argument,
- set it to that member's worktree; otherwise the member's manual tells it to `cd` there first.
- Use `codex_app.set_thread_title` if the title did not land at creation.
- If Codex returns only `pendingWorktreeId`, the worktree-backed thread is not ready yet: do not
- `bind-thread` and do not send the member bootstrap. Wait until Codex surfaces a real `threadId`
- or the thread appears in the thread list, then set the title, bind that real id with the cwd,
- and only then send the bootstrap.
-3. `bind-thread` to record each thread id (and `--cwd`), then send that member's bootstrap
- trigger (printed by `add-member` / `member-prompt`) as the thread's first message. The trigger
- is short on purpose: it tells the new thread to READ its `guide.md` and `team.json` rather than
- carrying the whole protocol inline.
-4. Whenever you report, audit, reopen, or hand off a member thread, include the app deep link
- `codex://threads/<thread_id>` next to the raw id. For example:
- `codex://threads/019ef350-ee78-72a3-bd5e-e40cebc3d814`. Worktree-backed threads are easy to
- lose in the sidebar without this link.
-
-Every team member is a real Codex thread created with `codex_app.create_thread` - this is strict,
-not a preference. NEVER substitute a spawned in-process subagent (`multi_agent_v1.spawn_agent` or flat `spawn_agent`)
-for a team member: a spawned agent is an ephemeral helper that does not show up as a team thread,
-cannot carry the `[team name] <member name>` title, and cannot be inspected, titled, archived, or
-re-opened with the `codex_app.*` thread tools - which defeats the entire point of a durable team.
-A member only counts once you have `bind-thread`-ed it to a real `codex_app.create_thread` thread
-id. If the thread-creation tool is unavailable, STOP and say so (see Stop rules); do not quietly
-fall back to a spawned agent.
+safe to run independent `add-member`, `bind-agent`, `bind-thread`, `set-status`, `archive`,
+`delete`, `guide`, and worktree mutation commands concurrently against the same team: they
+serialize and each command reads the latest committed state before writing. If a command reports
+that team state is locked, do not treat the intended mutation as complete; retry after the named
+command finishes, or inspect `.omo/teams/{session_id}/.team.lock/owner.json` if the previous
+command crashed. `bind-agent` refuses codex_app teams and `bind-thread` refuses multi_agent_v2
+teams, and a refused command never changes `team.json`.
+
+## Create the team and its members
+
+`init` the team, then `add-member` once per member. What happens next depends on the transport.
+
+**MultiAgentV2 teams:**
+1. If a member needs an isolated worktree, run `worktree-add` BEFORE spawning it - flat
+ `spawn_agent` has no cwd argument, so the path must ride in the bootstrap message.
+2. Spawn each member with flat `spawn_agent`: `task_name` is that member's `--task-name`,
+ `message` is the bootstrap printed by `add-member` / `member-prompt`, and
+ `fork_turns: "none"` (members read `guide.md` for context; full parent history is not
+ their context model). Do not set `agent_type`, `model`, or `reasoning_effort`.
+3. `bind-agent --agent-path` with the canonical task name the spawn returned (normally
+ `/root/<task_name>`); binding confirms the runtime identity matches the roster and records
+ the member's cwd. Members are durable: they persist as subagent threads, survive idling,
+ and are re-tasked with `followup_task` - never respawned under a second name.
+4. Members appear in `list_agents` with their task paths; inspect status there instead of
+ deep links (V2 exposes no thread title or `codex://` link surface to you).
+
+**Codex App teams:**
+1. Create a durable thread per member with `codex_app.create_thread` - ALWAYS this tool for
+ every member - titled `[team name] <member name>`, using THAT member's own name, so no two
+ threads share a title. `add-member` prints the exact title to use. If the tool accepts a
+ working directory / cwd argument, set it to that member's worktree; otherwise the member's
+ manual tells it to `cd` there first. Use `codex_app.set_thread_title` if the title did not
+ land at creation. If Codex returns only `pendingWorktreeId`, the worktree-backed thread is
+ not ready yet: do not `bind-thread` and do not send the member bootstrap. Wait until Codex
+ surfaces a real `threadId`, then set the title, bind that real id with the cwd, and only
+ then send the bootstrap.
+2. `bind-thread` to record each thread id (and `--cwd`), then send that member's bootstrap
+ trigger as the thread's first message. The trigger is short on purpose: it tells the new
+ thread to READ its `guide.md` and `team.json` rather than carrying the whole protocol inline.
+3. Whenever you report, audit, reopen, or hand off a member thread, include the app deep link
+ `codex://threads/<thread_id>` next to the raw id - worktree-backed threads are easy to lose
+ in the sidebar without it. On a codex_app team, a spawned in-process agent is never a
+ member substitute: it cannot carry the team title or be inspected, titled, archived, or
+ re-opened with the `codex_app.*` tools this team runs on.
+
+On either transport, a member only counts once it is bound (`bind-agent` / `bind-thread`). If
+the selected transport's tools stop working mid-run, STOP and say so (see Stop rules); do not
+quietly switch transports.
## Communication
-Members push to you and to one another with `codex_app.send_message_to_thread`; you inspect their
-state with `codex_app.read_thread`. So members can actually reach you, run `init` with
-`--session <your own thread id>` - that makes `leader.sessionId` in team.json a real, messageable
-thread; without it members cannot report to you and you are stuck polling. The generated manual binds
-members to the hard rules, so you mainly keep the channel open: expect frequent small inbound updates
-from each member - findings, `WORKING:`/`BLOCKED:` markers, peer digests - rather than one final
-dump, and act on them as they arrive. All member-to-member and member-to-leader traffic is in English;
-when the END user addresses a member, that member replies in the user's own language. Members hand off
-files and memos through the team `artifacts/` directory and reference them by path.
+Members push to you and to one another; you never poll them as a routine. The address book is
+`team.json`, and the generated manual binds members to the hard rules, so you mainly keep the
+channel open: expect frequent small inbound updates from each member - findings,
+`WORKING:`/`BLOCKED:` markers, peer digests - rather than one final dump, and act on them as
+they arrive.
+
+- **MultiAgentV2:** members reach you with `send_message` to `/root` and reach peers by their
+ `members[].agentPath`. You reach members the same way; use `followup_task` when you hand an
+ idle member NEW work (it wakes the member), `send_message` for context that should not
+ interrupt, and `wait_agent` only when you are genuinely blocked on their next update - a
+ `wait_agent` timeout only means no new mailbox update arrived, never that a member failed.
+ Your own session IS `/root` - members can always reach you; leave `--session` unset.
+- **Codex App:** members push with `codex_app.send_message_to_thread`; you inspect state with
+ `codex_app.read_thread`. So members can actually reach you, run `init` with
+ `--session <your own thread id>` - that makes `leader.sessionId` in team.json a real,
+ messageable thread; without it members cannot report to you and you are stuck polling.
+
+All member-to-member and member-to-leader traffic is in English; when the END user addresses a
+member, that member replies in the user's own language. Members hand off files and memos
+through the team `artifacts/` directory and reference them by path.
## Let members work - do not rush them
Members heartbeat every few tool calls and message you on every finding, blocker, and finished
slice (their manual binds them to this). So a member that is quiet between heartbeats is **working,
not stalled** - a stretch of silence is the normal sound of focused work, not a problem to chase.
-Re-reading `codex_app.read_thread` to check on a calm member, or sending "any update?" / "are you
-done?" / "hurry up" pings, interrupts that member and slows the whole team. Trust the heartbeat and
-let them cook.
+Re-reading a calm member's state, or sending "any update?" / "are you done?" / "hurry up" pings,
+interrupts that member and slows the whole team. Trust the heartbeat and let them cook.
Message a member only when one of these is true:
- you have new information, context, or a correction it needs to do its slice right;
@@ -147,7 +199,9 @@ Message a member only when one of these is true:
then send one specific question, not a barrage.
Otherwise stay calm and keep the channel open: read inbound updates as they arrive and act on them.
-A long-running member is alive; a heartbeat you have not received yet is not a failure. Wait for
+A long-running member is alive; a heartbeat you have not received yet is not a failure. Fallback only when
+a member is completed without its deliverable, explicitly `BLOCKED:`, or no longer running - then
+unblock, reassign, or re-task that slice instead of waiting on it. Wait for
every required member's final report before you declare the team done - rushing toward "done" while
members are still mid-slice just produces half-built work you will have to redo.
@@ -162,10 +216,12 @@ its own worktree. To land the work, `integrate --team <id>` merges every member
current branch with a merge commit (never a squash or rebase); resolve any conflict it reports, then
`worktree-remove` each worktree at cleanup.
-After `worktree-add`, immediately send the member a follow-up that includes both its assigned
-worktree path and its `codex://threads/<thread_id>` link. Use `bind-thread --cwd <worktree>` or
-`--worktree-path <worktree>` after the thread exists so `team.json`, `guide.md`, `status`, and
-`member-prompt` all point at the same worktree-backed thread.
+Delivering the path differs by transport: on MultiAgentV2, create the worktree BEFORE spawning
+so the bootstrap carries it, or send it to an already-running member as a `followup_task`; on
+Codex App, send a follow-up message that includes both the worktree path and the member's
+`codex://threads/<thread_id>` link. Either way, run `bind-agent`/`bind-thread` with
+`--cwd <worktree>` (or `--worktree-path`) so `team.json`, `guide.md`, `status`, and
+`member-prompt` all point at the same worktree-backed member.
When the member starts inside a worktree, it must verify the assigned cwd exists and contains the
repository checkout before editing. If the directory is missing, empty, or does not look like a git
@@ -194,8 +250,11 @@ then delete the team state only after archival evidence is clean or preserved. A
is never disbanded is a leak.
- `archive` closes the team: notify each active member, copy anything useful into `artifacts/`,
- then try to archive each member thread with `codex_app.set_thread_archived`. Treat Codex App
- failures such as "Ambiguous Codex thread id" or a thread id that is ambiguous across hosts as an
+ then close each member on its transport. On MultiAgentV2, `interrupt_agent` any member still
+ mid-turn and record in the note that V2 exposes no runtime archive operation - the durable
+ `team.json` state IS the archive; never claim a V2 agent itself was archived. On Codex App,
+ try `codex_app.set_thread_archived` per member thread; treat failures such as
+ "Ambiguous Codex thread id" or an id that is ambiguous across hosts as an
app-thread archival blocker, not as a team-state blocker: record the failure in the team log,
tell the user which member thread was not proven archived, and continue the team-state archive
with `archive --note "<blocker>"`. Never pretend a member thread was archived. Do not delete the
@@ -212,5 +271,6 @@ is never disbanded is a leak.
- Stop and ask before deleting an unarchived team while any member is still active.
- Member communication stays English unless the user explicitly requests otherwise; user-facing
replies follow the user's language.
-- Stop if the requested operation needs Codex thread tools (create/read/send/title/archive) and
- they are unavailable; say so instead of faking it.
+- Stop if the selected transport's tools (V2 spawn/message/wait/list/interrupt, or Codex App
+ create/read/send/title/archive) are unavailable or stop working; say so instead of faking it
+ or silently switching transports.
diff --git a/plugins/omo/skills/teammode/scripts/team-guide.mjs b/plugins/omo/skills/teammode/scripts/team-guide.mjs
index 0eaae617..acf5a1fd 100644
--- a/plugins/omo/skills/teammode/scripts/team-guide.mjs
+++ b/plugins/omo/skills/teammode/scripts/team-guide.mjs
@@ -1,23 +1,57 @@
// team-guide.mjs - render the member-facing field manual (guide.md) and the short
-// bootstrap trigger a new thread reads on startup. Pure string builders, no I/O.
+// bootstrap trigger a new member reads on startup. Pure string builders, no I/O.
//
// The manual is the durable, two-channel replacement for per-prompt guidance: the leader
-// writes it once at team creation, and every member thread is told to READ it instead of
-// receiving the rules inline each turn.
+// writes it once at team creation, and every member is told to READ it instead of
+// receiving the rules inline each turn. Every rendered surface branches on the team's
+// transport: multi_agent_v2 members are native agents addressed by agent path; codex_app
+// members are app threads addressed by thread id.
+
+import { isMultiAgentV2, LEADER_AGENT_PATH } from "./team-transport.mjs";
export function codexThreadLink(threadId) {
return `codex://threads/${threadId}`;
}
-function memberLine(member) {
+function transportLabel(team) {
+ return isMultiAgentV2(team)
+ ? "MultiAgentV2 (native agents: flat `spawn_agent` / `send_message` / `followup_task`)"
+ : "Codex App threads (`codex_app.*` tools)";
+}
+
+function memberEndpoint(member, v2) {
+ if (v2) {
+ return member.agentPath ? ` | task \`${member.taskName}\` | agent \`${member.agentPath}\`` : " | agent not spawned yet";
+ }
const thread = member.threadId ? ` | thread ${member.threadId} (${codexThreadLink(member.threadId)})` : " | thread not created yet";
+ const title = member.threadTitle ? ` | thread title \`${member.threadTitle}\`` : "";
+ return `${title}${thread}`;
+}
+
+function memberLine(member, v2) {
const wt = member.worktree?.path ? ` | worktree ${member.worktree.path}` : "";
const name = member.name ? ` "${member.name}"` : "";
- const title = member.threadTitle ? ` | thread title \`${member.threadTitle}\`` : "";
- return `- **${member.id}**${name} (${member.lens}) - ${member.focus}${member.deliverable ? ` -> ${member.deliverable}` : ""}${title}${thread}${wt} [${member.status}]`;
+ return `- **${member.id}**${name} (${member.lens}) - ${member.focus}${member.deliverable ? ` -> ${member.deliverable}` : ""}${memberEndpoint(member, v2)}${wt} [${member.status}]`;
+}
+
+function worktreeMemberEndpoint(member, v2) {
+ if (v2) return member.agentPath ? `; agent \`${member.agentPath}\`` : "";
+ return member.threadId ? `; thread ${codexThreadLink(member.threadId)}` : "";
+}
+
+function worktreeReadinessNote(v2) {
+ if (v2) {
+ return `Your worktree is created by the leader BEFORE you spawn; the exact path is in your row
+above and in your bootstrap. If the leader enables isolation mid-run, the new path arrives
+as a \`followup_task\` - switch to it before your next edit.`;
+ }
+ return `If Codex returns only \`pendingWorktreeId\` while the leader is creating a worktree-backed member
+thread, the thread is not ready yet. The leader must wait until Codex surfaces a real thread id,
+then bind that real id and send the bootstrap.`;
}
function worktreeSection(team) {
+ const v2 = isMultiAgentV2(team);
if (!team.worktree?.enabled) {
return `## Worktrees
@@ -28,8 +62,8 @@ that is a coordination signal: mark yourself \`blocked\` and tell the leader at
const lines = team.members
.filter((m) => m.worktree?.path || m.worktree?.branch)
.map((m) => {
- const thread = m.threadId ? `; thread ${codexThreadLink(m.threadId)}` : "";
- return `- **${m.id}**: worktree \`${m.worktree.path ?? "(assign with bind-thread --cwd)"}\` on branch \`${m.worktree.branch ?? team.worktree.baseBranch}\`${thread}`;
+ const bindHint = v2 ? "(assign with bind-agent --cwd)" : "(assign with bind-thread --cwd)";
+ return `- **${m.id}**: worktree \`${m.worktree.path ?? bindHint}\` on branch \`${m.worktree.branch ?? team.worktree.baseBranch}\`${worktreeMemberEndpoint(m, v2)}`;
});
return `## Worktrees (ISOLATION IS ON - this is not optional for you)
@@ -41,25 +75,48 @@ Before editing, verify that your assigned worktree exists and contains repo file
missing, empty, or does not look like a git worktree/repository yet, send \`BLOCKED: worktree not ready\`
to the leader and wait instead of editing any parent checkout or empty directory.
-If Codex returns only \`pendingWorktreeId\` while the leader is creating a worktree-backed member
-thread, the thread is not ready yet. The leader must wait until Codex surfaces a real thread id,
-then bind that real id and send the bootstrap.
+${worktreeReadinessNote(v2)}
-${lines.length ? lines.join("\n") : "- (worktree paths are assigned as threads are bound; read team.json for yours)"}`;
+${lines.length ? lines.join("\n") : "- (worktree paths are assigned as members are bound; read team.json for yours)"}`;
+}
+
+function addressBookRules(team) {
+ if (isMultiAgentV2(team)) {
+ return `- **Reach the leader and your peers with \`send_message\` - not by narrating in your own
+ transcript, where no one reads it.** The address book is in team.json: the leader's target
+ is \`${LEADER_AGENT_PATH}\`, and each peer's target is its \`members[].agentPath\` (built from its
+ \`members[].taskName\`).
+- **Use \`send_message\` for updates and \`followup_task\` only when handing a peer a NEW task**
+ that should wake it. Never invent an agent path - read it from team.json.`;
+ }
+ return `- **Reach the leader and your peers with \`codex_app.send_message_to_thread\` - not by narrating in
+ your own thread, where no one reads it.** The address book is in team.json: the leader thread id
+ is \`leader.sessionId\`, and each peer thread id is its \`members[].threadId\`.
+- **When you mention a Codex thread, include its app link too:** \`codex://threads/<threadId>\`.
+ These links are the fastest way for the leader to reopen worktree-backed member threads.`;
+}
+
+function identityHeaderLine(team) {
+ if (isMultiAgentV2(team)) {
+ return `- Member identity convention: each member is the agent path \`${LEADER_AGENT_PATH}/<task name>\` - your row below shows yours; two members never share a task name`;
+ }
+ return `- Thread title convention: \`${team.threadTitleConvention}\` - each member's thread takes its OWN title from its name (your row below shows yours); two members never share a title`;
}
export function buildGuide(team) {
+ const v2 = isMultiAgentV2(team);
const artifacts = team.paths?.artifacts ?? ".omo/teams/<session_id>/artifacts";
const teamJson = team.paths?.team ?? ".omo/teams/<session_id>/team.json";
- const roster = team.members.length ? team.members.map(memberLine).join("\n") : "- (no members yet)";
+ const roster = team.members.length ? team.members.map((member) => memberLine(member, v2)).join("\n") : "- (no members yet)";
return `# Team ${team.teamName} - Member Field Manual
> Auto-generated by the teammode script. This file is the single source of truth for how
> this team works. Re-read it whenever you are unsure - do not improvise the protocol.
- Team: **${team.teamName}** (id \`${team.teamId}\`)
+- Transport: **${transportLabel(team)}**
- Team state: \`${teamJson}\`
-- Thread title convention: \`${team.threadTitleConvention}\` - each member's thread takes its OWN title from its name (your row below shows yours); two members never share a title
+${identityHeaderLine(team)}
## Who you are (your identity is fixed)
@@ -82,11 +139,7 @@ coordinate with each other, but the leader owns the final decision and integrati
is mandatory regardless of the language the task was given in.
- **Exception: when the END USER addresses you directly, reply in the user's own language.**
Team-internal traffic stays English; user-facing replies match the user.
-- **Reach the leader and your peers with \`codex_app.send_message_to_thread\` - not by narrating in
- your own thread, where no one reads it.** The address book is in team.json: the leader thread id
- is \`leader.sessionId\`, and each peer thread id is its \`members[].threadId\`.
-- **When you mention a Codex thread, include its app link too:** \`codex://threads/<threadId>\`.
- These links are the fastest way for the leader to reopen worktree-backed member threads.
+${addressBookRules(team)}
- **Push a short message at each of these moments - never batch them into one report at the end:**
- to the **leader**: every finding or decision, every file or sub-task you finish, a
\`WORKING: <focus> - <phase>\` heartbeat every few tool calls so you never look stale, a
@@ -116,6 +169,25 @@ Your slice is done only when (1) the deliverable exists, (2) you have evidence i
(3) you have reported it to the leader. Until all three are true, keep going.`;
}
+function memberIdentityLine(team, member) {
+ if (isMultiAgentV2(team)) {
+ return `Your task name is \`${member.taskName}\` (agent path \`${member.agentPath}\`).`;
+ }
+ return `Your thread title is \`${member.threadTitle}\`.`;
+}
+
+function memberEndpointNote(team, member) {
+ if (isMultiAgentV2(team)) return "";
+ return member.threadId ? `\nYour Codex thread link is ${codexThreadLink(member.threadId)}. Include it when reporting handoffs or worktree status.` : "";
+}
+
+function pushInstruction(team) {
+ if (isMultiAgentV2(team)) {
+ return `Push updates to the leader (target \`${LEADER_AGENT_PATH}\`) and relevant peers (their team.json \`members[].agentPath\`) with \`send_message\` as you work`;
+ }
+ return "Push updates to the leader and relevant peers with `codex_app.send_message_to_thread` as you work";
+}
+
export function buildMemberPrompt(team, id) {
const member = team.members.find((m) => m.id === id);
if (!member) throw new Error(`no member with id "${id}"`);
@@ -126,14 +198,13 @@ export function buildMemberPrompt(team, id) {
: team.worktree?.enabled
? "Wait for the leader to bind your worktree cwd before editing."
: "Work from the repository root unless your manual assigns a worktree.";
- const threadLink = member.threadId ? `\nYour Codex thread link is ${codexThreadLink(member.threadId)}. Include it when reporting handoffs or worktree status.` : "";
const readiness =
team.worktree?.enabled
? "\nBefore editing, verify that your assigned worktree exists and contains repo files. If this prompt arrived before your Codex worktree checkout is ready, or the path is missing, empty, or not a git worktree/repository yet, report `BLOCKED: worktree not ready` to the leader and wait."
: "";
- return `You are member ${member.id}${member.name ? ` (${member.name})` : ""} of team ${team.teamName} - owner of: ${member.focus}. Your thread title is \`${member.threadTitle}\`.
+ return `You are member ${member.id}${member.name ? ` (${member.name})` : ""} of team ${team.teamName} - owner of: ${member.focus}. ${memberIdentityLine(team, member)}
FIRST read your field manual at \`${guide}\`, then the team state at \`${teamJson}\`; they define your scope, deliverable, the leader, the artifacts directory, and the communication rules.
-${where}${threadLink}${readiness}
+${where}${memberEndpointNote(team, member)}${readiness}
Communicate with the team and leader in English; reply to the end user in the user's own language.
-Start now. Push updates to the leader and relevant peers with \`codex_app.send_message_to_thread\` as you work - findings, \`WORKING:\` heartbeats, and \`BLOCKED:\` the instant you stall - never just one report at the end.`;
+Start now. ${pushInstruction(team)} - findings, \`WORKING:\` heartbeats, and \`BLOCKED:\` the instant you stall - never just one report at the end.`;
}
diff --git a/plugins/omo/skills/teammode/scripts/team-state.mjs b/plugins/omo/skills/teammode/scripts/team-state.mjs
index 45f332e8..b8e48c4e 100644
--- a/plugins/omo/skills/teammode/scripts/team-state.mjs
+++ b/plugins/omo/skills/teammode/scripts/team-state.mjs
@@ -13,6 +13,16 @@ import { lstat, mkdir, readFile, rename, rm, writeFile } from "node:fs/promises"
import { dirname, isAbsolute, join, relative, resolve } from "node:path";
import { setTimeout as delay } from "node:timers/promises";
+import {
+ agentPathForTaskName,
+ assertTransport,
+ isMultiAgentV2,
+ LEADER_AGENT_PATH,
+ parseTaskName,
+ parseTeamTransport,
+ TEAM_SCHEMA_VERSION,
+} from "./team-transport.mjs";
+
export const LENSES = ["area", "ownership", "perspective"];
export const MEMBER_STATUSES = ["pending", "active", "reported", "blocked", "archived"];
// A team is never a single member: two or more distinct slices is the minimum. One isolated
@@ -32,22 +42,25 @@ function isoNow(now) {
return now ?? new Date().toISOString();
}
-export function buildTeam({ teamName, sessionName, sessionId = null, dir = null, worktreeEnabled = false, baseBranch = "dev", now }) {
+export function buildTeam({ teamName, sessionName, sessionId = null, dir = null, worktreeEnabled = false, baseBranch = "dev", transport, now }) {
if (!teamName?.trim()) throw new Error("team name is required");
if (!sessionName?.trim()) throw new Error("session name is required");
+ const teamTransport = parseTeamTransport(transport);
+ const v2 = teamTransport === "multi_agent_v2";
const ts = isoNow(now);
return {
- schemaVersion: 2,
+ schemaVersion: TEAM_SCHEMA_VERSION,
+ transport: teamTransport,
teamId: randomUUID(),
teamName: teamName.trim(),
sessionName: sessionName.trim(),
sessionId,
- threadTitleConvention: `[${teamName.trim()}] <member name>`,
+ threadTitleConvention: v2 ? null : `[${teamName.trim()}] <member name>`,
status: "active",
createdAt: ts,
updatedAt: ts,
archivedAt: null,
- leader: { kind: "main-session", sessionId },
+ leader: { kind: "main-session", sessionId: v2 ? null : sessionId, agentPath: v2 ? LEADER_AGENT_PATH : null },
communication: { memberLanguage: "english", replyToUserInUserLanguage: true },
worktree: { enabled: Boolean(worktreeEnabled), baseBranch, root: dir ? join(dir, "worktrees") : null },
paths: dir
@@ -124,21 +137,44 @@ function assertUniqueMemberThreadTitle(team) {
}
}
-function assertTeamReadyForThreadBinding(team) {
+function assertUniqueMemberTaskName(team) {
+ const seen = new Map();
+ for (const member of team.members) {
+ const taskName = parseTaskName(member.taskName);
+ const previous = seen.get(taskName);
+ if (previous) {
+ throw new Error(`member taskName "${taskName}" duplicates "${previous.taskName}" (no two members may share an agent path)`);
+ }
+ if (member.agentPath !== agentPathForTaskName(taskName)) {
+ throw new Error(`member "${member.id}" agentPath "${member.agentPath}" does not match task name "${taskName}"`);
+ }
+ seen.set(taskName, member);
+ }
+}
+
+function assertUniqueTransportIdentity(team) {
+ if (isMultiAgentV2(team)) assertUniqueMemberTaskName(team);
+ else assertUniqueMemberThreadTitle(team);
+}
+
+function assertTeamReadyForBinding(team) {
if (isUnderstaffed(team)) {
throw new Error(
- `cannot bind member threads until the team has at least ${MIN_MEMBERS} distinct members; current count is ${team.members.length}`,
+ `cannot bind members until the team has at least ${MIN_MEMBERS} distinct members; current count is ${team.members.length}`,
);
}
assertUniqueMemberFocus(team);
assertUniqueMemberName(team);
- assertUniqueMemberThreadTitle(team);
+ assertUniqueTransportIdentity(team);
}
-export function addMember(team, { id, focus, lens, deliverable = "", branch = null, name = null }) {
+export function addMember(team, { id, focus, lens, deliverable = "", branch = null, name = null, taskName = null }) {
if (!id?.trim()) throw new Error("member id is required");
if (!focus?.trim()) throw new Error("member focus is required - a concrete part, ownership area, or perspective");
if (!LENSES.includes(lens)) throw new Error(`invalid lens "${lens}" - use one of: ${LENSES.join(", ")}`);
+ const v2 = isMultiAgentV2(team);
+ if (!v2 && taskName !== null) throw new Error("--task-name is only valid on multi_agent_v2 teams");
+ const memberTaskName = v2 ? parseTaskName(taskName) : null;
const memberId = id.trim();
const memberFocus = focus.trim();
// The member name is the short role label that titles this member's thread. Fall back to the
@@ -151,14 +187,20 @@ export function addMember(team, { id, focus, lens, deliverable = "", branch = nu
if (duplicateName) {
throw new Error(`member name "${memberName}" duplicates "${duplicateName.name ?? duplicateName.focus}" (no two members may produce the same thread title)`);
}
+ if (v2) {
+ const duplicateTask = team.members.find((m) => m.taskName === memberTaskName);
+ if (duplicateTask) throw new Error(`member taskName "${memberTaskName}" duplicates "${duplicateTask.taskName}" (no two members may share an agent path)`);
+ }
team.members.push({
id: memberId,
name: memberName,
focus: memberFocus,
lens,
deliverable: deliverable.trim(),
+ taskName: memberTaskName,
+ agentPath: v2 ? agentPathForTaskName(memberTaskName) : null,
threadId: null,
- threadTitle: `[${team.teamName}] ${memberName}`,
+ threadTitle: v2 ? null : `[${team.teamName}] ${memberName}`,
cwd: null,
worktree: { path: null, branch: branch ?? null },
status: "pending",
@@ -167,8 +209,9 @@ export function addMember(team, { id, focus, lens, deliverable = "", branch = nu
}
export function bindThread(team, { id, threadId, cwd = null, worktreePath = null }) {
+ assertTransport(team, "codex_app", "bind-thread");
if (!threadId?.trim()) throw new Error("thread id is required");
- assertTeamReadyForThreadBinding(team);
+ assertTeamReadyForBinding(team);
const m = memberById(team, id);
m.threadId = threadId.trim();
m.status = "active";
@@ -177,6 +220,21 @@ export function bindThread(team, { id, threadId, cwd = null, worktreePath = null
return touch(team, "bind-thread", `member ${id} -> thread ${threadId.trim()}`);
}
+export function bindAgent(team, { id, agentPath, cwd = null, worktreePath = null }) {
+ assertTransport(team, "multi_agent_v2", "bind-agent");
+ if (!agentPath?.trim()) throw new Error("agent path is required");
+ assertTeamReadyForBinding(team);
+ const m = memberById(team, id);
+ const boundPath = agentPath.trim();
+ if (boundPath !== m.agentPath) {
+ throw new Error(`agent path mismatch for member ${m.id}: expected "${m.agentPath}" (task name "${m.taskName}"), got "${boundPath}"`);
+ }
+ m.status = "active";
+ if (cwd) m.cwd = cwd;
+ if (team.worktree.enabled) m.worktree.path = worktreePath ?? cwd ?? m.worktree.path;
+ return touch(team, "bind-agent", `member ${id} -> agent ${boundPath}`);
+}
+
export function setMemberStatus(team, { id, status, note = "" }) {
if (!MEMBER_STATUSES.includes(status)) throw new Error(`invalid status "${status}" - use one of: ${MEMBER_STATUSES.join(", ")}`);
memberById(team, id).status = status;
@@ -204,22 +262,44 @@ export function clearMemberWorktree(team, { id }) {
export function archive(team, { id = null, note = "" } = {}) {
if (id) {
memberById(team, id).status = "archived";
- return touch(team, "archive-member", `member ${id}${note ? `: ${note}` : ""}`);
+ const memberQualifier = isMultiAgentV2(team) ? " (team state only; V2 exposes no runtime archive operation)" : "";
+ return touch(team, "archive-member", `member ${id}${memberQualifier}${note ? `: ${note}` : ""}`);
}
for (const m of team.members) m.status = "archived";
team.status = "archived";
team.archivedAt = isoNow();
- return touch(team, "archive", note || "team archived; all members closed");
+ // The default detail must never claim a runtime closure that did not happen: V2 exposes no
+ // runtime archive operation, so only the durable team state is archived there.
+ const defaultDetail = isMultiAgentV2(team)
+ ? "team archived; V2 exposes no runtime archive operation - durable team state is the archive"
+ : "team archived; all members closed";
+ return touch(team, "archive", note || defaultDetail);
+}
+
+// schemaVersion 2 predates transports; that skill allowed ONLY Codex App threads as members,
+// so a legacy team is migrated in memory as codex_app and persisted on the next mutation.
+function migrateLegacyTeam(team) {
+ if (team?.schemaVersion !== 2) return team;
+ team.schemaVersion = TEAM_SCHEMA_VERSION;
+ team.transport = "codex_app";
+ if (team.leader && typeof team.leader === "object") team.leader.agentPath = null;
+ for (const member of team.members ?? []) {
+ member.taskName = null;
+ member.agentPath = null;
+ }
+ return team;
}
export function validateTeam(team) {
- if (team?.schemaVersion !== 2) throw new Error("invalid team: schemaVersion must be 2");
+ migrateLegacyTeam(team);
+ if (team?.schemaVersion !== TEAM_SCHEMA_VERSION) throw new Error(`invalid team: schemaVersion must be ${TEAM_SCHEMA_VERSION}`);
+ parseTeamTransport(team.transport);
if (!team.teamId || !team.teamName) throw new Error("invalid team: teamId and teamName are required");
if (team.leader?.kind !== "main-session") throw new Error("invalid team: leader.kind must be main-session");
if (!Array.isArray(team.members)) throw new Error("invalid team: members must be an array");
assertUniqueMemberFocus(team);
assertUniqueMemberName(team);
- assertUniqueMemberThreadTitle(team);
+ assertUniqueTransportIdentity(team);
return team;
}
diff --git a/plugins/omo/skills/teammode/scripts/team-transport.mjs b/plugins/omo/skills/teammode/scripts/team-transport.mjs
new file mode 100644
index 00000000..0c7402b8
--- /dev/null
+++ b/plugins/omo/skills/teammode/scripts/team-transport.mjs
@@ -0,0 +1,55 @@
+// team-transport.mjs - the single source of transport identity for teammode state.
+//
+// A team runs on exactly ONE transport, chosen at init and immutable afterwards:
+// - "multi_agent_v2": members are native Codex MultiAgentV2 agents addressed by task
+// name / canonical agent path (`/root/<task_name>`), messaged with flat `send_message`
+// and `followup_task`.
+// - "codex_app": members are durable Codex App threads addressed by thread id, messaged
+// with `codex_app.send_message_to_thread` (the fallback when flat V2 tools are absent).
+//
+// Zero external dependencies (node builtins only), same portability contract as the
+// sibling scripts.
+
+export const TEAM_SCHEMA_VERSION = 3;
+export const TEAM_TRANSPORTS = ["multi_agent_v2", "codex_app"];
+export const DEFAULT_TEAM_TRANSPORT = "codex_app";
+export const LEADER_AGENT_PATH = "/root";
+
+// Codex validates V2 task names as lowercase letters, digits, and underscores; "root" is
+// the leader's own path segment and can never name a member.
+const TASK_NAME_PATTERN = /^[a-z0-9_]+$/;
+
+export function parseTeamTransport(value = DEFAULT_TEAM_TRANSPORT) {
+ if (!TEAM_TRANSPORTS.includes(value)) {
+ throw new Error(`invalid transport "${value}" - use one of: ${TEAM_TRANSPORTS.join(", ")}`);
+ }
+ return value;
+}
+
+export function isMultiAgentV2(team) {
+ return team?.transport === "multi_agent_v2";
+}
+
+export function isCodexApp(team) {
+ return team?.transport === "codex_app";
+}
+
+export function assertTransport(team, transport, operation) {
+ if (team?.transport !== transport) {
+ throw new Error(`${operation} is only valid on ${transport} teams; this team's transport is "${team?.transport}"`);
+ }
+}
+
+export function parseTaskName(taskName) {
+ const trimmed = typeof taskName === "string" ? taskName.trim() : "";
+ if (!trimmed) throw new Error("member task name is required on multi_agent_v2 teams (--task-name)");
+ if (!TASK_NAME_PATTERN.test(trimmed)) {
+ throw new Error(`invalid task name "${trimmed}" - use lowercase letters, digits, and underscores`);
+ }
+ if (trimmed === "root") throw new Error('invalid task name "root" - it names the leader, never a member');
+ return trimmed;
+}
+
+export function agentPathForTaskName(taskName) {
+ return `${LEADER_AGENT_PATH}/${taskName}`;
+}
diff --git a/plugins/omo/skills/teammode/scripts/team.mjs b/plugins/omo/skills/teammode/scripts/team.mjs
index 5f79a882..cc8dab66 100644
--- a/plugins/omo/skills/teammode/scripts/team.mjs
+++ b/plugins/omo/skills/teammode/scripts/team.mjs
@@ -6,9 +6,10 @@
// Zero external dependencies (node builtins only): runs identically under node and bun on
// macOS, Linux, and Windows.
//
-// node "<skill-root>/scripts/team.mjs" init --name "<team>" --session-name "<sess>" [--session <id>] [--worktree] [--base-branch dev]
-// node "<skill-root>/scripts/team.mjs" add-member --team <id> --id A --name "<short role>" --focus "<part/ownership/perspective>" --lens area|ownership|perspective --deliverable "<...>" [--branch <b>]
-// node "<skill-root>/scripts/team.mjs" bind-thread --team <id> --id A --thread <thread-id> [--cwd <path>]
+// node "<skill-root>/scripts/team.mjs" init --name "<team>" --session-name "<sess>" [--transport multi_agent_v2|codex_app] [--session <id>] [--worktree] [--base-branch dev]
+// node "<skill-root>/scripts/team.mjs" add-member --team <id> --id A --name "<short role>" --focus "<part/ownership/perspective>" --lens area|ownership|perspective --deliverable "<...>" [--task-name <v2 task name>] [--branch <b>]
+// node "<skill-root>/scripts/team.mjs" bind-agent --team <id> --id A --agent-path /root/<task_name> [--cwd <path>] (multi_agent_v2 teams)
+// node "<skill-root>/scripts/team.mjs" bind-thread --team <id> --id A --thread <thread-id> [--cwd <path>] (codex_app teams)
// node "<skill-root>/scripts/team.mjs" member-prompt --team <id> --id A
// node "<skill-root>/scripts/team.mjs" set-status --team <id> --id A --status reported|blocked|active|archived [--note "<...>"]
// node "<skill-root>/scripts/team.mjs" archive --team <id> [--id A] [--note "<...>"]
@@ -25,6 +26,7 @@ import {
addMember,
archive,
assertSafeTeamDir,
+ bindAgent,
bindThread,
buildTeam,
clearMemberWorktree,
@@ -39,6 +41,7 @@ import {
writeGuideAtomic,
writeTeamAtomic,
} from "./team-state.mjs";
+import { isMultiAgentV2, parseTeamTransport } from "./team-transport.mjs";
import { addMemberWorktree, integrateMemberBranch, removeMemberWorktree } from "./team-worktree.mjs";
function parseFlags(args) {
@@ -95,11 +98,20 @@ const handlers = {
async init(cwd, flags) {
const teamName = requireFlag(flags, "name");
const sessionName = requireFlag(flags, "session-name");
+ // Validate the transport BEFORE any directory exists so a bad value leaves no state behind.
+ // A valueless `--transport` parses as `true` and must fail loudly, never default silently.
+ const transport = parseTeamTransport(flags.transport === undefined ? undefined : flags.transport);
const sessionId = typeof flags.session === "string" ? flags.session : `team-${randomUUID().slice(0, 8)}`;
const dir = await ensureTeamDir(cwd, sessionId);
await withTeamLock(dir, "init", async () => {
if (await teamExists(dir)) {
- process.stdout.write(`exists: ${dir} (left untouched; re-init is a safe no-op)\n`);
+ const existing = await readTeam(dir);
+ if (flags.transport !== undefined && existing.transport !== transport) {
+ throw new Error(
+ `team "${sessionId}" already exists with transport "${existing.transport}" - transport is immutable; keep using it or delete the team first`,
+ );
+ }
+ process.stdout.write(`exists: ${dir} (transport: ${existing.transport}; left untouched; re-init is a safe no-op)\n`);
return;
}
const team = buildTeam({
@@ -107,13 +119,15 @@ const handlers = {
sessionName,
sessionId,
dir,
+ transport,
worktreeEnabled: flags.worktree === true,
baseBranch: typeof flags["base-branch"] === "string" ? flags["base-branch"] : "dev",
});
await persist(team, dir);
- process.stdout.write(`created: ${dir}\n`);
+ const taskNameFlag = isMultiAgentV2(team) ? ' --task-name "<lowercase_digits_underscores>"' : "";
+ process.stdout.write(`created: ${dir} (transport: ${team.transport})\n`);
process.stdout.write(`team.json + guide.md written; artifacts/ ready. session id: ${sessionId}\n`);
- process.stdout.write(`next: add-member --team ${sessionId} --id A --name "<short role>" --focus "<part/ownership/perspective>" --lens area|ownership|perspective --deliverable "<...>"\n`);
+ process.stdout.write(`next: add-member --team ${sessionId} --id A --name "<short role>"${taskNameFlag} --focus "<part/ownership/perspective>" --lens area|ownership|perspective --deliverable "<...>"\n`);
});
},
@@ -127,13 +141,17 @@ const handlers = {
lens: requireFlag(flags, "lens"),
deliverable: typeof flags.deliverable === "string" ? flags.deliverable : "",
branch: typeof flags.branch === "string" ? flags.branch : null,
+ taskName: typeof flags["task-name"] === "string" ? flags["task-name"] : null,
};
const { team, member } = await mutateTeam(cwd, sessionId, "add-member", async (team, dir) => {
addMember(team, memberInput);
await persist(team, dir);
return { team, member: team.members.find((m) => m.id === memberId) };
});
- process.stdout.write(`added member ${memberId} to team ${sessionId}.\n\nSend this as the new thread's first message (title the thread "${member.threadTitle}"):\n---\n${buildMemberPrompt(team, memberId)}\n---\n`);
+ const delivery = isMultiAgentV2(team)
+ ? `Send this as spawn_agent message (task_name "${member.taskName}", fork_turns "none"), then bind-agent --agent-path "${member.agentPath}"`
+ : `Send this as the new thread's first message (title the thread "${member.threadTitle}")`;
+ process.stdout.write(`added member ${memberId} to team ${sessionId}.\n\n${delivery}:\n---\n${buildMemberPrompt(team, memberId)}\n---\n`);
},
async "bind-thread"(cwd, flags) {
@@ -151,6 +169,21 @@ const handlers = {
process.stdout.write(`bound member ${flags.id} to thread ${flags.thread}.\n`);
},
+ async "bind-agent"(cwd, flags) {
+ const sessionId = requireFlag(flags, "team");
+ const input = {
+ id: requireFlag(flags, "id"),
+ agentPath: requireFlag(flags, "agent-path"),
+ cwd: typeof flags.cwd === "string" ? flags.cwd : null,
+ worktreePath: typeof flags["worktree-path"] === "string" ? flags["worktree-path"] : null,
+ };
+ await mutateTeam(cwd, sessionId, "bind-agent", async (team, dir) => {
+ bindAgent(team, input);
+ await persist(team, dir);
+ });
+ process.stdout.write(`bound member ${flags.id} to agent ${flags["agent-path"]}.\n`);
+ },
+
async "member-prompt"(cwd, flags) {
const sessionId = requireFlag(flags, "team");
const { team } = await loadTeam(cwd, sessionId);
@@ -175,19 +208,24 @@ const handlers = {
const sessionId = requireFlag(flags, "team");
const memberId = requireFlag(flags, "id");
const baseBranch = typeof flags["base-branch"] === "string" ? flags["base-branch"] : null;
- const { member, result } = await mutateTeam(cwd, sessionId, "worktree-add", async (team, dir) => {
+ const { team, member, result } = await mutateTeam(cwd, sessionId, "worktree-add", async (team, dir) => {
const member = memberOrThrow(team, memberId);
const result = addMemberWorktree(cwd, team, member, { baseBranch });
setMemberWorktree(team, { id: member.id, path: result.path, branch: result.branch });
await persist(team, dir);
- return { member, result };
+ return { team, member, result };
});
const note = result.created ? "" : " (already exists)";
- const thread = member.threadId
- ? `\nMember thread: ${codexThreadLink(member.threadId)}\nTell that member to: cd "${result.path}"`
- : "\nMember thread is not bound yet; wait for the real Codex thread id, then bind-thread before sending bootstrap. After binding, send the member this worktree path.";
+ const v2 = isMultiAgentV2(team);
+ const followUp = v2
+ ? member.status === "active"
+ ? `\nMember agent: ${member.agentPath}\nSend it a followup_task to: cd "${result.path}"`
+ : `\nMember agent is not spawned yet; include this worktree path in its spawn_agent message, then bind-agent.`
+ : member.threadId
+ ? `\nMember thread: ${codexThreadLink(member.threadId)}\nTell that member to: cd "${result.path}"`
+ : "\nMember thread is not bound yet; wait for the real Codex thread id, then bind-thread before sending bootstrap. After binding, send the member this worktree path.";
process.stdout.write(
- `worktree for member ${member.id}${note}: ${result.path} on branch ${result.branch} (off ${result.base}).${thread}\n`,
+ `worktree for member ${member.id}${note}: ${result.path} on branch ${result.branch} (off ${result.base}).${followUp}\n`,
);
},
@@ -235,11 +273,19 @@ const handlers = {
id: typeof flags.id === "string" ? flags.id : null,
note: typeof flags.note === "string" ? flags.note : "",
};
- await mutateTeam(cwd, sessionId, "archive", async (team, dir) => {
+ const team = await mutateTeam(cwd, sessionId, "archive", async (team, dir) => {
archive(team, input);
await persist(team, dir);
+ return team;
});
- process.stdout.write(flags.id ? `archived member ${flags.id}\n` : `archived team ${sessionId} and closed all members\n`);
+ const v2 = isMultiAgentV2(team);
+ const teamSummary = v2
+ ? `archived team ${sessionId}; V2 has no runtime archive operation - the durable team state is the archive (interrupt_agent any member still mid-turn)\n`
+ : `archived team ${sessionId} and closed all members\n`;
+ const memberSummary = v2
+ ? `archived member ${flags.id} in team state; V2 has no runtime archive operation (interrupt_agent it if still mid-turn)\n`
+ : `archived member ${flags.id}\n`;
+ process.stdout.write(flags.id ? memberSummary : teamSummary);
},
async delete(cwd, flags) {
@@ -261,10 +307,18 @@ const handlers = {
async status(cwd, flags) {
const sessionId = requireFlag(flags, "team");
const { team } = await loadTeam(cwd, sessionId);
- process.stdout.write(`Team ${team.teamName} [${team.status}] - leader: main session - ${team.members.length} member(s)\n`);
+ process.stdout.write(
+ `Team ${team.teamName} [${team.status}] - transport=${team.transport} - leader: main session - ${team.members.length} member(s)\n`,
+ );
for (const m of team.members) {
- const thread = m.threadId ? ` thread=${m.threadId} link=${codexThreadLink(m.threadId)}` : "";
- process.stdout.write(` ${m.id} (${m.lens}) ${m.focus} -> ${m.deliverable || "(no deliverable)"} [${m.status}]${thread}${m.cwd ? ` cwd=${m.cwd}` : ""}\n`);
+ const endpoint = isMultiAgentV2(team)
+ ? m.agentPath
+ ? ` agent=${m.agentPath}`
+ : ""
+ : m.threadId
+ ? ` thread=${m.threadId} link=${codexThreadLink(m.threadId)}`
+ : "";
+ process.stdout.write(` ${m.id} (${m.lens}) ${m.focus} -> ${m.deliverable || "(no deliverable)"} [${m.status}]${endpoint}${m.cwd ? ` cwd=${m.cwd}` : ""}\n`);
}
if (isUnderstaffed(team)) {
process.stdout.write(
diff --git a/plugins/omo/skills/ulw-loop/references/full-workflow.md b/plugins/omo/skills/ulw-loop/references/full-workflow.md
index a4799afd..aee7dfb1 100644
--- a/plugins/omo/skills/ulw-loop/references/full-workflow.md
+++ b/plugins/omo/skills/ulw-loop/references/full-workflow.md
@@ -161,7 +161,7 @@ Loop per goal. Cap at 5 cycles per goal. Cap identical same-criterion failures a
2. Register atomic todos via `update_plan` — one ultra-granular step per action, `path: <action> for <criterion> - verify by <check>`. Call `update_plan` on every transition (start → `in_progress`, finish → `completed`); exactly one `in_progress`, mark completed immediately, never batch, never let the rendered plan lag behind reality.
3. DELEGATE-IN-PARALLEL: dispatch every independent task in the wave at once via right-sized `multi_agent_v1.spawn_agent` workers (Delegation table). Each worker captures evidence failing-first: when the task touches EXISTING behavior, PIN it FIRST — a characterization test that asserts the current observable behavior and PASSES on the unchanged code, as rigorous as the new-behavior scenario (exact inputs, exact observable, exact assertion). Then RED through the cheapest faithful channel — a unit test where a seam exists, an integration/e2e test where the behavior lives in wiring, or the criterion's scenario captured failing when no test seam exists — failing for the RIGHT reason (no syntax/import error). A test that mirrors its implementation (mock-call assertions, pinned constants, cannot fail under plausible regression) is not evidence; use the scenario as the failing proof instead. Then the SMALLEST GREEN change; before GREEN work that depends on external review, PR, issue, or branch state, refresh current branch/PR/issue state, preserve existing ordering/policy, and separate compatibility detection from policy changes unless the goal explicitly asks to change policy. A GREEN far larger than the criterion implies means the proof was too coarse — instruct a split. Serialize only on a NAMED dependency.
4. INTEGRATE + CRITICAL SELF-QA + GIT CHECKPOINT (EVERY WORKER RETURN): do NOT trust the worker's report. Read the diff yourself, re-run its tests, and run LSP diagnostics on the changed files. Treat "done" as a claim to disprove. If the diff drifts, the test is hollow, or evidence is missing, RESPAWN the worker with the specific failure context. Once the work unit is verified, use `git-master` before staging: inspect recent repository commits and touched-path history to infer commit language, Conventional Commit scope, message shape, and unit size. Stage only that unit's files and commit in the observed style; do not carry verified work forward into a later omnibus commit. If no git-tracked files changed or committing is unsafe, record the no-commit reason as evidence. Forward every finding/learning to subsequent workers.
-5. EXECUTE-AS-SCENARIO: ACTUALLY run the Manual-QA scenario the criterion named (channel table above). Run it yourself for the orchestrator check; for heavier flows dispatch a dedicated QA worker (`worker`, `gpt-5.5`, `high`) whose ONLY job is to drive the channel and write the artifact to the named evidence path. If the scenario FAILS, respawn the implementing worker with the captured failure — do not hand-patch around it.
+5. EXECUTE-AS-SCENARIO: ACTUALLY run the Manual-QA scenario the criterion named (channel table above). Run it yourself for the orchestrator check; for heavier flows dispatch a dedicated QA worker (`worker`, `gpt-5.6-sol`, `xhigh`) whose ONLY job is to drive the channel and write the artifact to the named evidence path. If the scenario FAILS, respawn the implementing worker with the captured failure — do not hand-patch around it.
6. CAPTURE: collect the observable artifact path: transcript, stdout, screenshot, assertion, status+body, diff, or parsed dump. No artifact written at the evidence path — not done; record BLOCKED and respawn QA.
7. CLEAN (PAIRED, NEVER SKIP): tear down every runtime artifact step 5 spawned BEFORE recording — server PIDs (`kill`, verify `kill -0` fails), `tmux` sessions (`tmux kill-session -t ulw-qa-<criterion>`; confirm `tmux ls`), browser / Playwright contexts (`.close()`), containers (`docker rm -f`), bound ports (`lsof -i :<port>` empty), temp sockets / files / dirs (`rm -rf` the `mktemp` paths), QA-only env vars, AND `multi_agent_v1.close_agent` on every finished worker. Register each teardown as its own todo the moment the QA spawns the resource (scripts, tmux assets, browsers / agent-browser sessions, PIDs, ports) so none is forgotten. Embed a one-line cleanup receipt in the evidence string, e.g. `cleanup: killed 12345; tmux kill-session ulw-qa-foo; rm -rf /tmp/ulw.aB12cD; multi_agent_v1.close_agent w-3`. Missing receipt → record BLOCKED, not PASS.
8. RECORD exactly one result:
diff --git a/plugins/omo/skills/ulw-plan/references/full-workflow.md b/plugins/omo/skills/ulw-plan/references/full-workflow.md
index 2463969e..a4dbd4e5 100644
--- a/plugins/omo/skills/ulw-plan/references/full-workflow.md
+++ b/plugins/omo/skills/ulw-plan/references/full-workflow.md
@@ -85,7 +85,7 @@ Runs in parallel; ALL must APPROVE; surface results and wait for the user's expl
- UNCLEAR: run the high-accuracy review AUTOMATICALLY before presenting (unless Classify=Trivial), then present a brief that LEADS with the derived approach and the adopted defaults; still wait for the user's explicit okay.
### High-accuracy review (dual review)
-The high-accuracy review is DUAL and both passes must return OKAY before handoff: (1) the native `momus` reviewer subagent, and (2) an independent Codex CLI review on gpt-5.5 at xhigh reasoning, run in a disposable isolated workspace and `CODEX_HOME` with the harness's normal approval and sandbox policy. Do not add flags that disable approvals or sandboxing. One round = exactly ONE `momus` + ONE independent review, dispatched together against the COMPLETE plan file (todos + TL;DR filled) - never a second `momus` while a round is in flight. After both verdicts return, fix every cited issue and resubmit both fresh until each approves. CLEAR: runs when the user opts in or `review_required: true`. UNCLEAR: runs automatically unless Classify=Trivial.
+The high-accuracy review is DUAL and both passes must return OKAY before handoff: (1) the native `momus` reviewer subagent, and (2) an independent Codex CLI review on gpt-5.6-sol at xhigh reasoning, run in a disposable isolated workspace and `CODEX_HOME` with the harness's normal approval and sandbox policy. Do not add flags that disable approvals or sandboxing. Momus runs at Ultra and may take substantially longer than other agents. One round = exactly ONE `momus` + ONE independent review, dispatched together against the COMPLETE plan file (todos + TL;DR filled). Keep Momus in flight and wait for its terminal result: elapsed time alone never justifies cancelling, duplicating, replacing, or treating it as failed. After both verdicts return, fix every cited issue and resubmit both fresh until each approves. CLEAR: runs when the user opts in or `review_required: true`. UNCLEAR: runs automatically unless Classify=Trivial.
The draft must record the native Momus session/result, the independent Codex CLI review command/result, and the fix/retry summary. Do not say "high-accuracy review completed" unless both receipts exist and both final verdicts are unconditional approval.
diff --git a/plugins/omo/skills/ulw-research/SKILL.md b/plugins/omo/skills/ulw-research/SKILL.md
index f0ec47ef..3541a192 100644
--- a/plugins/omo/skills/ulw-research/SKILL.md
+++ b/plugins/omo/skills/ulw-research/SKILL.md
@@ -15,7 +15,7 @@ This skill may include examples copied from the OpenCode harness. In Codex, do n
| `task(subagent_type="oracle", ...)` for final verification | `multi_agent_v1.spawn_agent({"message":"TASK: act as a rigorous reviewer. ...","agent_type":"lazycodex-gate-reviewer","fork_context":false})` |
| `task(category="...", ...)` for implementation or QA | `multi_agent_v1.spawn_agent({"message":"TASK: act as an implementation or QA worker. ...","fork_context":false})` |
| `background_output(task_id="...")` | `multi_agent_v1.wait_agent(...)` for mailbox signals |
-| `team_*(...)` | Use Codex native subagents via `multi_agent_v1.spawn_agent`, `multi_agent_v1.send_input`, `multi_agent_v1.wait_agent`, and `multi_agent_v1.close_agent` |
+| `team_*(...)` | Use Codex native subagents via `multi_agent_v1.spawn_agent` and `multi_agent_v1.wait_agent`; use `multi_agent_v1.send_input` and `multi_agent_v1.close_agent` only when exposed in the active tools list |
Role-specific behavior must be described in a self-contained `message`. Use `fork_context: false` to start the child with only the initial prompt (no parent history); use `fork_context: true` only when full parent history is truly required. Include any required conversation context, files, diffs, constraints, and requested skill names directly in the spawned agent's `message`. OMO installs these selectable agent roles into `~/.codex/agents/`: `explorer`, `librarian`, `plan`, `momus`, `metis`, `lazycodex-code-reviewer`, `lazycodex-qa-executor`, and `lazycodex-gate-reviewer` - pass the matching name as `agent_type` so the child gets that role's model and instructions. If the spawn tool exposes no `agent_type` parameter, omit it and describe the role inside `message`. If a code block below conflicts with this section, this section wins.
@@ -69,7 +69,7 @@ Observation candidates and claim candidates travel back from workers as message
## Run the swarm as a cooperating team
-Saturation research defaults to teammode, not isolated fire-and-forget workers: a lead one worker surfaces almost always reshapes what another should search next. When your harness gives you real cooperating members — Codex: the `teammode` skill (`codex_app` threads); OpenCode: `team_mode` — run this swarm as a team. Fall back to the background-worker swarm below only when team mode is unavailable, or the axes are genuinely independent with no cross-pollination expected.
+Saturation research defaults to teammode, not isolated fire-and-forget workers: a lead one worker surfaces almost always reshapes what another should search next. When your harness gives you real cooperating members — Codex: the `teammode` skill (MultiAgentV2 agents, or `codex_app` threads as its fallback); OpenCode: `team_mode` — run this swarm as a team. Fall back to the background-worker swarm below only when team mode is unavailable, or the axes are genuinely independent with no cross-pollination expected.
- **One member per axis — by part, ownership, or perspective, never a job title.** Each Phase 0 axis is one member owning one concrete slice: a codebase part, a source territory, or a question lens. No two members share an angle. "Backend researcher" or "the web person" gives no real boundary and invites overlap — name what the member owns.
- **Many teammates by default.** Prefer a larger roster, usually 5-8 teammates, whenever the axes can be made distinct. Add at least one skeptic or red-team perspective for hyperdebate/ultradebate: cross-critique claims, evidence quality, synthesis structure, and visual-report choices before they reach the final deliverable.
diff --git a/plugins/omo/skills/visual-qa/SKILL.md b/plugins/omo/skills/visual-qa/SKILL.md
index 62d6fabd..323e7227 100644
--- a/plugins/omo/skills/visual-qa/SKILL.md
+++ b/plugins/omo/skills/visual-qa/SKILL.md
@@ -15,7 +15,7 @@ This skill may include examples copied from the OpenCode harness. In Codex, do n
| `task(subagent_type="oracle", ...)` for final verification | `multi_agent_v1.spawn_agent({"message":"TASK: act as a rigorous reviewer. ...","agent_type":"lazycodex-gate-reviewer","fork_context":false})` |
| `task(category="...", ...)` for implementation or QA | `multi_agent_v1.spawn_agent({"message":"TASK: act as an implementation or QA worker. ...","fork_context":false})` |
| `background_output(task_id="...")` | `multi_agent_v1.wait_agent(...)` for mailbox signals |
-| `team_*(...)` | Use Codex native subagents via `multi_agent_v1.spawn_agent`, `multi_agent_v1.send_input`, `multi_agent_v1.wait_agent`, and `multi_agent_v1.close_agent` |
+| `team_*(...)` | Use Codex native subagents via `multi_agent_v1.spawn_agent` and `multi_agent_v1.wait_agent`; use `multi_agent_v1.send_input` and `multi_agent_v1.close_agent` only when exposed in the active tools list |
Role-specific behavior must be described in a self-contained `message`. Use `fork_context: false` to start the child with only the initial prompt (no parent history); use `fork_context: true` only when full parent history is truly required. Include any required conversation context, files, diffs, constraints, and requested skill names directly in the spawned agent's `message`. OMO installs these selectable agent roles into `~/.codex/agents/`: `explorer`, `librarian`, `plan`, `momus`, `metis`, `lazycodex-code-reviewer`, `lazycodex-qa-executor`, and `lazycodex-gate-reviewer` - pass the matching name as `agent_type` so the child gets that role's model and instructions. If the spawn tool exposes no `agent_type` parameter, omit it and describe the role inside `message`. If a code block below conflicts with this section, this section wins.
@@ -271,7 +271,7 @@ If any page fails, you are not done: fix it, re-capture the full set, re-dispatc
Run this step IN ADDITION to Steps 1-4 when the original user task has a concrete visual target: "clone this site", "move this Figma design to code", "rebuild this screen", "make it look exactly like X", or "build this Imagen/Stitch/generated mockup and overview". For these tasks the normal dual-oracle is necessary but NOT sufficient. After it returns, run the following TWO additional MANDATORY verifications and LOOP until BOTH pass.
-1. Pixel-perfect design-compare subagent (visual oracle). Dispatch a focused, read-only design-compare reviewer (recommend `gpt-5.5` with medium reasoning). It must crop/zoom BOTH the reference (target / Figma export / source-site screenshot / generated page snapshot) and the ACTUAL screenshot into matching regions and read them **pixel-by-pixel** - header, nav, each card, spacing, type ramp, color tokens - not at a glance. It must also compare the overview text or annotations against the rendered content and DOM text. Anchor every claim with the bundled tool:
+1. Pixel-perfect design-compare subagent (visual oracle). Dispatch a focused, read-only design-compare reviewer (recommend `gpt-5.6-sol` with xhigh reasoning). It must crop/zoom BOTH the reference (target / Figma export / source-site screenshot / generated page snapshot) and the ACTUAL screenshot into matching regions and read them **pixel-by-pixel** - header, nav, each card, spacing, type ramp, color tokens - not at a glance. It must also compare the overview text or annotations against the rendered content and DOM text. Anchor every claim with the bundled tool:
```
node "$SKILL_DIR/scripts/visual-qa.mjs" image-diff <reference.png> <actual.png>
diff --git a/plugins/omo/test/aggregate-agents.test.mjs b/plugins/omo/test/aggregate-agents.test.mjs
index bd86e770..84a911e8 100644
--- a/plugins/omo/test/aggregate-agents.test.mjs
+++ b/plugins/omo/test/aggregate-agents.test.mjs
@@ -16,9 +16,50 @@ const agentSchemaKeys = new Set([
]);
const lazycodexAgentInvariants = new Map([
+ [
+ "explorer.toml",
+ {
+ model: "gpt-5.6-terra",
+ effort: "medium",
+ includes: [/Read-only/, /working tree/, /rg/],
+ },
+ ],
+ [
+ "librarian.toml",
+ {
+ model: "gpt-5.6-terra",
+ effort: "medium",
+ includes: [/Read-only/, /SHA-pinned GitHub permalink/, /external/],
+ },
+ ],
+ [
+ "metis.toml",
+ {
+ model: "gpt-5.6-sol",
+ effort: "high",
+ includes: [/pre-planning analyst/i, /contradictions/, /Read-only/],
+ },
+ ],
+ [
+ "momus.toml",
+ {
+ model: "gpt-5.6-sol",
+ effort: "ultra",
+ includes: [/plan reviewer/i, /OKAY, ITERATE, or REJECT/, /Read-only/],
+ },
+ ],
+ [
+ "plan.toml",
+ {
+ model: "gpt-5.6-sol",
+ effort: "xhigh",
+ includes: [/strategic planning consultant/i, /\.omo\/plans\/<slug>\.md/, /never implements/i],
+ },
+ ],
[
"lazycodex-executor.toml",
{
+ model: "gpt-5.6-sol",
effort: "high",
includes: [/EVIDENCE_RECORDED: <path>/, /scenario/i, /artifact/i],
},
@@ -26,6 +67,7 @@ const lazycodexAgentInvariants = new Map([
[
"lazycodex-clone-fidelity-reviewer.toml",
{
+ model: "gpt-5.6-sol",
effort: "xhigh",
includes: [/recommendation/, /blockers/, /\.omo\/evidence\/<goal>-clone-fidelity\.md/],
},
@@ -33,6 +75,7 @@ const lazycodexAgentInvariants = new Map([
[
"lazycodex-code-reviewer.toml",
{
+ model: "gpt-5.6-sol",
effort: "xhigh",
includes: [/codeQualityStatus/, /recommendation/, /\.omo\/evidence\/<goal>-code-review\.md/],
},
@@ -40,6 +83,7 @@ const lazycodexAgentInvariants = new Map([
[
"lazycodex-qa-executor.toml",
{
+ model: "gpt-5.6-terra",
effort: "medium",
includes: [/not_applicable/, /surfaceEvidence/, /adversarialCases/],
},
@@ -47,6 +91,7 @@ const lazycodexAgentInvariants = new Map([
[
"lazycodex-gate-reviewer.toml",
{
+ model: "gpt-5.6-sol",
effort: "xhigh",
includes: [/APPROVE\/REJECT/, /blockers/, /\.omo\/evidence\/<goal>-gate-review\.md/],
},
@@ -109,7 +154,8 @@ test("#given lazycodex agent prompts #when inspected #then each role pins model
for (const [fileName, invariant] of lazycodexAgentInvariants) {
const prompt = await readFile(join(agentsDir, fileName), "utf8");
- assert.match(prompt, /^model\s*=\s*"gpt-5\.5"$/m);
+ const escapedModel = invariant.model.replace(/\./g, "\\.");
+ assert.match(prompt, new RegExp(`^model\\s*=\\s*"${escapedModel}"$`, "m"));
assert.match(prompt, new RegExp(`^model_reasoning_effort\\s*=\\s*"${invariant.effort}"$`, "m"));
assert.doesNotMatch(prompt, /^tools\s*=/m);
assert.doesNotMatch(prompt, /^blocking\s*=/m);
diff --git a/plugins/omo/test/aggregate-skills.test.mjs b/plugins/omo/test/aggregate-skills.test.mjs
index 5744ccc9..1d877cf8 100644
--- a/plugins/omo/test/aggregate-skills.test.mjs
+++ b/plugins/omo/test/aggregate-skills.test.mjs
@@ -34,7 +34,8 @@ test('#given synced skills and bundled rules #when role-specific agents are spaw
const promptFiles = skillEntries
.filter((entry) => entry.isDirectory())
.map((entry) => join(skillsDir, entry.name, "SKILL.md"));
- promptFiles.push(join(root, "components", "rules", "bundled-rules", "hephaestus.md"));
+ promptFiles.push(join(root, "components", "rules", "bundled-rules", "hephaestus", "gpt-5.5.md"));
+ promptFiles.push(join(root, "components", "rules", "bundled-rules", "hephaestus", "gpt-5.6.md"));
const missingForkContext = [];
for (const promptPath of promptFiles) {
@@ -53,7 +54,8 @@ test("#given long-running orchestration prompts #when waiting on child agents #t
join(root, "skills", "ulw-loop", "references", "full-workflow.md"),
join(root, "skills", "review-work", "SKILL.md"),
join(root, "skills", "start-work", "SKILL.md"),
- join(root, "components", "rules", "bundled-rules", "hephaestus.md"),
+ join(root, "components", "rules", "bundled-rules", "hephaestus", "gpt-5.5.md"),
+ join(root, "components", "rules", "bundled-rules", "hephaestus", "gpt-5.6.md"),
];
const missingLivenessGuidance = [];
diff --git a/plugins/omo/test/auto-update-restart-notice.test.mjs b/plugins/omo/test/auto-update-restart-notice.test.mjs
index 50e223f9..471692aa 100644
--- a/plugins/omo/test/auto-update-restart-notice.test.mjs
+++ b/plugins/omo/test/auto-update-restart-notice.test.mjs
@@ -224,3 +224,36 @@ test("#given completed pending update #when hook session-start runs as CLI #then
assert.equal(repeat.status, 0);
assert.equal(repeat.stdout, "");
});
+
+test("#given the script reached through a symlinked directory #when hook session-start runs as CLI #then the entry guard still fires", async () => {
+ const root = await mkdtemp(join(tmpdir(), "lazycodex-restart-notice-symlink-"));
+ const env = autoUpdateEnv(root, {
+ LAZYCODEX_CURRENT_VERSION: "1.0.1",
+ LAZYCODEX_LATEST_VERSION: "1.0.1",
+ LAZYCODEX_CONFIG_MIGRATION_DISABLED: "1",
+ });
+ await writeFile(env.LAZYCODEX_AUTO_UPDATE_STATE_PATH, JSON.stringify({
+ lastCheckedAt: Date.now() - 1_000,
+ lastStatus: "success",
+ pendingNotice: { fromVersion: "1.0.0", toVersion: "1.0.1", startedAt: 1 },
+ }));
+ // Simulate a symlinked plugin cache dir: argv[1] spells the symlink, while
+ // import.meta.url resolves to the real path. Seen in the wild; the old
+ // `pathToFileURL(process.argv[1])` guard never matched and the hook was a
+ // silent no-op.
+ const { symlink } = await import("node:fs/promises");
+ const { dirname } = await import("node:path");
+ const linkDir = join(root, "linked-scripts");
+ await symlink(dirname(SCRIPT_PATH), linkDir, "dir");
+ const linkedScript = join(linkDir, "auto-update.mjs");
+
+ const result = spawnSync(process.execPath, [linkedScript, "hook", "session-start"], {
+ encoding: "utf8",
+ env: { ...process.env, ...env },
+ });
+
+ assert.equal(result.status, 0);
+ const lines = result.stdout.split("\n").filter((line) => line.length > 0);
+ assert.equal(lines.length, 1, `expected one SessionStart JSON line, got stdout=${JSON.stringify(result.stdout)} stderr=${JSON.stringify(result.stderr)}`);
+ assert.equal(JSON.parse(lines[0]).hookSpecificOutput.hookEventName, "SessionStart");
+});
diff --git a/plugins/omo/test/migrate-codex-config.test.mjs b/plugins/omo/test/migrate-codex-config.test.mjs
index 5a076012..6c0dab13 100644
--- a/plugins/omo/test/migrate-codex-config.test.mjs
+++ b/plugins/omo/test/migrate-codex-config.test.mjs
@@ -756,7 +756,7 @@ test("#given global config with forced multi_agent_v2 #when full migration runs
test("#given enabled = true with an inline comment #when forcing disable #then flips to false and preserves the comment", () => {
const config = ["[features.multi_agent_v2]", "enabled = true # tuned by me", ""].join("\n");
- const result = forceDisableMultiAgentV2(config, { multiAgentVersion: null });
+ const result = forceDisableMultiAgentV2(config, { multiAgentVersion: "v1" });
assert.match(result, /^enabled = false # tuned by me$/m);
assert.doesNotMatch(result, /enabled = true/);
@@ -767,7 +767,7 @@ test("#given enabled = true with an inline comment #when forcing disable #then f
test("#given a section header with an inline comment #when forcing disable #then patches in place without duplicating the table", () => {
const config = ["[features.multi_agent_v2] # pinned by me", "enabled = true", ""].join("\n");
- const result = forceDisableMultiAgentV2(config, { multiAgentVersion: null });
+ const result = forceDisableMultiAgentV2(config, { multiAgentVersion: "v1" });
assert.equal((result.match(/\[features\.multi_agent_v2\]/g) ?? []).length, 1);
assert.match(result, /enabled = false/);
@@ -779,19 +779,19 @@ test("#given an already-guarded commented config #when re-running #then output i
const configA = ["[features.multi_agent_v2]", "enabled = true # tuned by me", ""].join("\n");
const configB = ["[features.multi_agent_v2] # pinned by me", "enabled = true", ""].join("\n");
- const firstA = forceDisableMultiAgentV2(configA, { multiAgentVersion: null });
- const rerunA = forceDisableMultiAgentV2(firstA, { multiAgentVersion: null });
+ const firstA = forceDisableMultiAgentV2(configA, { multiAgentVersion: "v1" });
+ const rerunA = forceDisableMultiAgentV2(firstA, { multiAgentVersion: "v1" });
assert.equal(rerunA, firstA);
- const firstB = forceDisableMultiAgentV2(configB, { multiAgentVersion: null });
- const rerunB = forceDisableMultiAgentV2(firstB, { multiAgentVersion: null });
+ const firstB = forceDisableMultiAgentV2(configB, { multiAgentVersion: "v1" });
+ const rerunB = forceDisableMultiAgentV2(firstB, { multiAgentVersion: "v1" });
assert.equal(rerunB, firstB);
});
test("#given user-disabled with an inline comment #when forcing disable #then returns config unchanged", () => {
const config = ["[features.multi_agent_v2]", "enabled = false # I turned this off myself", ""].join("\n");
- const result = forceDisableMultiAgentV2(config, { multiAgentVersion: null });
+ const result = forceDisableMultiAgentV2(config, { multiAgentVersion: "v1" });
assert.equal(result, config);
});
@@ -799,7 +799,7 @@ test("#given user-disabled with an inline comment #when forcing disable #then re
test("#given [features] shorthand true with an inline comment #when forcing disable #then removes the shorthand and appends one disabled table", () => {
const config = ["[features]", "plugins = true", "multi_agent_v2 = true # legacy", ""].join("\n");
- const result = forceDisableMultiAgentV2(config, { multiAgentVersion: null });
+ const result = forceDisableMultiAgentV2(config, { multiAgentVersion: "v1" });
assert.doesNotMatch(result, /^\s*multi_agent_v2\s*=/m);
assert.equal((result.match(/\[features\.multi_agent_v2\]/g) ?? []).length, 1);
@@ -816,7 +816,7 @@ test("#given a following section header with an inline comment #when inserting e
"",
].join("\n");
- const result = forceDisableMultiAgentV2(config, { multiAgentVersion: null });
+ const result = forceDisableMultiAgentV2(config, { multiAgentVersion: "v1" });
assert.match(result, /\[features\.multi_agent_v2\]\nenabled = false\n/);
assert.match(result, /\[mcp_servers\.x\][^\n]*\nenabled = true/);
@@ -1034,6 +1034,41 @@ test("#given legacy shorthand and no session model on hook path #when full migra
assert.equal("enabled" in parsed.features.multi_agent_v2, false);
});
+test("#given SoT migration failure #when hook migration runs #then config.toml repair still happens", async () => {
+ const { runAutoUpdateCheck } = await import("../scripts/auto-update.mjs");
+ const root = await mkdtemp(join(tmpdir(), "lazycodex-sot-isolation-"));
+ const codexHome = join(root, "codex-home");
+ await mkdir(codexHome, { recursive: true });
+ const configPath = join(codexHome, "config.toml");
+ await writeFile(
+ configPath,
+ ['model = "gpt-5.6-sol"', "", "[features.multi_agent_v2]", "enabled = false", ""].join("\n"),
+ );
+ await writeFile(
+ join(codexHome, "models_cache.json"),
+ JSON.stringify({ models: [{ slug: "gpt-5.6-sol", multi_agent_version: "v2" }] }),
+ );
+ // HOME pointing at a FILE makes migrateOmoSotConfig's mkdir(~/.omo) throw.
+ const brokenHome = join(root, "not-a-dir");
+ await writeFile(brokenHome, "");
+
+ await runAutoUpdateCheck({
+ env: {
+ CODEX_HOME: codexHome,
+ HOME: brokenHome,
+ USERPROFILE: brokenHome,
+ LAZYCODEX_AUTO_UPDATE_DISABLED: "1",
+ LAZYCODEX_MODEL_CATALOG_STATE_PATH: join(root, "model-state.json"),
+ LAZYCODEX_AUTO_UPDATE_STATE_PATH: join(root, "state.json"),
+ },
+ sessionModel: "gpt-5.6-sol",
+ requireSessionModel: true,
+ });
+
+ const content = await readFile(configPath, "utf8");
+ assert.doesNotMatch(content, /^\s*enabled\s*=\s*false/m);
+});
+
test("#given config default gpt-5.5 #when full migration gets SessionStart gpt-5.6-terra #then clears disable using session model", async () => {
const root = await mkdtemp(join(tmpdir(), "lazycodex-multi-agent-v2-session-model-"));
const codexHome = join(root, "codex-home");
@@ -1078,6 +1113,47 @@ test("#given config default gpt-5.5 #when full migration gets SessionStart gpt-5
assert.match(content, /max_concurrent_threads_per_session = 1000/);
});
+test("#given no session model and no root model #when forcing disable #then leaves the enable state untouched", () => {
+ const config = ["[features]", "plugins = true", "", "[features.multi_agent_v2]", "enabled = true", ""].join("\n");
+
+ const result = forceDisableMultiAgentV2(config, { multiAgentVersion: null, sessionModel: null });
+
+ assert.match(result, /enabled = true/);
+ assert.doesNotMatch(result, /enabled = false/);
+ assert.doesNotMatch(result, /openai\/codex#26753/);
+});
+
+test("#given no session model and no root model #when config has no multi_agent_v2 section #then does not append a disable", () => {
+ const config = ["[features]", "plugins = true", ""].join("\n");
+
+ const result = forceDisableMultiAgentV2(config, { multiAgentVersion: null, sessionModel: null });
+
+ assert.equal(result, config);
+ assert.doesNotMatch(result, /\[features\.multi_agent_v2\]/);
+});
+
+test("#given user-modified config without root model #when full non-hook migration runs #then writes no disable and no new agents.max_threads", async () => {
+ const root = await mkdtemp(join(tmpdir(), "lazycodex-multi-agent-v2-desktop-no-model-"));
+ const codexHome = join(root, "codex-home");
+ await mkdir(codexHome, { recursive: true });
+ const configPath = join(codexHome, "config.toml");
+ // Codex Desktop sessions select the model in the UI; config.toml has no root
+ // `model`, so migration cannot prove the session is not a GPT-5.6
+ // reserved-schema model (#6002).
+ await writeFile(configPath, ['model_reasoning_effort = "high"', "", "[features]", "plugins = true", ""].join("\n"));
+
+ await migrateCodexConfig({
+ env: { CODEX_HOME: codexHome, LAZYCODEX_MODEL_CATALOG_STATE_PATH: join(root, "model-state.json") },
+ cwd: root,
+ });
+
+ const content = await readFile(configPath, "utf8");
+ assert.doesNotMatch(content, /^\s*enabled\s*=\s*false/m);
+ assert.doesNotMatch(content, /openai\/codex#26753/);
+ assert.doesNotMatch(content, /^\s*max_threads\s*=/m);
+ assert.match(content, /max_concurrent_threads_per_session = 1000/);
+});
+
async function canCreateSymlink(type) {
const root = await mkdtemp(join(tmpdir(), "lazycodex-symlink-capability-"));
const target = join(root, "target");
@@ -1103,3 +1179,64 @@ async function canCreateSymlink(type) {
return false;
}
}
+
+test("#given model_catalog_json declares a v2 model as v1 #when full migration runs #then keeps the managed disable and max_threads", async () => {
+ const root = await mkdtemp(join(tmpdir(), "lazycodex-multi-agent-v2-catalog-override-"));
+ const codexHome = join(root, "codex-home");
+ await mkdir(codexHome, { recursive: true });
+ const configPath = join(codexHome, "config.toml");
+ const catalogPath = join(root, "custom-catalog.json");
+ // Codex Desktop user forces gpt-5.6-sol to v1 via an explicit replacement catalog.
+ await writeFile(configPath, [
+ 'model = "gpt-5.6-sol"',
+ `model_catalog_json = "${catalogPath}"`,
+ "",
+ "[agents]",
+ "max_threads = 1000",
+ "max_depth = 2",
+ "",
+ "[features.multi_agent_v2]",
+ "enabled = false",
+ "max_concurrent_threads_per_session = 1000",
+ "",
+ ].join("\n"));
+ // models_cache.json STILL says v2 (stale), but the explicit catalog wins and says v1.
+ await writeFile(join(codexHome, "models_cache.json"), JSON.stringify({ models: [{ slug: "gpt-5.6-sol", multi_agent_version: "v2" }] }));
+ await writeFile(catalogPath, JSON.stringify({ models: [{ slug: "gpt-5.6-sol", multi_agent_version: "v1" }] }));
+
+ await migrateCodexConfig({
+ env: { CODEX_HOME: codexHome, LAZYCODEX_MODEL_CATALOG_STATE_PATH: join(root, "model-state.json") },
+ cwd: root,
+ });
+
+ const content = await readFile(configPath, "utf8");
+ assert.match(content, /enabled = false/, "explicit v1 catalog must keep the managed disable");
+ assert.match(content, /max_threads = 1000/, "explicit v1 catalog must keep agents.max_threads");
+ assert.match(content, /max_concurrent_threads_per_session = 1000/);
+ assert.match(content, /max_depth = 2/);
+});
+
+test("#given model_catalog_json declares a model as v2 #when full migration runs #then clears the managed disable", async () => {
+ const root = await mkdtemp(join(tmpdir(), "lazycodex-multi-agent-v2-catalog-v2-"));
+ const codexHome = join(root, "codex-home");
+ await mkdir(codexHome, { recursive: true });
+ const configPath = join(codexHome, "config.toml");
+ const catalogPath = join(root, "custom-catalog.json");
+ await writeFile(configPath, [
+ 'model = "custom-model"',
+ `model_catalog_json = "${catalogPath}"`,
+ "",
+ "[features.multi_agent_v2]",
+ "enabled = false",
+ "",
+ ].join("\n"));
+ await writeFile(catalogPath, JSON.stringify({ models: [{ slug: "custom-model", multi_agent_version: "v2" }] }));
+
+ await migrateCodexConfig({
+ env: { CODEX_HOME: codexHome, LAZYCODEX_MODEL_CATALOG_STATE_PATH: join(root, "model-state.json") },
+ cwd: root,
+ });
+
+ const content = await readFile(configPath, "utf8");
+ assert.doesNotMatch(content, /^\s*enabled\s*=\s*false/m, "explicit v2 catalog must clear the disable");
+});
diff --git a/plugins/omo/test/multi-agent-v2-regression.test.mjs b/plugins/omo/test/multi-agent-v2-regression.test.mjs
new file mode 100644
index 00000000..0a43cb07
--- /dev/null
+++ b/plugins/omo/test/multi-agent-v2-regression.test.mjs
@@ -0,0 +1,71 @@
+import assert from "node:assert/strict";
+import { mkdir, mkdtemp, readFile, writeFile } from "node:fs/promises";
+import { tmpdir } from "node:os";
+import { join } from "node:path";
+import test from "node:test";
+
+import { migrateCodexConfig } from "../scripts/migrate-codex-config.mjs";
+
+test("#given relative model_catalog_json declares gpt-5.6 model as v1 #when migrating #then resolves catalog from config directory", async () => {
+ const root = await mkdtemp(join(tmpdir(), "lazycodex-v2-relative-catalog-"));
+ const codexHome = join(root, "codex-home");
+ await mkdir(codexHome, { recursive: true });
+ const configPath = join(codexHome, "config.toml");
+ await writeFile(
+ configPath,
+ [
+ 'model = "gpt-5.6-sol"',
+ 'model_catalog_json = "custom-catalog.json"',
+ "",
+ "[agents]",
+ "max_threads = 1000",
+ "",
+ "[features.multi_agent_v2]",
+ "enabled = false",
+ "max_concurrent_threads_per_session = 1000",
+ "",
+ ].join("\n"),
+ );
+ await writeFile(join(codexHome, "models_cache.json"), JSON.stringify({ models: [{ slug: "gpt-5.6-sol", multi_agent_version: "v2" }] }));
+ await writeFile(join(codexHome, "custom-catalog.json"), JSON.stringify({ models: [{ slug: "gpt-5.6-sol", multi_agent_version: "v1" }] }));
+
+ await migrateCodexConfig({
+ env: { CODEX_HOME: codexHome, LAZYCODEX_MODEL_CATALOG_STATE_PATH: join(root, "model-state.json") },
+ cwd: root,
+ });
+
+ const content = await readFile(configPath, "utf8");
+ assert.match(content, /enabled = false/);
+ assert.match(content, /max_threads = 1000/);
+});
+
+test("#given no SessionStart model and root gpt-5.6 model without catalog #when migrating #then clears stale V2 disable", async () => {
+ const root = await mkdtemp(join(tmpdir(), "lazycodex-v2-root-gpt56-nocache-"));
+ const codexHome = join(root, "codex-home");
+ await mkdir(codexHome, { recursive: true });
+ const configPath = join(codexHome, "config.toml");
+ await writeFile(
+ configPath,
+ [
+ 'model = "gpt-5.6-terra"',
+ "",
+ "[agents]",
+ "max_threads = 1000",
+ "",
+ "[features.multi_agent_v2]",
+ "enabled = false",
+ "max_concurrent_threads_per_session = 1000",
+ "",
+ ].join("\n"),
+ );
+
+ await migrateCodexConfig({
+ env: { CODEX_HOME: codexHome, LAZYCODEX_MODEL_CATALOG_STATE_PATH: join(root, "model-state.json") },
+ cwd: root,
+ });
+
+ const content = await readFile(configPath, "utf8");
+ assert.doesNotMatch(content, /^\s*enabled\s*=\s*false/m);
+ assert.doesNotMatch(content, /^\s*max_threads\s*=/m);
+ assert.match(content, /max_concurrent_threads_per_session = 1000/);
+});
diff --git a/plugins/omo/test/subagent-limit-migration.test.mjs b/plugins/omo/test/subagent-limit-migration.test.mjs
index 22395551..64894a83 100644
--- a/plugins/omo/test/subagent-limit-migration.test.mjs
+++ b/plugins/omo/test/subagent-limit-migration.test.mjs
@@ -75,3 +75,35 @@ test("#given gpt-5.6 session model with no models_cache #when migrating #then do
assert.match(content, /max_depth = 4/);
assert.match(content, /max_concurrent_threads_per_session = 1000/);
});
+
+test("#given config without any model #when migrating #then does not introduce agents.max_threads", async () => {
+ const root = await mkdtemp(join(tmpdir(), "lazycodex-subagent-limit-no-model-"));
+ const configPath = join(root, "config.toml");
+ await writeFile(
+ configPath,
+ ['model_reasoning_effort = "high"', "", "[agents]", "max_depth = 4", ""].join("\n"),
+ );
+
+ await migrateConfigFile(configPath, { env: { CODEX_HOME: root } });
+
+ const content = await readFile(configPath, "utf8");
+ assert.doesNotMatch(content, /^\s*max_threads\s*=/m);
+ assert.match(content, /max_depth = 4/);
+ assert.match(content, /max_concurrent_threads_per_session = 1000/);
+});
+
+test("#given config without any model but an existing low cap #when migrating #then still raises the existing cap", async () => {
+ const root = await mkdtemp(join(tmpdir(), "lazycodex-subagent-limit-no-model-raise-"));
+ const configPath = join(root, "config.toml");
+ await writeFile(
+ configPath,
+ ['model_reasoning_effort = "high"', "", "[agents]", "max_threads = 6", "max_depth = 4", ""].join("\n"),
+ );
+
+ await migrateConfigFile(configPath, { env: { CODEX_HOME: root } });
+
+ const content = await readFile(configPath, "utf8");
+ assert.match(content, /max_threads = 1000/);
+ assert.doesNotMatch(content, /max_threads = 6/);
+ assert.match(content, /max_depth = 4/);
+});
diff --git a/plugins/omo/test/sync-skills-orchestration.test.mjs b/plugins/omo/test/sync-skills-orchestration.test.mjs
index 88e54ca8..50307648 100644
--- a/plugins/omo/test/sync-skills-orchestration.test.mjs
+++ b/plugins/omo/test/sync-skills-orchestration.test.mjs
@@ -3,7 +3,7 @@ import { readdir, readFile } from "node:fs/promises";
import { dirname, join } from "node:path";
import test from "node:test";
import { fileURLToPath } from "node:url";
-import { insertCodexCompatibilityGuidance } from "../scripts/sync-skills.mjs";
+import { codexHarnessToolCompatibility, insertCodexCompatibilityGuidance } from "../scripts/sync-skills.mjs";
const root = dirname(dirname(fileURLToPath(import.meta.url)));
@@ -207,7 +207,8 @@ test("#given synced aggregate Codex skills #when they describe background orches
["working progress message", /WORKING:/],
["blocked progress message", /BLOCKED:/],
["mailbox timeout framing", /timeout only means no new mailbox update arrived/],
- ["multi_agent_v1.wait_agent ref", /multi_agent_v1\.wait_agent/],
+ // Skills route by session tool surface: the namespaced V1 tool or the flat V2 tool both count.
+ ["wait-agent tool ref", /multi_agent_v1\.wait_agent|`wait_agent`/],
["explicit fallback conditions", /Fallback only when|Mark a file for retry only when/],
];
const bannedPatterns = [
@@ -265,3 +266,9 @@ test("#given PR and review skills #when synced for Codex #then worktree lifecycl
assert.match(reviewWork, /dedicated review worktree attached to that branch/);
assert.match(reviewWork, /Never\s+checkout, test, or edit the review branch in the main worktree/);
});
+
+test("#given generated Codex compatibility guidance #when multi-agent lifecycle tools are mentioned #then optional tools are guarded by the active tools list", () => {
+ assert.match(codexHarnessToolCompatibility, /when exposed in the active tools list/, "send_input/close_agent must be marked optional (lazycodex#116)");
+ assert.match(codexHarnessToolCompatibility, /multi_agent_v1\.spawn_agent/);
+ assert.match(codexHarnessToolCompatibility, /multi_agent_v1\.wait_agent/);
+});
diff --git a/plugins/omo/test/teammode-transport.test.mjs b/plugins/omo/test/teammode-transport.test.mjs
new file mode 100644
index 00000000..0703efd8
--- /dev/null
+++ b/plugins/omo/test/teammode-transport.test.mjs
@@ -0,0 +1,345 @@
+import assert from "node:assert/strict";
+import { existsSync, readFileSync, writeFileSync } from "node:fs";
+import { join } from "node:path";
+import test from "node:test";
+
+import { root } from "./aggregate-plugin-fixture.mjs";
+import {
+ cleanupTeamRoot,
+ createTeamRoot,
+ readTeamJson,
+ runTeam,
+ runTeamRaw,
+ teamDir,
+ teamJsonPath,
+} from "./teammode-safety-fixture.mjs";
+
+function addV2Members(tempRoot, sessionId) {
+ runTeam(
+ tempRoot,
+ "add-member",
+ "--team",
+ sessionId,
+ "--id",
+ "A",
+ "--name",
+ "runtime-core",
+ "--task-name",
+ "runtime_core",
+ "--focus",
+ "runtime state and binding",
+ "--lens",
+ "ownership",
+ "--deliverable",
+ "runtime contract",
+ );
+ runTeam(
+ tempRoot,
+ "add-member",
+ "--team",
+ sessionId,
+ "--id",
+ "B",
+ "--name",
+ "mailbox-delivery",
+ "--task-name",
+ "mailbox_delivery",
+ "--focus",
+ "cross-agent message delivery",
+ "--lens",
+ "area",
+ "--deliverable",
+ "delivery evidence",
+ );
+}
+
+test("#given flat V2 tools are available #when the leader reads teammode #then transport selection and user announcement precede init", () => {
+ const skill = readFileSync(join(root, "components", "teammode", "skills", "teammode", "SKILL.md"), "utf8");
+ const inspectIndex = skill.indexOf("Inspect your active tool list");
+ const initIndex = skill.indexOf('team.mjs" init');
+
+ assert.notEqual(inspectIndex, -1, "skill must inspect the active tool list");
+ assert.notEqual(initIndex, -1, "skill must still document init");
+ assert.ok(inspectIndex < initIndex, "transport inspection must happen before init");
+ assert.match(skill, /spawn_agent.*task_name[\s\S]*send_message[\s\S]*followup_task[\s\S]*wait_agent[\s\S]*list_agents[\s\S]*interrupt_agent/);
+ assert.match(skill, /tell the user|announce.*transport/i);
+ assert.match(skill, /MultiAgentV2/i);
+ assert.match(skill, /Codex App.*fallback/i);
+});
+
+test("#given MultiAgentV2 transport #when members are added and bound #then task names and canonical agent paths form the address book", () => {
+ const tempRoot = createTeamRoot("omo-codex-teammode-v2-transport-");
+ try {
+ const sessionId = "v2-transport";
+ runTeam(tempRoot, "init", "--name", "Native", "--session-name", "agents", "--session", sessionId, "--transport", "multi_agent_v2");
+ addV2Members(tempRoot, sessionId);
+ runTeam(tempRoot, "bind-agent", "--team", sessionId, "--id", "A", "--agent-path", "/root/runtime_core");
+ runTeam(tempRoot, "bind-agent", "--team", sessionId, "--id", "B", "--agent-path", "/root/mailbox_delivery");
+
+ const team = readTeamJson(tempRoot, sessionId);
+ const guide = readFileSync(join(teamDir(tempRoot, sessionId), "guide.md"), "utf8");
+ const status = runTeam(tempRoot, "status", "--team", sessionId).stdout;
+ const prompt = runTeam(tempRoot, "member-prompt", "--team", sessionId, "--id", "A").stdout;
+
+ assert.equal(team.schemaVersion, 3);
+ assert.equal(team.transport, "multi_agent_v2");
+ assert.deepEqual(team.leader, { kind: "main-session", sessionId: null, agentPath: "/root" });
+ assert.deepEqual(
+ team.members.map((member) => ({
+ id: member.id,
+ taskName: member.taskName,
+ agentPath: member.agentPath,
+ threadId: member.threadId,
+ threadTitle: member.threadTitle,
+ status: member.status,
+ })),
+ [
+ { id: "A", taskName: "runtime_core", agentPath: "/root/runtime_core", threadId: null, threadTitle: null, status: "active" },
+ { id: "B", taskName: "mailbox_delivery", agentPath: "/root/mailbox_delivery", threadId: null, threadTitle: null, status: "active" },
+ ],
+ );
+ assert.match(guide, /Transport:.*MultiAgentV2/i);
+ assert.match(guide, /members\[\]\.agentPath/);
+ assert.match(guide, /send_message/);
+ assert.match(guide, /followup_task/);
+ assert.doesNotMatch(guide, /codex_app\.send_message_to_thread/);
+ assert.doesNotMatch(guide, /codex:\/\/threads\//);
+ assert.match(status, /transport=multi_agent_v2/);
+ assert.match(status, /agent=\/root\/runtime_core/);
+ assert.match(prompt, /target `\/root`/);
+ assert.match(prompt, /send_message/);
+ assert.doesNotMatch(prompt, /thread title|codex:\/\/threads\//i);
+ } finally {
+ cleanupTeamRoot(tempRoot);
+ }
+});
+
+test("#given codex_app transport #when members bind threads #then the existing thread address book and deep links remain", () => {
+ const tempRoot = createTeamRoot("omo-codex-teammode-app-transport-");
+ try {
+ const sessionId = "app-transport";
+ runTeam(tempRoot, "init", "--name", "Fallback", "--session-name", "threads", "--session", sessionId, "--transport", "codex_app");
+ runTeam(tempRoot, "add-member", "--team", sessionId, "--id", "A", "--name", "alpha", "--focus", "alpha scope", "--lens", "area", "--deliverable", "alpha result");
+ runTeam(tempRoot, "add-member", "--team", sessionId, "--id", "B", "--name", "beta", "--focus", "beta scope", "--lens", "ownership", "--deliverable", "beta result");
+ runTeam(tempRoot, "bind-thread", "--team", sessionId, "--id", "A", "--thread", "thread-A");
+ runTeam(tempRoot, "bind-thread", "--team", sessionId, "--id", "B", "--thread", "thread-B");
+
+ const team = readTeamJson(tempRoot, sessionId);
+ const guide = readFileSync(join(teamDir(tempRoot, sessionId), "guide.md"), "utf8");
+ const status = runTeam(tempRoot, "status", "--team", sessionId).stdout;
+
+ assert.equal(team.schemaVersion, 3);
+ assert.equal(team.transport, "codex_app");
+ assert.equal(team.leader.sessionId, sessionId);
+ assert.equal(team.leader.agentPath, null);
+ assert.match(guide, /codex_app\.send_message_to_thread/);
+ assert.match(guide, /members\[\]\.threadId/);
+ assert.match(guide, /codex:\/\/threads\/thread-A/);
+ assert.match(status, /transport=codex_app/);
+ assert.match(status, /thread=thread-A/);
+ } finally {
+ cleanupTeamRoot(tempRoot);
+ }
+});
+
+test("#given an unsupported transport #when init runs #then it fails before creating team state", () => {
+ const tempRoot = createTeamRoot("omo-codex-teammode-invalid-transport-");
+ try {
+ const result = runTeamRaw(tempRoot, "init", "--name", "Invalid", "--session-name", "transport", "--session", "invalid-transport", "--transport", "other");
+
+ assert.notEqual(result.status, 0);
+ assert.match(result.stderr, /invalid transport.*multi_agent_v2.*codex_app/i);
+ assert.equal(existsSync(teamDir(tempRoot, "invalid-transport")), false);
+ } finally {
+ cleanupTeamRoot(tempRoot);
+ }
+});
+
+test("#given --transport without a value #when init runs #then it fails before creating team state", () => {
+ const tempRoot = createTeamRoot("omo-codex-teammode-valueless-transport-");
+ try {
+ const result = runTeamRaw(tempRoot, "init", "--name", "Valueless", "--session-name", "transport", "--session", "valueless-transport", "--transport");
+
+ assert.notEqual(result.status, 0, "a valueless --transport must never silently default");
+ assert.match(result.stderr, /invalid transport.*multi_agent_v2.*codex_app/i);
+ assert.equal(existsSync(teamDir(tempRoot, "valueless-transport")), false);
+ } finally {
+ cleanupTeamRoot(tempRoot);
+ }
+});
+
+test("#given an existing team #when init re-runs with a conflicting transport #then it fails and state is unchanged", () => {
+ const tempRoot = createTeamRoot("omo-codex-teammode-reinit-transport-");
+ try {
+ runTeam(tempRoot, "init", "--name", "Fallback", "--session-name", "threads", "--session", "reinit", "--transport", "codex_app");
+ const before = readFileSync(teamJsonPath(tempRoot, "reinit"), "utf8");
+
+ const conflict = runTeamRaw(tempRoot, "init", "--name", "Fallback", "--session-name", "threads", "--session", "reinit", "--transport", "multi_agent_v2");
+ assert.notEqual(conflict.status, 0, "re-init must not silently accept a conflicting transport");
+ assert.match(conflict.stderr, /transport.*immutable|already exists with transport/i);
+ assert.equal(readFileSync(teamJsonPath(tempRoot, "reinit"), "utf8"), before);
+
+ const sameTransport = runTeam(tempRoot, "init", "--name", "Fallback", "--session-name", "threads", "--session", "reinit", "--transport", "codex_app");
+ assert.match(sameTransport.stdout, /exists:.*transport: codex_app/);
+ assert.equal(readFileSync(teamJsonPath(tempRoot, "reinit"), "utf8"), before);
+ } finally {
+ cleanupTeamRoot(tempRoot);
+ }
+});
+
+test("#given a V2 team #when the whole team is archived without a note #then no output claims runtime members were closed", () => {
+ const tempRoot = createTeamRoot("omo-codex-teammode-v2-archive-");
+ try {
+ runTeam(tempRoot, "init", "--name", "Native", "--session-name", "agents", "--session", "v2-archive", "--transport", "multi_agent_v2");
+ addV2Members(tempRoot, "v2-archive");
+
+ const result = runTeam(tempRoot, "archive", "--team", "v2-archive");
+ const team = readTeamJson(tempRoot, "v2-archive");
+ const archiveEntry = team.log.find((entry) => entry.event === "archive");
+
+ assert.equal(team.status, "archived");
+ assert.doesNotMatch(result.stdout, /closed all members/i, "V2 has no runtime close/archive operation to claim");
+ assert.match(result.stdout, /no runtime archive operation/i);
+ assert.doesNotMatch(archiveEntry.detail, /all members closed/i);
+ assert.match(archiveEntry.detail, /no runtime archive operation/i);
+ } finally {
+ cleanupTeamRoot(tempRoot);
+ }
+});
+
+test("#given a V2 team #when one member is archived #then output scopes the archive to team state, not the runtime agent", () => {
+ const tempRoot = createTeamRoot("omo-codex-teammode-v2-archive-member-");
+ try {
+ runTeam(tempRoot, "init", "--name", "Native", "--session-name", "agents", "--session", "v2-archive-member", "--transport", "multi_agent_v2");
+ addV2Members(tempRoot, "v2-archive-member");
+
+ const result = runTeam(tempRoot, "archive", "--team", "v2-archive-member", "--id", "A");
+ const team = readTeamJson(tempRoot, "v2-archive-member");
+ const entry = team.log.find((logEntry) => logEntry.event === "archive-member");
+
+ assert.equal(team.members.find((member) => member.id === "A").status, "archived");
+ assert.match(result.stdout, /team state/i, "V2 per-member archive must scope the claim to team state");
+ assert.match(result.stdout, /no runtime archive operation/i);
+ assert.match(entry.detail, /no runtime archive operation/i);
+ } finally {
+ cleanupTeamRoot(tempRoot);
+ }
+});
+
+test("#given a codex_app team #when one member is archived #then the existing wording is preserved", () => {
+ const tempRoot = createTeamRoot("omo-codex-teammode-app-archive-member-");
+ try {
+ runTeam(tempRoot, "init", "--name", "Fallback", "--session-name", "threads", "--session", "app-archive-member", "--transport", "codex_app");
+ runTeam(tempRoot, "add-member", "--team", "app-archive-member", "--id", "A", "--name", "alpha", "--focus", "alpha scope", "--lens", "area", "--deliverable", "a");
+ runTeam(tempRoot, "add-member", "--team", "app-archive-member", "--id", "B", "--name", "beta", "--focus", "beta scope", "--lens", "ownership", "--deliverable", "b");
+
+ const result = runTeam(tempRoot, "archive", "--team", "app-archive-member", "--id", "A");
+
+ assert.match(result.stdout, /archived member A/);
+ assert.doesNotMatch(result.stdout, /no runtime archive operation/i);
+ } finally {
+ cleanupTeamRoot(tempRoot);
+ }
+});
+
+test("#given a transport-specific team #when the wrong bind command runs #then it fails without changing team.json", () => {
+ const tempRoot = createTeamRoot("omo-codex-teammode-cross-bind-");
+ try {
+ runTeam(tempRoot, "init", "--name", "Native", "--session-name", "agents", "--session", "cross-v2", "--transport", "multi_agent_v2");
+ addV2Members(tempRoot, "cross-v2");
+ const v2Before = readFileSync(teamJsonPath(tempRoot, "cross-v2"), "utf8");
+ const threadResult = runTeamRaw(tempRoot, "bind-thread", "--team", "cross-v2", "--id", "A", "--thread", "thread-A");
+ assert.notEqual(threadResult.status, 0);
+ assert.match(threadResult.stderr, /bind-thread.*codex_app/i);
+ assert.equal(readFileSync(teamJsonPath(tempRoot, "cross-v2"), "utf8"), v2Before);
+
+ runTeam(tempRoot, "init", "--name", "Fallback", "--session-name", "threads", "--session", "cross-app", "--transport", "codex_app");
+ runTeam(tempRoot, "add-member", "--team", "cross-app", "--id", "A", "--name", "alpha", "--focus", "alpha scope", "--lens", "area", "--deliverable", "alpha result");
+ runTeam(tempRoot, "add-member", "--team", "cross-app", "--id", "B", "--name", "beta", "--focus", "beta scope", "--lens", "ownership", "--deliverable", "beta result");
+ const appBefore = readFileSync(teamJsonPath(tempRoot, "cross-app"), "utf8");
+ const agentResult = runTeamRaw(tempRoot, "bind-agent", "--team", "cross-app", "--id", "A", "--agent-path", "/root/alpha");
+ assert.notEqual(agentResult.status, 0);
+ assert.match(agentResult.stderr, /bind-agent.*multi_agent_v2/i);
+ assert.equal(readFileSync(teamJsonPath(tempRoot, "cross-app"), "utf8"), appBefore);
+ } finally {
+ cleanupTeamRoot(tempRoot);
+ }
+});
+
+test("#given V2 expected task identity #when bind-agent receives another path #then it fails without activating the member", () => {
+ const tempRoot = createTeamRoot("omo-codex-teammode-agent-path-");
+ try {
+ runTeam(tempRoot, "init", "--name", "Native", "--session-name", "agents", "--session", "agent-path", "--transport", "multi_agent_v2");
+ addV2Members(tempRoot, "agent-path");
+ const before = readFileSync(teamJsonPath(tempRoot, "agent-path"), "utf8");
+
+ const result = runTeamRaw(tempRoot, "bind-agent", "--team", "agent-path", "--id", "A", "--agent-path", "/root/not_runtime_core");
+
+ assert.notEqual(result.status, 0);
+ assert.match(result.stderr, /expected.*\/root\/runtime_core/i);
+ assert.equal(readFileSync(teamJsonPath(tempRoot, "agent-path"), "utf8"), before);
+ } finally {
+ cleanupTeamRoot(tempRoot);
+ }
+});
+
+test("#given a V2 member has no valid task name #when add-member runs #then state remains unchanged", () => {
+ const tempRoot = createTeamRoot("omo-codex-teammode-task-name-");
+ try {
+ runTeam(tempRoot, "init", "--name", "Native", "--session-name", "agents", "--session", "task-name", "--transport", "multi_agent_v2");
+ const before = readFileSync(teamJsonPath(tempRoot, "task-name"), "utf8");
+
+ const missing = runTeamRaw(tempRoot, "add-member", "--team", "task-name", "--id", "A", "--name", "alpha", "--focus", "alpha scope", "--lens", "area", "--deliverable", "alpha result");
+ assert.notEqual(missing.status, 0);
+ assert.match(missing.stderr, /task name is required/i);
+ assert.equal(readFileSync(teamJsonPath(tempRoot, "task-name"), "utf8"), before);
+
+ const malformed = runTeamRaw(tempRoot, "add-member", "--team", "task-name", "--id", "A", "--name", "alpha", "--task-name", "Alpha-Hyphen", "--focus", "alpha scope", "--lens", "area", "--deliverable", "alpha result");
+ assert.notEqual(malformed.status, 0);
+ assert.match(malformed.stderr, /lowercase letters, digits, and underscores/i);
+ assert.equal(readFileSync(teamJsonPath(tempRoot, "task-name"), "utf8"), before);
+ } finally {
+ cleanupTeamRoot(tempRoot);
+ }
+});
+
+test("#given legacy schemaVersion 2 state with existing members #when a mutation succeeds #then it upgrades in place as codex_app", () => {
+ const tempRoot = createTeamRoot("omo-codex-teammode-schema-migration-");
+ try {
+ // given - a populated legacy team: the schema downgrade happens AFTER members exist so the
+ // member-migration path is actually exercised, not just addMember defaults.
+ runTeam(tempRoot, "init", "--name", "Legacy", "--session-name", "threads", "--session", "schema-migration");
+ runTeam(tempRoot, "add-member", "--team", "schema-migration", "--id", "A", "--name", "alpha", "--focus", "alpha scope", "--lens", "area", "--deliverable", "alpha result");
+ runTeam(tempRoot, "add-member", "--team", "schema-migration", "--id", "B", "--name", "beta", "--focus", "beta scope", "--lens", "ownership", "--deliverable", "beta result");
+ runTeam(tempRoot, "bind-thread", "--team", "schema-migration", "--id", "A", "--thread", "legacy-thread-a");
+ const path = teamJsonPath(tempRoot, "schema-migration");
+ const legacy = readTeamJson(tempRoot, "schema-migration");
+ legacy.schemaVersion = 2;
+ delete legacy.transport;
+ delete legacy.leader.agentPath;
+ for (const member of legacy.members) {
+ delete member.taskName;
+ delete member.agentPath;
+ }
+ writeFileSync(path, `${JSON.stringify(legacy, null, 2)}\n`);
+
+ // when - any mutating command loads, migrates, and persists
+ runTeam(tempRoot, "set-status", "--team", "schema-migration", "--id", "B", "--status", "blocked", "--note", "legacy migration check");
+ const migrated = readTeamJson(tempRoot, "schema-migration");
+
+ // then - the persisted file is schema 3 codex_app and PRE-EXISTING members gained null V2 fields
+ assert.equal(migrated.schemaVersion, 3);
+ assert.equal(migrated.transport, "codex_app");
+ assert.equal(migrated.leader.agentPath, null);
+ assert.deepEqual(
+ migrated.members.map((member) => ({ id: member.id, taskName: member.taskName, agentPath: member.agentPath, threadId: member.threadId })),
+ [
+ { id: "A", taskName: null, agentPath: null, threadId: "legacy-thread-a" },
+ { id: "B", taskName: null, agentPath: null, threadId: null },
+ ],
+ );
+ assert.equal(migrated.members[1].status, "blocked");
+ } finally {
+ cleanupTeamRoot(tempRoot);
+ }
+});