oh-my-opencode 4.5.12 → 4.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/opencode-qa/SKILL.md +194 -0
- package/.agents/skills/opencode-qa/references/cli-commands.md +188 -0
- package/.agents/skills/opencode-qa/references/db-investigation.md +197 -0
- package/.agents/skills/opencode-qa/references/events-hooks.md +110 -0
- package/.agents/skills/opencode-qa/references/sdk.md +96 -0
- package/.agents/skills/opencode-qa/references/server-api.md +200 -0
- package/.agents/skills/opencode-qa/references/testing-harness.md +218 -0
- package/.agents/skills/opencode-qa/references/tui-tmux.md +52 -0
- package/.agents/skills/opencode-qa/scripts/db-session-by-id.sh +53 -0
- package/.agents/skills/opencode-qa/scripts/db-session-by-name.sh +57 -0
- package/.agents/skills/opencode-qa/scripts/db-session-by-text.sh +158 -0
- package/.agents/skills/opencode-qa/scripts/export-roundtrip.sh +57 -0
- package/.agents/skills/opencode-qa/scripts/lib/common.sh +216 -0
- package/.agents/skills/opencode-qa/scripts/server-smoke.sh +64 -0
- package/.agents/skills/opencode-qa/scripts/sse-hook-probe.sh +106 -0
- package/.agents/skills/opencode-qa/scripts/tui-smoke.sh +89 -0
- package/README.ja.md +13 -3
- package/README.ko.md +13 -3
- package/README.md +24 -14
- package/README.ru.md +13 -3
- package/README.zh-cn.md +13 -3
- package/bin/oh-my-opencode.js +4 -3
- package/bin/oh-my-opencode.test.ts +35 -7
- package/bin/platform.d.ts +1 -1
- package/bin/platform.js +4 -4
- package/bin/platform.test.ts +31 -9
- package/bin/version-mismatch.js +47 -0
- package/bin/version-mismatch.test.ts +120 -0
- package/dist/cli/cleanup-command.d.ts +4 -0
- package/dist/cli/cleanup.d.ts +11 -0
- package/dist/cli/cli-program.d.ts +2 -1
- package/dist/cli/codex-ulw-loop.d.ts +12 -0
- package/dist/cli/doctor/checks/tui-plugin-config.d.ts +2 -0
- package/dist/cli/index.js +2189 -529
- package/dist/cli/install-codex/codex-cache.d.ts +1 -0
- package/dist/cli/install-codex/codex-cleanup-config.d.ts +6 -0
- package/dist/cli/install-codex/codex-cleanup.d.ts +21 -0
- package/dist/cli/install-codex/codex-config-permissions.d.ts +1 -0
- package/dist/cli/install-codex/codex-config-reasoning.d.ts +2 -0
- package/dist/cli/install-codex/codex-config-toml.d.ts +2 -1
- package/dist/cli/install-codex/codex-installation-detection.d.ts +36 -0
- package/dist/cli/install-codex/codex-model-catalog.d.ts +13 -0
- package/dist/cli/install-codex/codex-package-layout.d.ts +1 -0
- package/dist/cli/install-codex/codex-project-local-cleanup-best-effort.d.ts +7 -0
- package/dist/cli/install-codex/codex-project-local-cleanup.d.ts +35 -0
- package/dist/cli/install-codex/git-bash.d.ts +35 -0
- package/dist/cli/install-codex/index.d.ts +4 -0
- package/dist/cli/install-codex/toml-section-editor.d.ts +2 -0
- package/dist/cli/install-codex/types.d.ts +20 -0
- package/dist/cli/run/event-state.d.ts +1 -0
- package/dist/cli/run/poll-for-completion.d.ts +1 -0
- package/dist/cli/run/prompt-start.d.ts +7 -0
- package/dist/cli/star-request.d.ts +9 -0
- package/dist/config/schema/hooks.d.ts +0 -1
- package/dist/create-hooks.d.ts +0 -1
- package/dist/features/background-agent/concurrency.d.ts +1 -0
- package/dist/features/background-agent/process-cleanup.d.ts +6 -0
- package/dist/features/builtin-skills/skills/debugging.d.ts +2 -0
- package/dist/features/builtin-skills/skills/index.d.ts +1 -0
- package/dist/features/claude-code-session-state/state.d.ts +1 -0
- package/dist/features/opencode-skill-loader/index.d.ts +1 -0
- package/dist/features/opencode-skill-loader/opencode-config-skills-reader.d.ts +5 -0
- package/dist/features/tmux-subagent/attachable-session-status.d.ts +1 -1
- package/dist/features/tmux-subagent/session-status-parser.d.ts +1 -0
- package/dist/hooks/comment-checker/cli.d.ts +1 -0
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/tasks-todowrite-disabler/constants.d.ts +1 -1
- package/dist/index.js +1077 -563
- package/dist/plugin/hooks/create-core-hooks.d.ts +0 -1
- package/dist/plugin/hooks/create-session-hooks.d.ts +1 -2
- package/dist/plugin/messages-transform.d.ts +8 -1
- package/dist/plugin/user-abort-interrupted-recovery-guard.d.ts +6 -0
- package/dist/shared/command-executor/execute-hook-command.d.ts +2 -0
- package/dist/shared/prompt-async-gate/recent-dispatches.d.ts +14 -0
- package/dist/shared/prompt-async-gate/semantic-dedupe.d.ts +7 -0
- package/dist/shared/prompt-async-gate/session-idle-dispatch.d.ts +1 -0
- package/dist/shared/prompt-async-gate/timing.d.ts +1 -0
- package/dist/shared/prompt-async-gate/types.d.ts +2 -0
- package/dist/shared/prompt-async-gate.d.ts +1 -1
- package/dist/tools/skill/description-formatter.d.ts +5 -1
- package/dist/tools/skill/types.d.ts +1 -0
- package/package.json +22 -18
- package/packages/ast-grep-mcp/dist/cli.js +53 -9
- package/packages/git-bash-mcp/dist/cli.js +367 -0
- package/packages/lsp-tools-mcp/dist/lsp/process.js +1 -1
- package/packages/omo-codex/plugin/.mcp.json +11 -0
- package/packages/omo-codex/plugin/components/comment-checker/README.md +1 -1
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +29 -0
- package/packages/omo-codex/plugin/components/git-bash/package.json +23 -0
- package/packages/omo-codex/plugin/components/git-bash/src/cli.ts +33 -0
- package/packages/omo-codex/plugin/components/git-bash/src/codex-hook.ts +180 -0
- package/packages/omo-codex/plugin/components/git-bash/src/index.ts +10 -0
- package/packages/omo-codex/plugin/components/git-bash/test/codex-hook.test.ts +195 -0
- package/packages/omo-codex/plugin/components/git-bash/tsconfig.build.json +13 -0
- package/packages/omo-codex/plugin/components/git-bash/tsconfig.json +25 -0
- package/packages/omo-codex/plugin/components/lsp/README.md +1 -1
- package/packages/omo-codex/plugin/components/lsp/src/cli.ts +5 -5
- package/packages/omo-codex/plugin/components/lsp/src/codex-hook-cli.ts +33 -0
- package/packages/omo-codex/plugin/components/lsp/src/codex-hook.ts +19 -27
- package/packages/omo-codex/plugin/components/lsp/test/codex-hook-cli.test.ts +28 -0
- package/packages/omo-codex/plugin/components/lsp/test/codex-hook-errors.test.ts +55 -0
- package/packages/omo-codex/plugin/components/lsp/test/package-smoke.test.ts +7 -5
- package/packages/omo-codex/plugin/components/rules/README.md +1 -1
- package/packages/omo-codex/plugin/components/rules/bundled-rules/hephaestus.md +6 -4
- package/packages/omo-codex/plugin/components/rules/bundled-rules/windows-git-bash.md +10 -0
- package/packages/omo-codex/plugin/components/rules/src/post-compact-budget.ts +0 -2
- package/packages/omo-codex/plugin/components/rules/test/package-smoke.test.ts +3 -1
- package/packages/omo-codex/plugin/components/rules/test/windows-git-bash-bundled-rule.test.ts +97 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/directive.md +6 -5
- package/packages/omo-codex/plugin/components/start-work-continuation/test/codex-hook.test.ts +22 -0
- package/packages/omo-codex/plugin/components/ultrawork/CHANGELOG.md +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/README.md +3 -3
- package/packages/omo-codex/plugin/components/ultrawork/agents/codex-ultrawork-reviewer.toml +4 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/librarian.toml +8 -7
- package/packages/omo-codex/plugin/components/ultrawork/agents/plan.toml +9 -8
- package/packages/omo-codex/plugin/components/ultrawork/directive.md +32 -6
- package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook.test.ts +27 -4
- package/packages/omo-codex/plugin/components/ultrawork/test/package-smoke.test.ts +25 -0
- package/packages/omo-codex/plugin/components/ulw-loop/README.md +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +28 -205
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +231 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint.ts +12 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint.test.ts +19 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/package-smoke.test.ts +102 -5
- package/packages/omo-codex/plugin/hooks/hooks.json +35 -2
- package/packages/omo-codex/plugin/model-catalog.json +49 -0
- package/packages/omo-codex/plugin/package-lock.json +19 -0
- package/packages/omo-codex/plugin/package.json +3 -1
- package/packages/omo-codex/plugin/scripts/auto-update.mjs +159 -0
- package/packages/omo-codex/plugin/scripts/build-bundled-mcp-runtimes.mjs +16 -1
- package/packages/omo-codex/plugin/scripts/build-components.mjs +2 -1
- package/packages/omo-codex/plugin/scripts/migrate-codex-config.mjs +269 -0
- package/packages/omo-codex/plugin/scripts/sync-hook-status-messages.mjs +89 -0
- package/packages/omo-codex/plugin/scripts/sync-skills.mjs +6 -6
- package/packages/omo-codex/plugin/skills/init-deep/SKILL.md +6 -6
- package/packages/omo-codex/plugin/skills/lcx-report-bug/SKILL.md +127 -0
- package/packages/omo-codex/plugin/skills/lcx-report-bug/agents/openai.yaml +9 -0
- package/packages/omo-codex/plugin/skills/refactor/SKILL.md +6 -6
- package/packages/omo-codex/plugin/skills/remove-ai-slops/SKILL.md +6 -6
- package/packages/omo-codex/plugin/skills/review-work/SKILL.md +33 -8
- package/packages/omo-codex/plugin/skills/start-work/SKILL.md +25 -5
- package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +28 -205
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +231 -0
- package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +17 -17
- package/packages/omo-codex/plugin/test/aggregate.test.mjs +188 -20
- package/packages/omo-codex/plugin/test/auto-update.test.mjs +129 -0
- package/packages/omo-codex/plugin/test/hook-status-message.test.mjs +58 -11
- package/packages/omo-codex/plugin/test/install-time-build-runtime.test.mjs +34 -0
- package/packages/omo-codex/plugin/test/mcp-research-servers.test.mjs +21 -0
- package/packages/omo-codex/plugin/test/migrate-codex-config.test.mjs +146 -0
- package/packages/omo-codex/plugin/test/node-install-surface.test.mjs +48 -0
- package/packages/omo-codex/plugin/test/subagent-guidance.test.mjs +76 -0
- package/packages/omo-codex/plugin/test/sync-hook-status-messages.test.mjs +67 -0
- package/packages/omo-codex/plugin/test/sync-skills.test.mjs +54 -2
- package/packages/omo-codex/scripts/install/cache.mjs +5 -3
- package/packages/omo-codex/scripts/install/cli-args.mjs +112 -0
- package/packages/omo-codex/scripts/install/config.mjs +23 -1
- package/packages/omo-codex/scripts/install/delegated-command.mjs +25 -0
- package/packages/omo-codex/scripts/install/git-bash.mjs +99 -0
- package/packages/omo-codex/scripts/install/git-bash.test.mjs +174 -0
- package/packages/omo-codex/scripts/install/legacy-bins.mjs +1 -0
- package/packages/omo-codex/scripts/install/mcp-runtime-cache.mjs +5 -1
- package/packages/omo-codex/scripts/install/model-catalog.mjs +66 -0
- package/packages/omo-codex/scripts/install/multi-agent-v2-config.mjs +7 -1
- package/packages/omo-codex/scripts/install/permissions.d.mts +1 -0
- package/packages/omo-codex/scripts/install/permissions.mjs +26 -0
- package/packages/omo-codex/scripts/install/project-local-cleanup.mjs +229 -0
- package/packages/omo-codex/scripts/install/reasoning-config.mjs +72 -0
- package/packages/omo-codex/scripts/install/source-package-build.mjs +20 -0
- package/packages/omo-codex/scripts/install/toml-editor.mjs +19 -2
- package/packages/omo-codex/scripts/install-bin-links.test.mjs +23 -0
- package/packages/omo-codex/scripts/install-cli-args.test.mjs +146 -0
- package/packages/omo-codex/scripts/install-config-autonomous.test.mjs +48 -0
- package/packages/omo-codex/scripts/install-config-reasoning.test.mjs +141 -0
- package/packages/omo-codex/scripts/install-config.test.mjs +205 -0
- package/packages/omo-codex/scripts/install-local-entrypoint.test.mjs +157 -0
- package/packages/omo-codex/scripts/install-local-git-bash-preflight.test.mjs +145 -0
- package/packages/omo-codex/scripts/install-local.mjs +91 -8
- package/packages/omo-codex/scripts/install-local.test.mjs +15 -0
- package/packages/omo-codex/scripts/install-mcp-runtime.test.mjs +60 -0
- package/packages/omo-codex/scripts/install-packaged-local.test.mjs +67 -0
- package/packages/omo-codex/scripts/install-project-local-cleanup.test.mjs +277 -0
- package/packages/shared-skills/skills/lcx-report-bug/SKILL.md +127 -0
- package/packages/shared-skills/skills/lcx-report-bug/agents/openai.yaml +9 -0
- package/packages/shared-skills/skills/review-work/SKILL.md +33 -8
- package/packages/shared-skills/skills/start-work/SKILL.md +25 -5
- package/packages/shared-skills/skills/ulw-plan/SKILL.md +11 -11
- package/postinstall.mjs +36 -3
- package/dist/hooks/context-window-monitor.d.ts +0 -19
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { mkdir, readFile, stat, writeFile } from "node:fs/promises";
|
|
4
|
+
import { homedir } from "node:os";
|
|
5
|
+
import { dirname, join, resolve } from "node:path";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
import { pathToFileURL } from "node:url";
|
|
8
|
+
|
|
9
|
+
const FALLBACK_CATALOG = {
|
|
10
|
+
version: "fallback.gpt-5.5-400k",
|
|
11
|
+
current: {
|
|
12
|
+
model: "gpt-5.5",
|
|
13
|
+
model_context_window: 400_000,
|
|
14
|
+
model_reasoning_effort: "high",
|
|
15
|
+
plan_mode_reasoning_effort: "xhigh",
|
|
16
|
+
},
|
|
17
|
+
roles: {
|
|
18
|
+
default: {
|
|
19
|
+
model: "gpt-5.5",
|
|
20
|
+
model_context_window: 400_000,
|
|
21
|
+
model_reasoning_effort: "high",
|
|
22
|
+
plan_mode_reasoning_effort: "xhigh",
|
|
23
|
+
},
|
|
24
|
+
verifier: { model: "gpt-5.5", model_reasoning_effort: "xhigh" },
|
|
25
|
+
worker: { model: "gpt-5.4", model_reasoning_effort: "high" },
|
|
26
|
+
},
|
|
27
|
+
managedProfiles: [
|
|
28
|
+
{ version: "legacy.gpt-5.2", match: { model: "gpt-5.2" } },
|
|
29
|
+
{
|
|
30
|
+
version: "legacy.gpt-5.4-1m",
|
|
31
|
+
match: {
|
|
32
|
+
model: "gpt-5.4",
|
|
33
|
+
model_context_window: 1_000_000,
|
|
34
|
+
model_reasoning_effort: "high",
|
|
35
|
+
plan_mode_reasoning_effort: "xhigh",
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const MANAGED_KEYS = ["model", "model_context_window", "model_reasoning_effort", "plan_mode_reasoning_effort"];
|
|
42
|
+
|
|
43
|
+
export async function migrateCodexConfig({ env = process.env, cwd = process.cwd() } = {}) {
|
|
44
|
+
const catalog = await readModelCatalog(env);
|
|
45
|
+
const statePath = resolveStatePath(env);
|
|
46
|
+
const state = await readState(statePath);
|
|
47
|
+
const paths = await configPaths({ env, cwd });
|
|
48
|
+
const changed = [];
|
|
49
|
+
const nextState = { catalogVersion: catalog.version, files: {} };
|
|
50
|
+
for (const configPath of paths) {
|
|
51
|
+
const result = await migrateConfigFile(configPath, {
|
|
52
|
+
catalog,
|
|
53
|
+
previousState: state.files?.[configPath],
|
|
54
|
+
});
|
|
55
|
+
if (result.changed) changed.push(configPath);
|
|
56
|
+
nextState.files[configPath] = {
|
|
57
|
+
catalogVersion: catalog.version,
|
|
58
|
+
written: result.written,
|
|
59
|
+
managed: result.managed,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
await writeState(statePath, nextState);
|
|
63
|
+
return { changed };
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export async function migrateConfigFile(configPath, { catalog = FALLBACK_CATALOG, previousState } = {}) {
|
|
67
|
+
const before = await readConfig(configPath);
|
|
68
|
+
const decision = shouldApplyCatalog(before, catalog, previousState);
|
|
69
|
+
if (!decision.apply) return { changed: false, written: readRootSettings(before), managed: false };
|
|
70
|
+
const after = ensureCodexReasoningConfig(before, catalog.current);
|
|
71
|
+
if (after === before) return { changed: false, written: catalog.current, managed: true };
|
|
72
|
+
await mkdir(dirname(configPath), { recursive: true });
|
|
73
|
+
await writeFile(configPath, `${after.trimEnd()}\n`);
|
|
74
|
+
return { changed: true, written: catalog.current, managed: true };
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function ensureCodexReasoningConfig(config, profile = FALLBACK_CATALOG.current) {
|
|
78
|
+
let next = replaceOrInsertRootSetting(config, "model", JSON.stringify(profile.model));
|
|
79
|
+
next = replaceOrInsertRootSetting(next, "model_context_window", profile.model_context_window.toString());
|
|
80
|
+
next = replaceOrInsertRootSetting(next, "model_reasoning_effort", JSON.stringify(profile.model_reasoning_effort));
|
|
81
|
+
next = replaceOrInsertRootSetting(next, "plan_mode_reasoning_effort", JSON.stringify(profile.plan_mode_reasoning_effort));
|
|
82
|
+
return next;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export async function readModelCatalog(env = process.env) {
|
|
86
|
+
const catalogPath = env.LAZYCODEX_MODEL_CATALOG_PATH?.trim() || join(dirname(fileURLToPath(import.meta.url)), "..", "model-catalog.json");
|
|
87
|
+
try {
|
|
88
|
+
return parseCatalog(JSON.parse(await readFile(catalogPath, "utf8"))) ?? FALLBACK_CATALOG;
|
|
89
|
+
} catch (error) {
|
|
90
|
+
if (error instanceof Error) return FALLBACK_CATALOG;
|
|
91
|
+
throw error;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function shouldApplyCatalog(config, catalog, previousState) {
|
|
96
|
+
const current = readRootSettings(config);
|
|
97
|
+
if (Object.keys(current).length === 0) return { apply: true, reason: "empty" };
|
|
98
|
+
if (matchesProfile(current, catalog.current)) return { apply: false, reason: "current" };
|
|
99
|
+
if (previousState?.managed === true && matchesProfile(current, previousState.written)) {
|
|
100
|
+
return { apply: true, reason: "managed-state" };
|
|
101
|
+
}
|
|
102
|
+
for (const profile of catalog.managedProfiles) {
|
|
103
|
+
if (matchesProfile(current, profile.match)) return { apply: true, reason: profile.version };
|
|
104
|
+
}
|
|
105
|
+
return { apply: false, reason: "user-modified" };
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function matchesProfile(current, profile) {
|
|
109
|
+
if (!isRecord(profile)) return false;
|
|
110
|
+
for (const [key, value] of Object.entries(profile)) {
|
|
111
|
+
if (current[key] !== value) return false;
|
|
112
|
+
}
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function readRootSettings(config) {
|
|
117
|
+
const settings = {};
|
|
118
|
+
for (const line of config.split(/\n/)) {
|
|
119
|
+
if (isSectionHeader(line)) break;
|
|
120
|
+
for (const key of MANAGED_KEYS) {
|
|
121
|
+
if (!isRootSetting(line, key)) continue;
|
|
122
|
+
const value = parseTomlScalar(line.slice(line.indexOf("=") + 1));
|
|
123
|
+
if (value !== undefined) settings[key] = value;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return settings;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function parseTomlScalar(value) {
|
|
130
|
+
const trimmed = value.trim();
|
|
131
|
+
if (trimmed.startsWith('"') && trimmed.endsWith('"')) {
|
|
132
|
+
try {
|
|
133
|
+
return JSON.parse(trimmed);
|
|
134
|
+
} catch (error) {
|
|
135
|
+
if (error instanceof SyntaxError) return undefined;
|
|
136
|
+
throw error;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
const numeric = Number(trimmed);
|
|
140
|
+
return Number.isFinite(numeric) ? numeric : undefined;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function parseCatalog(value) {
|
|
144
|
+
if (!isRecord(value) || !isRecord(value.current) || !Array.isArray(value.managedProfiles)) return null;
|
|
145
|
+
if (typeof value.version !== "string" || !isReasoningProfile(value.current)) return null;
|
|
146
|
+
const managedProfiles = [];
|
|
147
|
+
for (const profile of value.managedProfiles) {
|
|
148
|
+
if (!isRecord(profile) || typeof profile.version !== "string" || !isRecord(profile.match)) return null;
|
|
149
|
+
managedProfiles.push({ version: profile.version, match: profile.match });
|
|
150
|
+
}
|
|
151
|
+
return { version: value.version, current: value.current, managedProfiles, roles: isRecord(value.roles) ? value.roles : {} };
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function isReasoningProfile(value) {
|
|
155
|
+
return (
|
|
156
|
+
isRecord(value) &&
|
|
157
|
+
typeof value.model === "string" &&
|
|
158
|
+
typeof value.model_context_window === "number" &&
|
|
159
|
+
typeof value.model_reasoning_effort === "string" &&
|
|
160
|
+
typeof value.plan_mode_reasoning_effort === "string"
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function isRecord(value) {
|
|
165
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
async function configPaths({ env, cwd }) {
|
|
169
|
+
const codexHome = resolve(env.CODEX_HOME?.trim() || join(homedir(), ".codex"));
|
|
170
|
+
const paths = new Set([join(codexHome, "config.toml")]);
|
|
171
|
+
for (const projectConfig of projectConfigPaths({ cwd, stopAt: homedir() })) {
|
|
172
|
+
if (await pathExists(projectConfig)) paths.add(projectConfig);
|
|
173
|
+
}
|
|
174
|
+
return [...paths];
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function projectConfigPaths({ cwd, stopAt }) {
|
|
178
|
+
const paths = [];
|
|
179
|
+
let current = resolve(cwd);
|
|
180
|
+
const stop = resolve(stopAt);
|
|
181
|
+
while (true) {
|
|
182
|
+
paths.push(join(current, ".codex", "config.toml"));
|
|
183
|
+
if (current === stop || current === dirname(current)) break;
|
|
184
|
+
current = dirname(current);
|
|
185
|
+
}
|
|
186
|
+
return paths;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
async function readConfig(configPath) {
|
|
190
|
+
try {
|
|
191
|
+
return await readFile(configPath, "utf8");
|
|
192
|
+
} catch (error) {
|
|
193
|
+
if (error instanceof Error && "code" in error && error.code === "ENOENT") return "";
|
|
194
|
+
throw error;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function resolveStatePath(env) {
|
|
199
|
+
if (env.LAZYCODEX_MODEL_CATALOG_STATE_PATH?.trim()) return env.LAZYCODEX_MODEL_CATALOG_STATE_PATH;
|
|
200
|
+
const dataRoot = env.PLUGIN_DATA?.trim() || join(homedir(), ".local", "share", "lazycodex");
|
|
201
|
+
return join(dataRoot, "model-catalog-state.json");
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
async function readState(statePath) {
|
|
205
|
+
try {
|
|
206
|
+
const parsed = JSON.parse(await readFile(statePath, "utf8"));
|
|
207
|
+
return isRecord(parsed) ? parsed : {};
|
|
208
|
+
} catch (error) {
|
|
209
|
+
if (error instanceof Error) return {};
|
|
210
|
+
throw error;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
async function writeState(statePath, state) {
|
|
215
|
+
await mkdir(dirname(statePath), { recursive: true });
|
|
216
|
+
await writeFile(statePath, `${JSON.stringify(state, null, 2)}\n`);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
async function pathExists(path) {
|
|
220
|
+
try {
|
|
221
|
+
await stat(path);
|
|
222
|
+
return true;
|
|
223
|
+
} catch (error) {
|
|
224
|
+
if (error instanceof Error && "code" in error && error.code === "ENOENT") return false;
|
|
225
|
+
throw error;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function replaceOrInsertRootSetting(config, key, value) {
|
|
230
|
+
const lines = config.split(/\n/);
|
|
231
|
+
const output = [];
|
|
232
|
+
let replaced = false;
|
|
233
|
+
let inserted = false;
|
|
234
|
+
for (const line of lines) {
|
|
235
|
+
if (!inserted && isSectionHeader(line)) {
|
|
236
|
+
if (!replaced) output.push(`${key} = ${value}`);
|
|
237
|
+
inserted = true;
|
|
238
|
+
}
|
|
239
|
+
if (isRootSetting(line, key)) {
|
|
240
|
+
if (!replaced) {
|
|
241
|
+
output.push(`${key} = ${value}`);
|
|
242
|
+
replaced = true;
|
|
243
|
+
}
|
|
244
|
+
continue;
|
|
245
|
+
}
|
|
246
|
+
output.push(line);
|
|
247
|
+
}
|
|
248
|
+
if (!replaced && !inserted) output.push(`${key} = ${value}`);
|
|
249
|
+
return output.join("\n");
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function isSectionHeader(line) {
|
|
253
|
+
const trimmed = line.trim();
|
|
254
|
+
return trimmed.startsWith("[") && trimmed.endsWith("]");
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
function isRootSetting(line, key) {
|
|
258
|
+
const trimmed = line.trimStart();
|
|
259
|
+
if (trimmed.startsWith("#") || trimmed.startsWith("[")) return false;
|
|
260
|
+
const match = trimmed.match(/^([A-Za-z_][A-Za-z0-9_]*)\s*=/);
|
|
261
|
+
return match?.[1] === key;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
if (process.argv[1] !== undefined && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
265
|
+
migrateCodexConfig().catch((error) => {
|
|
266
|
+
if (!(error instanceof Error)) throw error;
|
|
267
|
+
process.exit(0);
|
|
268
|
+
});
|
|
269
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { access, readdir, readFile, writeFile } from "node:fs/promises";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
import { pathToFileURL } from "node:url";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
|
|
7
|
+
import { formatLazyCodexHookStatusMessage, normalizeLazyCodexHookStatusLabel } from "./hook-status-message.mjs";
|
|
8
|
+
|
|
9
|
+
const defaultRoot = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
10
|
+
|
|
11
|
+
async function exists(path) {
|
|
12
|
+
try {
|
|
13
|
+
await access(path);
|
|
14
|
+
return true;
|
|
15
|
+
} catch (error) {
|
|
16
|
+
if (error instanceof Error && "code" in error && error.code === "ENOENT") return false;
|
|
17
|
+
throw error;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async function readJson(path) {
|
|
22
|
+
return JSON.parse(await readFile(path, "utf8"));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async function writeJson(path, value) {
|
|
26
|
+
await writeFile(path, `${JSON.stringify(value, null, "\t")}\n`);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async function readPackageVersion(path) {
|
|
30
|
+
const packageJson = await readJson(path);
|
|
31
|
+
return packageJson.version;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
async function readComponentVersions(root) {
|
|
35
|
+
const componentsRoot = join(root, "components");
|
|
36
|
+
const entries = await readdir(componentsRoot, { withFileTypes: true });
|
|
37
|
+
const versions = new Map();
|
|
38
|
+
for (const entry of entries) {
|
|
39
|
+
if (!entry.isDirectory()) continue;
|
|
40
|
+
const packageJsonPath = join(componentsRoot, entry.name, "package.json");
|
|
41
|
+
if (!(await exists(packageJsonPath))) continue;
|
|
42
|
+
versions.set(entry.name, await readPackageVersion(packageJsonPath));
|
|
43
|
+
}
|
|
44
|
+
return versions;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function componentVersionForCommand(command, componentVersions, fallbackVersion) {
|
|
48
|
+
for (const [componentName, version] of componentVersions.entries()) {
|
|
49
|
+
if (command.includes(`/components/${componentName}/dist/cli.js`)) return version;
|
|
50
|
+
}
|
|
51
|
+
return fallbackVersion;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function syncHooksJson(hooksJson, versionForCommand) {
|
|
55
|
+
for (const groups of Object.values(hooksJson.hooks)) {
|
|
56
|
+
for (const group of groups) {
|
|
57
|
+
for (const hook of group.hooks) {
|
|
58
|
+
if (hook.type !== "command") continue;
|
|
59
|
+
const label = normalizeLazyCodexHookStatusLabel(hook.statusMessage);
|
|
60
|
+
hook.statusMessage = formatLazyCodexHookStatusMessage(versionForCommand(hook.command), label);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
async function syncComponentHooks(root, componentName, version) {
|
|
67
|
+
const hooksPath = join(root, "components", componentName, "hooks", "hooks.json");
|
|
68
|
+
if (!(await exists(hooksPath))) return;
|
|
69
|
+
const hooksJson = await readJson(hooksPath);
|
|
70
|
+
syncHooksJson(hooksJson, () => version);
|
|
71
|
+
await writeJson(hooksPath, hooksJson);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export async function syncHookStatusMessages(root = defaultRoot) {
|
|
75
|
+
const aggregateVersion = await readPackageVersion(join(root, ".codex-plugin", "plugin.json"));
|
|
76
|
+
const componentVersions = await readComponentVersions(root);
|
|
77
|
+
const aggregateHooksPath = join(root, "hooks", "hooks.json");
|
|
78
|
+
const aggregateHooks = await readJson(aggregateHooksPath);
|
|
79
|
+
syncHooksJson(aggregateHooks, (command) => componentVersionForCommand(command, componentVersions, aggregateVersion));
|
|
80
|
+
await writeJson(aggregateHooksPath, aggregateHooks);
|
|
81
|
+
|
|
82
|
+
for (const [componentName, version] of componentVersions.entries()) {
|
|
83
|
+
await syncComponentHooks(root, componentName, version);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (process.argv[1] !== undefined && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
88
|
+
await syncHookStatusMessages();
|
|
89
|
+
}
|
|
@@ -22,15 +22,15 @@ This skill may include examples copied from the OpenCode harness. In Codex, do n
|
|
|
22
22
|
|
|
23
23
|
| OpenCode example | Codex tool to use |
|
|
24
24
|
| --- | --- |
|
|
25
|
-
| \`call_omo_agent(subagent_type="explore", ...)\` | \`spawn_agent(agent_type="explorer", task_name="...", message="...")\` |
|
|
26
|
-
| \`call_omo_agent(subagent_type="librarian", ...)\` | \`spawn_agent(agent_type="librarian", task_name="...", message="...")\` |
|
|
27
|
-
| \`task(subagent_type="plan", ...)\` | \`spawn_agent(agent_type="plan", task_name="...", message="...")\` |
|
|
28
|
-
| \`task(subagent_type="oracle", ...)\` for final verification | \`spawn_agent(agent_type="codex-ultrawork-reviewer", task_name="...", message="...")\` |
|
|
29
|
-
| \`task(category="...", ...)\` for implementation or QA | \`spawn_agent(agent_type="worker", task_name="...", message="...")\` |
|
|
25
|
+
| \`call_omo_agent(subagent_type="explore", ...)\` | \`spawn_agent(agent_type="explorer", task_name="...", message="...", fork_turns="none")\` |
|
|
26
|
+
| \`call_omo_agent(subagent_type="librarian", ...)\` | \`spawn_agent(agent_type="librarian", task_name="...", message="...", fork_turns="none")\` |
|
|
27
|
+
| \`task(subagent_type="plan", ...)\` | \`spawn_agent(agent_type="plan", task_name="...", message="...", fork_turns="none")\` |
|
|
28
|
+
| \`task(subagent_type="oracle", ...)\` for final verification | \`spawn_agent(agent_type="codex-ultrawork-reviewer", task_name="...", message="...", fork_turns="none")\` |
|
|
29
|
+
| \`task(category="...", ...)\` for implementation or QA | \`spawn_agent(agent_type="worker", task_name="...", message="...", fork_turns="none")\` |
|
|
30
30
|
| \`background_output(task_id="...")\` | \`wait_agent(...)\` to wait for subagent completion and mailbox updates |
|
|
31
31
|
| \`team_*(...)\` | Use Codex native subagents plus \`send_message\`, \`followup_task\`, \`wait_agent\`, and \`close_agent\` |
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
Codex full-history forks inherit the parent agent type, model, and reasoning effort, so role-specific spawns with \`agent_type\` must use a non-full-history fork mode such as \`fork_turns="none"\`. Include any required conversation context, files, diffs, constraints, and requested skill names directly in the spawned agent's \`message\`. If a code block below conflicts with this section, this section wins.
|
|
34
34
|
|
|
35
35
|
`;
|
|
36
36
|
|
|
@@ -8,15 +8,15 @@ This skill may include examples copied from the OpenCode harness. In Codex, do n
|
|
|
8
8
|
|
|
9
9
|
| OpenCode example | Codex tool to use |
|
|
10
10
|
| --- | --- |
|
|
11
|
-
| `call_omo_agent(subagent_type="explore", ...)` | `spawn_agent(agent_type="explorer", task_name="...", message="...")` |
|
|
12
|
-
| `call_omo_agent(subagent_type="librarian", ...)` | `spawn_agent(agent_type="librarian", task_name="...", message="...")` |
|
|
13
|
-
| `task(subagent_type="plan", ...)` | `spawn_agent(agent_type="plan", task_name="...", message="...")` |
|
|
14
|
-
| `task(subagent_type="oracle", ...)` for final verification | `spawn_agent(agent_type="codex-ultrawork-reviewer", task_name="...", message="...")` |
|
|
15
|
-
| `task(category="...", ...)` for implementation or QA | `spawn_agent(agent_type="worker", task_name="...", message="...")` |
|
|
11
|
+
| `call_omo_agent(subagent_type="explore", ...)` | `spawn_agent(agent_type="explorer", task_name="...", message="...", fork_turns="none")` |
|
|
12
|
+
| `call_omo_agent(subagent_type="librarian", ...)` | `spawn_agent(agent_type="librarian", task_name="...", message="...", fork_turns="none")` |
|
|
13
|
+
| `task(subagent_type="plan", ...)` | `spawn_agent(agent_type="plan", task_name="...", message="...", fork_turns="none")` |
|
|
14
|
+
| `task(subagent_type="oracle", ...)` for final verification | `spawn_agent(agent_type="codex-ultrawork-reviewer", task_name="...", message="...", fork_turns="none")` |
|
|
15
|
+
| `task(category="...", ...)` for implementation or QA | `spawn_agent(agent_type="worker", task_name="...", message="...", fork_turns="none")` |
|
|
16
16
|
| `background_output(task_id="...")` | `wait_agent(...)` to wait for subagent completion and mailbox updates |
|
|
17
17
|
| `team_*(...)` | Use Codex native subagents plus `send_message`, `followup_task`, `wait_agent`, and `close_agent` |
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Codex full-history forks inherit the parent agent type, model, and reasoning effort, so role-specific spawns with `agent_type` must use a non-full-history fork mode such as `fork_turns="none"`. Include any required conversation context, files, diffs, constraints, and requested skill names directly in the spawned agent's `message`. If a code block below conflicts with this section, this section wins.
|
|
20
20
|
|
|
21
21
|
# /init-deep
|
|
22
22
|
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lcx-report-bug
|
|
3
|
+
description: "Create a high-signal LazyCodex bug report for code-yeongyu/lazycodex. Use this whenever the user asks to report, file, open, or triage a LazyCodex, lazycodex-ai, omo-codex, or Codex plugin bug, especially when they need root cause, reproduction steps, expected fix guidance, and a GitHub issue."
|
|
4
|
+
metadata:
|
|
5
|
+
short-description: Report LazyCodex bugs with debugging evidence
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# lcx-report-bug
|
|
9
|
+
|
|
10
|
+
You are a LazyCodex bug reporter. Produce one useful GitHub issue in English for `code-yeongyu/lazycodex`, backed by runtime evidence rather than guesses.
|
|
11
|
+
|
|
12
|
+
Use GPT-5.5 style: outcome first, concise, evidence-bound. Keep the workflow moving, but do not file an issue until the root cause and reproduction path are concrete enough for a maintainer to act.
|
|
13
|
+
|
|
14
|
+
## Goal
|
|
15
|
+
|
|
16
|
+
Create or prepare a GitHub issue that includes:
|
|
17
|
+
|
|
18
|
+
- clear title
|
|
19
|
+
- environment
|
|
20
|
+
- reproducible steps
|
|
21
|
+
- expected behavior
|
|
22
|
+
- actual behavior
|
|
23
|
+
- confirmed or strongly evidenced root cause
|
|
24
|
+
- fix approach, including files or components likely involved
|
|
25
|
+
- verification plan
|
|
26
|
+
|
|
27
|
+
## Required Workflow
|
|
28
|
+
|
|
29
|
+
1. Read the user's bug report and identify the affected surface: LazyCodex installer, Codex plugin, skill, hook, MCP, CLI alias, GitHub marketplace sync, or web/docs.
|
|
30
|
+
2. Invoke `$omo:debugging` for the investigation. If Codex exposes only unqualified skill names in the current session, invoke `$debugging` and state that it is the OMO debugging skill.
|
|
31
|
+
3. Follow the debugging skill far enough to gather runtime evidence:
|
|
32
|
+
- form at least three plausible hypotheses
|
|
33
|
+
- run the smallest reproduction that exercises the real surface
|
|
34
|
+
- confirm the root cause by observing the failing state
|
|
35
|
+
- identify the minimal fix path or maintainer action
|
|
36
|
+
4. Search for an existing issue before creating a new one:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
gh issue list --repo code-yeongyu/lazycodex --search "<short error or symptom>" --state open
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
5. If a matching open issue exists, add a comment with the new evidence instead of creating a duplicate.
|
|
43
|
+
6. If no matching issue exists, create the issue with `gh`.
|
|
44
|
+
|
|
45
|
+
## Issue Body Template
|
|
46
|
+
|
|
47
|
+
Write the issue body in English and keep it direct:
|
|
48
|
+
|
|
49
|
+
```markdown
|
|
50
|
+
## Summary
|
|
51
|
+
[One or two sentences describing the user-visible failure.]
|
|
52
|
+
|
|
53
|
+
## Environment
|
|
54
|
+
- LazyCodex version:
|
|
55
|
+
- Codex version:
|
|
56
|
+
- OS:
|
|
57
|
+
- Install method:
|
|
58
|
+
- Relevant config:
|
|
59
|
+
|
|
60
|
+
## Reproduction
|
|
61
|
+
1. [Exact command or UI action]
|
|
62
|
+
2. [Exact next step]
|
|
63
|
+
3. [Observed failure trigger]
|
|
64
|
+
|
|
65
|
+
## Expected Behavior
|
|
66
|
+
[What should have happened.]
|
|
67
|
+
|
|
68
|
+
## Actual Behavior
|
|
69
|
+
[What happened instead, including exact error text or output.]
|
|
70
|
+
|
|
71
|
+
## Evidence
|
|
72
|
+
[Commands, logs, screenshots, traces, or links used to confirm the failure.]
|
|
73
|
+
|
|
74
|
+
## Root Cause
|
|
75
|
+
[Confirmed cause. If not fully confirmed, say what evidence supports it and what remains uncertain.]
|
|
76
|
+
|
|
77
|
+
## Proposed Fix
|
|
78
|
+
[Concrete implementation or operational fix. Include likely files, components, or commands.]
|
|
79
|
+
|
|
80
|
+
## Verification Plan
|
|
81
|
+
- [Check that reproduces the original failure]
|
|
82
|
+
- [Check that proves the fix]
|
|
83
|
+
- [Regression check for adjacent LazyCodex/Codex plugin behavior]
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## GitHub Creation Path
|
|
87
|
+
|
|
88
|
+
Prefer `gh`:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
ISSUE_BODY="/tmp/lcx-report-bug-$(date +%Y%m%d-%H%M%S).md"
|
|
92
|
+
$EDITOR "$ISSUE_BODY"
|
|
93
|
+
gh issue create --repo code-yeongyu/lazycodex --title "<clear title>" --body-file "$ISSUE_BODY"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
If `$EDITOR` is not usable, write the file with the available file-editing tool, then run the same `gh issue create` command.
|
|
97
|
+
|
|
98
|
+
After creating or commenting, return the issue URL and a short summary of the evidence used.
|
|
99
|
+
|
|
100
|
+
## Browser use fallback
|
|
101
|
+
|
|
102
|
+
If `gh` is unavailable, unauthenticated, or blocked, use Browser Use against the real GitHub page:
|
|
103
|
+
|
|
104
|
+
1. Open `https://github.com/code-yeongyu/lazycodex/issues/new`.
|
|
105
|
+
2. Fill the title and body from the template.
|
|
106
|
+
3. Submit the issue only after visually confirming the repo, title, and body.
|
|
107
|
+
4. Capture the resulting issue URL.
|
|
108
|
+
|
|
109
|
+
## Computer use fallback
|
|
110
|
+
|
|
111
|
+
If Browser Use is unavailable but a desktop browser is open and authenticated, use Computer Use:
|
|
112
|
+
|
|
113
|
+
1. Navigate to `https://github.com/code-yeongyu/lazycodex/issues/new`.
|
|
114
|
+
2. Fill the title and body.
|
|
115
|
+
3. Verify the target repository and final text before submission.
|
|
116
|
+
4. Submit and capture the issue URL.
|
|
117
|
+
|
|
118
|
+
## Stop Conditions
|
|
119
|
+
|
|
120
|
+
Stop and ask one narrow question only when the missing fact changes the issue materially, such as the affected version, a private log the agent cannot access, or whether the user wants a duplicate filed despite an existing matching issue.
|
|
121
|
+
|
|
122
|
+
Do not file:
|
|
123
|
+
|
|
124
|
+
- a vague issue without reproduction steps
|
|
125
|
+
- an issue that claims a root cause not supported by runtime evidence
|
|
126
|
+
- a duplicate when commenting on an existing issue is enough
|
|
127
|
+
- a fix PR unless the user separately asks for one
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "lcx-report-bug (omo)"
|
|
3
|
+
short_description: "Report LazyCodex bugs with debugging evidence"
|
|
4
|
+
search_terms:
|
|
5
|
+
- "lcx-report-bug"
|
|
6
|
+
- "lazycodex bug"
|
|
7
|
+
- "lazycodex issue"
|
|
8
|
+
- "omo-codex bug"
|
|
9
|
+
default_prompt: "Use $lcx-report-bug to investigate this LazyCodex bug and file a clear issue with reproduction, root cause, and fix guidance."
|
|
@@ -9,15 +9,15 @@ This skill may include examples copied from the OpenCode harness. In Codex, do n
|
|
|
9
9
|
|
|
10
10
|
| OpenCode example | Codex tool to use |
|
|
11
11
|
| --- | --- |
|
|
12
|
-
| `call_omo_agent(subagent_type="explore", ...)` | `spawn_agent(agent_type="explorer", task_name="...", message="...")` |
|
|
13
|
-
| `call_omo_agent(subagent_type="librarian", ...)` | `spawn_agent(agent_type="librarian", task_name="...", message="...")` |
|
|
14
|
-
| `task(subagent_type="plan", ...)` | `spawn_agent(agent_type="plan", task_name="...", message="...")` |
|
|
15
|
-
| `task(subagent_type="oracle", ...)` for final verification | `spawn_agent(agent_type="codex-ultrawork-reviewer", task_name="...", message="...")` |
|
|
16
|
-
| `task(category="...", ...)` for implementation or QA | `spawn_agent(agent_type="worker", task_name="...", message="...")` |
|
|
12
|
+
| `call_omo_agent(subagent_type="explore", ...)` | `spawn_agent(agent_type="explorer", task_name="...", message="...", fork_turns="none")` |
|
|
13
|
+
| `call_omo_agent(subagent_type="librarian", ...)` | `spawn_agent(agent_type="librarian", task_name="...", message="...", fork_turns="none")` |
|
|
14
|
+
| `task(subagent_type="plan", ...)` | `spawn_agent(agent_type="plan", task_name="...", message="...", fork_turns="none")` |
|
|
15
|
+
| `task(subagent_type="oracle", ...)` for final verification | `spawn_agent(agent_type="codex-ultrawork-reviewer", task_name="...", message="...", fork_turns="none")` |
|
|
16
|
+
| `task(category="...", ...)` for implementation or QA | `spawn_agent(agent_type="worker", task_name="...", message="...", fork_turns="none")` |
|
|
17
17
|
| `background_output(task_id="...")` | `wait_agent(...)` to wait for subagent completion and mailbox updates |
|
|
18
18
|
| `team_*(...)` | Use Codex native subagents plus `send_message`, `followup_task`, `wait_agent`, and `close_agent` |
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
Codex full-history forks inherit the parent agent type, model, and reasoning effort, so role-specific spawns with `agent_type` must use a non-full-history fork mode such as `fork_turns="none"`. Include any required conversation context, files, diffs, constraints, and requested skill names directly in the spawned agent's `message`. If a code block below conflicts with this section, this section wins.
|
|
21
21
|
|
|
22
22
|
export const REFACTOR_TEMPLATE = `# Intelligent Refactor Command
|
|
23
23
|
|
|
@@ -9,15 +9,15 @@ This skill may include examples copied from the OpenCode harness. In Codex, do n
|
|
|
9
9
|
|
|
10
10
|
| OpenCode example | Codex tool to use |
|
|
11
11
|
| --- | --- |
|
|
12
|
-
| `call_omo_agent(subagent_type="explore", ...)` | `spawn_agent(agent_type="explorer", task_name="...", message="...")` |
|
|
13
|
-
| `call_omo_agent(subagent_type="librarian", ...)` | `spawn_agent(agent_type="librarian", task_name="...", message="...")` |
|
|
14
|
-
| `task(subagent_type="plan", ...)` | `spawn_agent(agent_type="plan", task_name="...", message="...")` |
|
|
15
|
-
| `task(subagent_type="oracle", ...)` for final verification | `spawn_agent(agent_type="codex-ultrawork-reviewer", task_name="...", message="...")` |
|
|
16
|
-
| `task(category="...", ...)` for implementation or QA | `spawn_agent(agent_type="worker", task_name="...", message="...")` |
|
|
12
|
+
| `call_omo_agent(subagent_type="explore", ...)` | `spawn_agent(agent_type="explorer", task_name="...", message="...", fork_turns="none")` |
|
|
13
|
+
| `call_omo_agent(subagent_type="librarian", ...)` | `spawn_agent(agent_type="librarian", task_name="...", message="...", fork_turns="none")` |
|
|
14
|
+
| `task(subagent_type="plan", ...)` | `spawn_agent(agent_type="plan", task_name="...", message="...", fork_turns="none")` |
|
|
15
|
+
| `task(subagent_type="oracle", ...)` for final verification | `spawn_agent(agent_type="codex-ultrawork-reviewer", task_name="...", message="...", fork_turns="none")` |
|
|
16
|
+
| `task(category="...", ...)` for implementation or QA | `spawn_agent(agent_type="worker", task_name="...", message="...", fork_turns="none")` |
|
|
17
17
|
| `background_output(task_id="...")` | `wait_agent(...)` to wait for subagent completion and mailbox updates |
|
|
18
18
|
| `team_*(...)` | Use Codex native subagents plus `send_message`, `followup_task`, `wait_agent`, and `close_agent` |
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
Codex full-history forks inherit the parent agent type, model, and reasoning effort, so role-specific spawns with `agent_type` must use a non-full-history fork mode such as `fork_turns="none"`. Include any required conversation context, files, diffs, constraints, and requested skill names directly in the spawned agent's `message`. If a code block below conflicts with this section, this section wins.
|
|
21
21
|
|
|
22
22
|
# Remove AI Slops Skill
|
|
23
23
|
|
|
@@ -8,15 +8,35 @@ This skill may include examples copied from the OpenCode harness. In Codex, do n
|
|
|
8
8
|
|
|
9
9
|
| OpenCode example | Codex tool to use |
|
|
10
10
|
| --- | --- |
|
|
11
|
-
| `call_omo_agent(subagent_type="explore", ...)` | `spawn_agent(agent_type="explorer", task_name="...", message="...")` |
|
|
12
|
-
| `call_omo_agent(subagent_type="librarian", ...)` | `spawn_agent(agent_type="librarian", task_name="...", message="...")` |
|
|
13
|
-
| `task(subagent_type="plan", ...)` | `spawn_agent(agent_type="plan", task_name="...", message="...")` |
|
|
14
|
-
| `task(subagent_type="oracle", ...)` for final verification | `spawn_agent(agent_type="codex-ultrawork-reviewer", task_name="...", message="...")` |
|
|
15
|
-
| `task(category="...", ...)` for implementation or QA | `spawn_agent(agent_type="worker", task_name="...", message="...")` |
|
|
11
|
+
| `call_omo_agent(subagent_type="explore", ...)` | `spawn_agent(agent_type="explorer", task_name="...", message="...", fork_turns="none")` |
|
|
12
|
+
| `call_omo_agent(subagent_type="librarian", ...)` | `spawn_agent(agent_type="librarian", task_name="...", message="...", fork_turns="none")` |
|
|
13
|
+
| `task(subagent_type="plan", ...)` | `spawn_agent(agent_type="plan", task_name="...", message="...", fork_turns="none")` |
|
|
14
|
+
| `task(subagent_type="oracle", ...)` for final verification | `spawn_agent(agent_type="codex-ultrawork-reviewer", task_name="...", message="...", fork_turns="none")` |
|
|
15
|
+
| `task(category="...", ...)` for implementation or QA | `spawn_agent(agent_type="worker", task_name="...", message="...", fork_turns="none")` |
|
|
16
16
|
| `background_output(task_id="...")` | `wait_agent(...)` to wait for subagent completion and mailbox updates |
|
|
17
17
|
| `team_*(...)` | Use Codex native subagents plus `send_message`, `followup_task`, `wait_agent`, and `close_agent` |
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Codex full-history forks inherit the parent agent type, model, and reasoning effort, so role-specific spawns with `agent_type` must use a non-full-history fork mode such as `fork_turns="none"`. Include any required conversation context, files, diffs, constraints, and requested skill names directly in the spawned agent's `message`. If a code block below conflicts with this section, this section wins.
|
|
20
|
+
|
|
21
|
+
## Codex Subagent Reliability
|
|
22
|
+
|
|
23
|
+
Every `spawn_agent` message must be self-contained. Start with
|
|
24
|
+
`TASK: <imperative assignment>`, then name `DELIVERABLE`, `SCOPE`, and
|
|
25
|
+
`VERIFY`. State that it is an executable assignment, not a context
|
|
26
|
+
handoff. Role selection requires `agent_type`; `model` +
|
|
27
|
+
`reasoning_effort` alone creates a default agent, not a reviewer or
|
|
28
|
+
worker. Prefer `fork_turns: "none"` unless full history is truly
|
|
29
|
+
required; paste only the review context that worker needs.
|
|
30
|
+
|
|
31
|
+
Plan and reviewer agents may run for a long time; spawn them in the background, keep doing independent root work, and poll with short wait_agent cycles. Never use a single long blocking wait for them. While any child is active, keep the parent visibly alive with brief status updates that include active subagent count, agent names, last heartbeat, and whether the parent is waiting for mailbox updates.
|
|
32
|
+
|
|
33
|
+
Use `wait_agent` for completion signals, but treat `wait_agent` as a
|
|
34
|
+
mailbox signal, not proof of completion, content, or errors. After two
|
|
35
|
+
waits with no substantive result, send one targeted followup:
|
|
36
|
+
`TASK STILL ACTIVE: return <deliverable> or BLOCKED: <reason>`. If the
|
|
37
|
+
child stays silent or ack-only, mark that review lane inconclusive, do
|
|
38
|
+
not count it as PASS or approval, close if safe, and respawn a smaller
|
|
39
|
+
`fork_turns: "none"` reviewer with the missing deliverable.
|
|
20
40
|
|
|
21
41
|
# Review Work - 5-Agent Parallel Review Orchestrator
|
|
22
42
|
|
|
@@ -493,9 +513,12 @@ OUTPUT FORMAT:
|
|
|
493
513
|
|
|
494
514
|
## Phase 2: Wait & Collect
|
|
495
515
|
|
|
496
|
-
After launching all 5 agents in one turn,
|
|
516
|
+
After launching all 5 agents in one turn, wait for completions in bounded
|
|
517
|
+
cycles. Do not treat a timeout, ack-only reply, or empty child result as
|
|
518
|
+
a PASS.
|
|
497
519
|
|
|
498
|
-
As each completes, collect via
|
|
520
|
+
As each completes, collect via the Codex mapping above (`wait_agent`,
|
|
521
|
+
then the child's substantive final result). Store each verdict:
|
|
499
522
|
|
|
500
523
|
| Agent | Verdict | Notes |
|
|
501
524
|
|-------|---------|-------|
|
|
@@ -506,6 +529,8 @@ As each completes, collect via `background_output(task_id="bg_...")`. Store each
|
|
|
506
529
|
| 5. Context Mining | pending | - |
|
|
507
530
|
|
|
508
531
|
Do NOT deliver the final report until ALL 5 have completed.
|
|
532
|
+
If a lane remains silent after the reliability followup, record it as
|
|
533
|
+
inconclusive and respawn a smaller reviewer/worker for that exact lane.
|
|
509
534
|
|
|
510
535
|
---
|
|
511
536
|
|