oh-my-opencode 4.16.2 → 4.16.3
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/pre-publish-review/SKILL.md +3 -0
- package/README.md +2 -2
- package/dist/agents/hephaestus/agent.d.ts +1 -1
- package/dist/agents/hephaestus/gpt-5-6.d.ts +2 -0
- package/dist/agents/momus-gpt-5-6.d.ts +1 -0
- package/dist/agents/types.d.ts +2 -0
- package/dist/cli/index.js +800 -536
- package/dist/cli-node/index.js +800 -536
- package/dist/features/background-agent/error-classifier.d.ts +5 -0
- package/dist/features/builtin-commands/templates/refactor-sections/intro-and-analysis.d.ts +1 -1
- package/dist/features/builtin-commands/templates/remove-ai-slops.d.ts +1 -1
- package/dist/index.js +416 -37
- package/dist/shared/live-server-route.d.ts +1 -1
- package/dist/skills/review-work/SKILL.md +1 -1
- package/dist/skills/ulw-plan/references/full-workflow.md +1 -1
- package/dist/skills/ulw-research/SKILL.md +2 -2
- package/dist/skills/visual-qa/SKILL.md +1 -1
- package/dist/tui.js +125 -13
- package/package.json +13 -13
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +398 -246
- package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
- package/packages/omo-codex/plugin/components/codegraph/package.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/bundled-rules/hephaestus/gpt-5.6.md +93 -0
- package/packages/omo-codex/plugin/components/rules/dist/cli.js +43 -24
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/src/codex-hook.ts +2 -1
- package/packages/omo-codex/plugin/components/rules/src/dynamic-target-fingerprints.ts +15 -6
- package/packages/omo-codex/plugin/components/rules/src/rules-engine-factory.ts +7 -2
- package/packages/omo-codex/plugin/components/rules/src/static-injection.ts +2 -2
- package/packages/omo-codex/plugin/components/rules/test/codex-hook.test.ts +32 -0
- package/packages/omo-codex/plugin/components/rules/test/hephaestus-model-variant.test.ts +106 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/AGENTS.md +12 -9
- package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/skills/teammode/SKILL.md +136 -76
- package/packages/omo-codex/plugin/components/teammode/skills/teammode/scripts/team-guide.mjs +94 -23
- package/packages/omo-codex/plugin/components/teammode/skills/teammode/scripts/team-state.mjs +94 -14
- package/packages/omo-codex/plugin/components/teammode/skills/teammode/scripts/team-transport.mjs +55 -0
- package/packages/omo-codex/plugin/components/teammode/skills/teammode/scripts/team.mjs +72 -18
- package/packages/omo-codex/plugin/components/teammode/test/thread-title-hook.test.ts +23 -0
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/explorer.toml +24 -41
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-clone-fidelity-reviewer.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-code-reviewer.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-executor.toml +2 -2
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-gate-reviewer.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-qa-executor.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/librarian.toml +21 -49
- package/packages/omo-codex/plugin/components/ultrawork/agents/metis.toml +17 -29
- package/packages/omo-codex/plugin/components/ultrawork/agents/momus.toml +20 -50
- package/packages/omo-codex/plugin/components/ultrawork/agents/plan.toml +18 -39
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-start-work-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-checking-start-work-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/package-lock.json +13 -13
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/scripts/auto-update.mjs +9 -2
- package/packages/omo-codex/plugin/scripts/entry-guard.mjs +26 -0
- package/packages/omo-codex/plugin/scripts/materialize-shared-upstreams.mjs +3 -1
- package/packages/omo-codex/plugin/scripts/migrate-codex-config/multi-agent-v2-guard.mjs +39 -4
- package/packages/omo-codex/plugin/scripts/migrate-codex-config/subagent-limit-guard.mjs +24 -4
- package/packages/omo-codex/plugin/scripts/migrate-codex-config.mjs +3 -3
- package/packages/omo-codex/plugin/scripts/migrate-omo-sot.mjs +2 -2
- package/packages/omo-codex/plugin/scripts/sync-hook-status-messages.mjs +2 -2
- package/packages/omo-codex/plugin/scripts/sync-skills.mjs +6 -4
- package/packages/omo-codex/plugin/scripts/sync-version.mjs +4 -2
- package/packages/omo-codex/plugin/skills/init-deep/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/refactor/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/remove-ai-slops/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/review-work/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/start-work/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/teammode/SKILL.md +136 -76
- package/packages/omo-codex/plugin/skills/teammode/scripts/team-guide.mjs +94 -23
- package/packages/omo-codex/plugin/skills/teammode/scripts/team-state.mjs +94 -14
- package/packages/omo-codex/plugin/skills/teammode/scripts/team-transport.mjs +55 -0
- package/packages/omo-codex/plugin/skills/teammode/scripts/team.mjs +72 -18
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +1 -1
- package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +1 -1
- package/packages/omo-codex/plugin/skills/ulw-research/SKILL.md +2 -2
- package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +2 -2
- package/packages/omo-codex/plugin/test/aggregate-agents.test.mjs +47 -1
- package/packages/omo-codex/plugin/test/aggregate-skills.test.mjs +4 -2
- package/packages/omo-codex/plugin/test/auto-update-restart-notice.test.mjs +33 -0
- package/packages/omo-codex/plugin/test/migrate-codex-config.test.mjs +146 -9
- package/packages/omo-codex/plugin/test/multi-agent-v2-regression.test.mjs +71 -0
- package/packages/omo-codex/plugin/test/subagent-limit-migration.test.mjs +32 -0
- package/packages/omo-codex/plugin/test/sync-skills-orchestration.test.mjs +9 -2
- package/packages/omo-codex/plugin/test/teammode-transport.test.mjs +345 -0
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +436 -284
- package/packages/omo-codex/scripts/install-generated-bundle.test.mjs +111 -1
- package/packages/shared-skills/skills/review-work/SKILL.md +1 -1
- package/packages/shared-skills/skills/ulw-plan/references/full-workflow.md +1 -1
- package/packages/shared-skills/skills/ulw-research/SKILL.md +2 -2
- package/packages/shared-skills/skills/visual-qa/SKILL.md +1 -1
- /package/packages/omo-codex/plugin/components/rules/bundled-rules/{hephaestus.md → hephaestus/gpt-5.5.md} +0 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { tmpdir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { afterEach, describe, expect, it } from "vitest";
|
|
5
|
+
|
|
6
|
+
import { type CodexSessionStartInput, runSessionStartHook } from "../src/codex-hook.js";
|
|
7
|
+
import { findPluginBundledCandidates } from "@oh-my-opencode/rules-engine/engine";
|
|
8
|
+
|
|
9
|
+
const GPT_55_VARIANT_PATH = "bundled-rules/hephaestus/gpt-5.5.md";
|
|
10
|
+
const GPT_56_VARIANT_PATH = "bundled-rules/hephaestus/gpt-5.6.md";
|
|
11
|
+
const BUNDLED_ONLY_ENV = {
|
|
12
|
+
CODEX_RULES_ENABLED_SOURCES: "plugin-bundled",
|
|
13
|
+
};
|
|
14
|
+
const tempDirectories: string[] = [];
|
|
15
|
+
let originalPluginRoot: string | undefined;
|
|
16
|
+
|
|
17
|
+
afterEach(() => {
|
|
18
|
+
restoreEnv("PLUGIN_ROOT", originalPluginRoot);
|
|
19
|
+
for (const directory of tempDirectories.splice(0)) {
|
|
20
|
+
rmSync(directory, { recursive: true, force: true });
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
function makeProject(): { readonly root: string; readonly pluginData: string } {
|
|
25
|
+
originalPluginRoot = process.env["PLUGIN_ROOT"];
|
|
26
|
+
process.env["PLUGIN_ROOT"] = process.cwd();
|
|
27
|
+
const root = mkdtempSync(join(tmpdir(), "codex-rules-hephaestus-variant-project-"));
|
|
28
|
+
const pluginData = mkdtempSync(join(tmpdir(), "codex-rules-hephaestus-variant-data-"));
|
|
29
|
+
tempDirectories.push(root, pluginData);
|
|
30
|
+
writeFileSync(join(root, "package.json"), JSON.stringify({ name: "fixture" }));
|
|
31
|
+
return { root, pluginData };
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function sessionStartInput(root: string, model: string): CodexSessionStartInput {
|
|
35
|
+
return {
|
|
36
|
+
session_id: "session-1",
|
|
37
|
+
transcript_path: null,
|
|
38
|
+
cwd: root,
|
|
39
|
+
hook_event_name: "SessionStart",
|
|
40
|
+
model,
|
|
41
|
+
permission_mode: "default",
|
|
42
|
+
source: "startup",
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function restoreEnv(name: string, value: string | undefined): void {
|
|
47
|
+
if (value === undefined) {
|
|
48
|
+
delete process.env[name];
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
process.env[name] = value;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
describe("Hephaestus bundled rule model variants", () => {
|
|
55
|
+
it("#given packaged bundled rules #when discovering with a gpt-5.5 model #then only the gpt-5.5 variant is included", () => {
|
|
56
|
+
const candidates = findPluginBundledCandidates({ pluginRoot: process.cwd(), model: "gpt-5.5" });
|
|
57
|
+
const paths = candidates.map((candidate) => candidate.relativePath);
|
|
58
|
+
|
|
59
|
+
expect(paths).toContain(GPT_55_VARIANT_PATH);
|
|
60
|
+
expect(paths).not.toContain(GPT_56_VARIANT_PATH);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it("#given packaged bundled rules #when discovering with a gpt-5.6 family model #then only the gpt-5.6 variant is included", () => {
|
|
64
|
+
const candidates = findPluginBundledCandidates({ pluginRoot: process.cwd(), model: "gpt-5.6-codex" });
|
|
65
|
+
const paths = candidates.map((candidate) => candidate.relativePath);
|
|
66
|
+
|
|
67
|
+
expect(paths).toContain(GPT_56_VARIANT_PATH);
|
|
68
|
+
expect(paths).not.toContain(GPT_55_VARIANT_PATH);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it("#given packaged bundled rules #when discovering without a model #then the gpt-5.5 variant is the fallback", () => {
|
|
72
|
+
const candidates = findPluginBundledCandidates({ pluginRoot: process.cwd() });
|
|
73
|
+
const paths = candidates.map((candidate) => candidate.relativePath);
|
|
74
|
+
|
|
75
|
+
expect(paths).toContain(GPT_55_VARIANT_PATH);
|
|
76
|
+
expect(paths).not.toContain(GPT_56_VARIANT_PATH);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it("#given a gpt-5.5 session #when SessionStart runs #then the gpt-5.5 identity is injected in full", async () => {
|
|
80
|
+
const { root, pluginData } = makeProject();
|
|
81
|
+
|
|
82
|
+
const output = await runSessionStartHook(sessionStartInput(root, "gpt-5.5"), {
|
|
83
|
+
pluginDataRoot: pluginData,
|
|
84
|
+
env: BUNDLED_ONLY_ENV,
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
expect(output).toContain(`Instructions from: ${join(process.cwd(), GPT_55_VARIANT_PATH)}`);
|
|
88
|
+
expect(output).toContain("based on GPT-5.5");
|
|
89
|
+
expect(output).not.toContain("based on GPT-5.6");
|
|
90
|
+
expect(output).not.toContain("[Truncated. Full:");
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it("#given a gpt-5.6 session #when SessionStart runs #then the gpt-5.6 identity is injected in full", async () => {
|
|
94
|
+
const { root, pluginData } = makeProject();
|
|
95
|
+
|
|
96
|
+
const output = await runSessionStartHook(sessionStartInput(root, "gpt-5.6-codex"), {
|
|
97
|
+
pluginDataRoot: pluginData,
|
|
98
|
+
env: BUNDLED_ONLY_ENV,
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
expect(output).toContain(`Instructions from: ${join(process.cwd(), GPT_56_VARIANT_PATH)}`);
|
|
102
|
+
expect(output).toContain("based on GPT-5.6");
|
|
103
|
+
expect(output).not.toContain("based on GPT-5.5");
|
|
104
|
+
expect(output).not.toContain("[Truncated. Full:");
|
|
105
|
+
});
|
|
106
|
+
});
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"type": "command",
|
|
8
8
|
"command": "node \"${PLUGIN_ROOT}/components/start-work-continuation/dist/cli.js\" hook stop",
|
|
9
9
|
"timeout": 10,
|
|
10
|
-
"statusMessage": "(OmO 4.16.
|
|
10
|
+
"statusMessage": "(OmO 4.16.3) Checking Start-Work Continuation"
|
|
11
11
|
}
|
|
12
12
|
]
|
|
13
13
|
}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"type": "command",
|
|
20
20
|
"command": "node \"${PLUGIN_ROOT}/components/start-work-continuation/dist/cli.js\" hook subagent-stop",
|
|
21
21
|
"timeout": 10,
|
|
22
|
-
"statusMessage": "(OmO 4.16.
|
|
22
|
+
"statusMessage": "(OmO 4.16.3) Checking Start-Work Continuation"
|
|
23
23
|
}
|
|
24
24
|
]
|
|
25
25
|
}
|
|
@@ -7,18 +7,19 @@
|
|
|
7
7
|
Codex team-mode component. Two deliverables in one dir:
|
|
8
8
|
|
|
9
9
|
- **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.
|
|
10
|
-
- **`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.
|
|
10
|
+
- **`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.
|
|
11
11
|
|
|
12
12
|
## KEY FILES
|
|
13
13
|
|
|
14
14
|
- `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).
|
|
15
15
|
- `src/cli.ts` - argv dispatch; only `hook post-tool-use`.
|
|
16
16
|
- `hooks/hooks.json` - matcher `^(create_thread|codex_app\.create_thread)$`, runs `node ${PLUGIN_ROOT}/dist/cli.js hook post-tool-use`, timeout 10.
|
|
17
|
-
- `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.
|
|
18
|
-
- `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.
|
|
19
|
-
- `skills/teammode/scripts/team-
|
|
17
|
+
- `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.
|
|
18
|
+
- `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.
|
|
19
|
+
- `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.
|
|
20
|
+
- `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).
|
|
20
21
|
- `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.
|
|
21
|
-
- `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
|
|
22
|
+
- `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.
|
|
22
23
|
- `test/thread-title-hook.test.ts` - hook unit tests (vitest-style imports, run via `bun test`).
|
|
23
24
|
|
|
24
25
|
## WHERE TO LOOK
|
|
@@ -26,8 +27,9 @@ Codex team-mode component. Two deliverables in one dir:
|
|
|
26
27
|
| Task | Location |
|
|
27
28
|
|------|----------|
|
|
28
29
|
| 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 |
|
|
29
|
-
| Skill protocol text | `skills/teammode/SKILL.md`; contract tests `plugin/test/teammode-{communication,worktree,safety,archive-ambiguity,thread-links}.test.mjs` pin phrases |
|
|
30
|
-
| team.json shape | `team-state.mjs` (single source of the shape; `validateTeam`
|
|
30
|
+
| Skill protocol text | `skills/teammode/SKILL.md`; contract tests `plugin/test/teammode-{transport,communication,worktree,safety,archive-ambiguity,thread-links}.test.mjs` pin phrases |
|
|
31
|
+
| team.json shape | `team-state.mjs` (single source of the shape; `validateTeam` migrates schemaVersion 2 to 3 and rejects anything else) |
|
|
32
|
+
| Transport rules | `team-transport.mjs` (`parseTeamTransport`, `parseTaskName`, `assertTransport`) + `plugin/test/teammode-transport.test.mjs` |
|
|
31
33
|
| Branch naming, worktree paths, merge | `team-worktree.mjs` (`team/<sessionId>/<memberId>` branches, worktrees confined to `<team dir>/worktrees/<memberId>`) |
|
|
32
34
|
| Hook wiring | `hooks/hooks.json` (component) + `plugin/hooks/post-tool-use-checking-thread-title-hygiene.json` (aggregate; adds `commandWindows` powershell node-dispatch) |
|
|
33
35
|
|
|
@@ -40,7 +42,8 @@ Codex team-mode component. Two deliverables in one dir:
|
|
|
40
42
|
- 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.
|
|
41
43
|
- 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.
|
|
42
44
|
- `integrate` lands member branches with merge commits only (`--no-ff`); never squash or rebase.
|
|
43
|
-
- `bind-thread`
|
|
44
|
-
-
|
|
45
|
+
- `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.
|
|
46
|
+
- 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>`.
|
|
47
|
+
- 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.
|
|
45
48
|
- The hook must stay silent (empty stdout) on unrelated tools and malformed payloads; it never blocks a Codex turn.
|
|
46
49
|
- `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.
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: teammode
|
|
3
|
-
description: "Codex-only team orchestration: run a named team of cooperating Codex
|
|
3
|
+
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."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Teammode
|
|
7
7
|
|
|
8
|
-
Run a named team of cooperating Codex
|
|
9
|
-
This is a Codex-only workflow. It
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
Run a named team of cooperating Codex workers under one leader, with durable state on disk.
|
|
9
|
+
This is a Codex-only workflow. It never depends on an external terminal runner - it
|
|
10
|
+
coordinates through Codex's own collaboration tools plus a bundled state script, on ONE of
|
|
11
|
+
two transports chosen up front: native MultiAgentV2 agents, or Codex App threads as the
|
|
12
|
+
fallback.
|
|
13
13
|
|
|
14
14
|
## When to use a team (and when to use plain subagents instead)
|
|
15
15
|
|
|
@@ -19,17 +19,43 @@ Use a TEAM when EITHER holds:
|
|
|
19
19
|
- one task still needs exploration, yet its GOAL is already clear - parallel investigation under
|
|
20
20
|
a fixed objective.
|
|
21
21
|
|
|
22
|
-
Use plain subagents (`$ulw` /
|
|
22
|
+
Use plain fire-and-forget subagents (`$ulw` / one-off `spawn_agent` workers) - NOT a team - when
|
|
23
|
+
EITHER holds:
|
|
23
24
|
- the work IS perfectly isolated, so there is no coordination cost worth paying; or
|
|
24
25
|
- the GOAL is still ambiguous, where one mind should resolve direction before any fan-out.
|
|
25
26
|
|
|
26
27
|
A team buys cross-member coordination at a real overhead cost; only spend it when coordination
|
|
27
28
|
is the thing you actually need.
|
|
28
29
|
|
|
30
|
+
## Pick the transport FIRST - then tell the user
|
|
31
|
+
|
|
32
|
+
Before creating any team state, decide which transport this session can run.
|
|
33
|
+
Inspect your active tool list and select:
|
|
34
|
+
|
|
35
|
+
1. **MultiAgentV2 (preferred)** - select when the flat V2 collaboration tools are ALL active:
|
|
36
|
+
flat `spawn_agent` whose schema requires `task_name`, plus `send_message`, `followup_task`,
|
|
37
|
+
`wait_agent`, `list_agents`, and `interrupt_agent`. Members are durable native agents
|
|
38
|
+
addressed by task name / agent path (`/root/<task_name>`). The namespaced
|
|
39
|
+
`multi_agent_v1.*` surface never qualifies as a team transport.
|
|
40
|
+
2. **Codex App threads (fallback)** - select when flat V2 is not available but the
|
|
41
|
+
`codex_app.*` thread tools are (`create_thread`, `read_thread`, `send_message_to_thread`,
|
|
42
|
+
`set_thread_title`, `set_thread_archived`).
|
|
43
|
+
3. **Neither complete set available** - STOP before `init`. Tell the user which tools are
|
|
44
|
+
missing; do not fake a team with partial tooling.
|
|
45
|
+
|
|
46
|
+
Then, BEFORE running `init`, tell the user in one line which transport you selected and why,
|
|
47
|
+
e.g. `Teammode transport: MultiAgentV2 (flat spawn_agent with task_name).` or
|
|
48
|
+
`Teammode transport: Codex App threads (flat V2 tools not present in this session).`
|
|
49
|
+
|
|
50
|
+
Pass that choice to `init` as `--transport multi_agent_v2` or `--transport codex_app`. The
|
|
51
|
+
transport is recorded in `team.json` and is IMMUTABLE for the team's lifetime: a V2 spawn
|
|
52
|
+
failure is a V2 blocker to report, never permission to mix Codex App threads into the same
|
|
53
|
+
team. Never probe by trial-calling tools; read your tool list.
|
|
54
|
+
|
|
29
55
|
## You are the leader - orchestrate, do not implement
|
|
30
56
|
|
|
31
57
|
The main session is ALWAYS the team leader; you orchestrate directly and never spin up a separate
|
|
32
|
-
leader
|
|
58
|
+
leader worker. Your job is orchestration, NOT writing product code: split the work and assign each
|
|
33
59
|
slice, hold live situational awareness of every member, verify and QA what they deliver, relay
|
|
34
60
|
findings between members, instruct and unblock, and synthesize the result. DELEGATE every code edit
|
|
35
61
|
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.
|
|
|
39
65
|
## Compose by part, ownership, or perspective - not by job title
|
|
40
66
|
|
|
41
67
|
A team is ALWAYS two or more members - never a single-member team. One worker on an isolated
|
|
42
|
-
job is a
|
|
68
|
+
job is a plain subagent, not a team; if you end up with a single member,
|
|
43
69
|
either split off a second distinct slice or drop the team and use a subagent.
|
|
44
70
|
|
|
45
71
|
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
|
|
|
50
76
|
anti-pattern - it gives the member no real boundary and invites overlap. Each member's `focus`
|
|
51
77
|
names what they own concretely; the `lens` is one of `area`, `ownership`, or `perspective`.
|
|
52
78
|
Give each member a short, distinct `--name` too - its role or what it watches (e.g.
|
|
53
|
-
`app-server-lifecycle`, `mailbox-delivery`) -
|
|
54
|
-
one name for two members.
|
|
79
|
+
`app-server-lifecycle`, `mailbox-delivery`) - it labels the member everywhere; never reuse
|
|
80
|
+
one name for two members. On MultiAgentV2 teams also give each member a unique
|
|
81
|
+
`--task-name` in `lowercase_digits_underscores` form - it becomes the member's permanent
|
|
82
|
+
agent path `/root/<task_name>`.
|
|
55
83
|
|
|
56
84
|
## Run the script - never hand-write team state
|
|
57
85
|
|
|
@@ -60,9 +88,10 @@ the member manual by hand. Run it with `node` (or `bun`); it works on macOS, Lin
|
|
|
60
88
|
Replace `<skill-root>` with this skill's own directory.
|
|
61
89
|
|
|
62
90
|
```
|
|
63
|
-
node "<skill-root>/scripts/team.mjs" init --name "<team>" --session-name "<session>" [--session <
|
|
64
|
-
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>]
|
|
65
|
-
node "<skill-root>/scripts/team.mjs" bind-
|
|
91
|
+
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]
|
|
92
|
+
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>]
|
|
93
|
+
node "<skill-root>/scripts/team.mjs" bind-agent --team <session_id> --id A --agent-path /root/<task_name> [--cwd <path>] # multi_agent_v2 teams
|
|
94
|
+
node "<skill-root>/scripts/team.mjs" bind-thread --team <session_id> --id A --thread <thread_id> [--cwd <path>] # codex_app teams
|
|
66
95
|
node "<skill-root>/scripts/team.mjs" member-prompt --team <session_id> --id A
|
|
67
96
|
node "<skill-root>/scripts/team.mjs" set-status --team <session_id> --id A --status reported|blocked|active|archived [--note "<...>"]
|
|
68
97
|
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>
|
|
|
74
103
|
```
|
|
75
104
|
|
|
76
105
|
`init` creates `.omo/teams/{session_id}/` containing `team.json` (the single durable state file:
|
|
77
|
-
team id, the main-session leader, the member roster, status, worktree config, and a
|
|
78
|
-
log), `guide.md` (the auto-generated member field manual), and `artifacts/` (a shared
|
|
79
|
-
space). `{session_id}` is the leader's Codex session id when you can
|
|
80
|
-
otherwise the script generates a stable handle. Re-running `init` is a
|
|
81
|
-
subcommand rewrites `guide.md`, so the manual always matches the
|
|
106
|
+
team id, transport, the main-session leader, the member roster, status, worktree config, and a
|
|
107
|
+
lifecycle log), `guide.md` (the auto-generated member field manual), and `artifacts/` (a shared
|
|
108
|
+
exchange space). On codex_app teams `{session_id}` is the leader's Codex session id when you can
|
|
109
|
+
pass it via `--session`; otherwise the script generates a stable handle. Re-running `init` is a
|
|
110
|
+
safe no-op. Every mutating subcommand rewrites `guide.md`, so the manual always matches the
|
|
111
|
+
current team.
|
|
82
112
|
|
|
83
113
|
Mutating subcommands take a per-team state lock before reading and rewriting `team.json`. It is
|
|
84
|
-
safe to run independent `add-member`, `bind-thread`, `set-status`, `archive`,
|
|
85
|
-
and worktree mutation commands concurrently against the same team: they
|
|
86
|
-
reads the latest committed state before writing. If a command reports
|
|
87
|
-
do not treat the intended mutation as complete; retry after the named
|
|
88
|
-
`.omo/teams/{session_id}/.team.lock/owner.json` if the previous
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
`
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
3. `bind-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
4.
|
|
108
|
-
`codex
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
114
|
+
safe to run independent `add-member`, `bind-agent`, `bind-thread`, `set-status`, `archive`,
|
|
115
|
+
`delete`, `guide`, and worktree mutation commands concurrently against the same team: they
|
|
116
|
+
serialize and each command reads the latest committed state before writing. If a command reports
|
|
117
|
+
that team state is locked, do not treat the intended mutation as complete; retry after the named
|
|
118
|
+
command finishes, or inspect `.omo/teams/{session_id}/.team.lock/owner.json` if the previous
|
|
119
|
+
command crashed. `bind-agent` refuses codex_app teams and `bind-thread` refuses multi_agent_v2
|
|
120
|
+
teams, and a refused command never changes `team.json`.
|
|
121
|
+
|
|
122
|
+
## Create the team and its members
|
|
123
|
+
|
|
124
|
+
`init` the team, then `add-member` once per member. What happens next depends on the transport.
|
|
125
|
+
|
|
126
|
+
**MultiAgentV2 teams:**
|
|
127
|
+
1. If a member needs an isolated worktree, run `worktree-add` BEFORE spawning it - flat
|
|
128
|
+
`spawn_agent` has no cwd argument, so the path must ride in the bootstrap message.
|
|
129
|
+
2. Spawn each member with flat `spawn_agent`: `task_name` is that member's `--task-name`,
|
|
130
|
+
`message` is the bootstrap printed by `add-member` / `member-prompt`, and
|
|
131
|
+
`fork_turns: "none"` (members read `guide.md` for context; full parent history is not
|
|
132
|
+
their context model). Do not set `agent_type`, `model`, or `reasoning_effort`.
|
|
133
|
+
3. `bind-agent --agent-path` with the canonical task name the spawn returned (normally
|
|
134
|
+
`/root/<task_name>`); binding confirms the runtime identity matches the roster and records
|
|
135
|
+
the member's cwd. Members are durable: they persist as subagent threads, survive idling,
|
|
136
|
+
and are re-tasked with `followup_task` - never respawned under a second name.
|
|
137
|
+
4. Members appear in `list_agents` with their task paths; inspect status there instead of
|
|
138
|
+
deep links (V2 exposes no thread title or `codex://` link surface to you).
|
|
139
|
+
|
|
140
|
+
**Codex App teams:**
|
|
141
|
+
1. Create a durable thread per member with `codex_app.create_thread` - ALWAYS this tool for
|
|
142
|
+
every member - titled `[team name] <member name>`, using THAT member's own name, so no two
|
|
143
|
+
threads share a title. `add-member` prints the exact title to use. If the tool accepts a
|
|
144
|
+
working directory / cwd argument, set it to that member's worktree; otherwise the member's
|
|
145
|
+
manual tells it to `cd` there first. Use `codex_app.set_thread_title` if the title did not
|
|
146
|
+
land at creation. If Codex returns only `pendingWorktreeId`, the worktree-backed thread is
|
|
147
|
+
not ready yet: do not `bind-thread` and do not send the member bootstrap. Wait until Codex
|
|
148
|
+
surfaces a real `threadId`, then set the title, bind that real id with the cwd, and only
|
|
149
|
+
then send the bootstrap.
|
|
150
|
+
2. `bind-thread` to record each thread id (and `--cwd`), then send that member's bootstrap
|
|
151
|
+
trigger as the thread's first message. The trigger is short on purpose: it tells the new
|
|
152
|
+
thread to READ its `guide.md` and `team.json` rather than carrying the whole protocol inline.
|
|
153
|
+
3. Whenever you report, audit, reopen, or hand off a member thread, include the app deep link
|
|
154
|
+
`codex://threads/<thread_id>` next to the raw id - worktree-backed threads are easy to lose
|
|
155
|
+
in the sidebar without it. On a codex_app team, a spawned in-process agent is never a
|
|
156
|
+
member substitute: it cannot carry the team title or be inspected, titled, archived, or
|
|
157
|
+
re-opened with the `codex_app.*` tools this team runs on.
|
|
158
|
+
|
|
159
|
+
On either transport, a member only counts once it is bound (`bind-agent` / `bind-thread`). If
|
|
160
|
+
the selected transport's tools stop working mid-run, STOP and say so (see Stop rules); do not
|
|
161
|
+
quietly switch transports.
|
|
120
162
|
|
|
121
163
|
## Communication
|
|
122
164
|
|
|
123
|
-
Members push to you and to one another
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
165
|
+
Members push to you and to one another; you never poll them as a routine. The address book is
|
|
166
|
+
`team.json`, and the generated manual binds members to the hard rules, so you mainly keep the
|
|
167
|
+
channel open: expect frequent small inbound updates from each member - findings,
|
|
168
|
+
`WORKING:`/`BLOCKED:` markers, peer digests - rather than one final dump, and act on them as
|
|
169
|
+
they arrive.
|
|
170
|
+
|
|
171
|
+
- **MultiAgentV2:** members reach you with `send_message` to `/root` and reach peers by their
|
|
172
|
+
`members[].agentPath`. You reach members the same way; use `followup_task` when you hand an
|
|
173
|
+
idle member NEW work (it wakes the member), `send_message` for context that should not
|
|
174
|
+
interrupt, and `wait_agent` only when you are genuinely blocked on their next update - a
|
|
175
|
+
`wait_agent` timeout only means no new mailbox update arrived, never that a member failed.
|
|
176
|
+
Your own session IS `/root` - members can always reach you; leave `--session` unset.
|
|
177
|
+
- **Codex App:** members push with `codex_app.send_message_to_thread`; you inspect state with
|
|
178
|
+
`codex_app.read_thread`. So members can actually reach you, run `init` with
|
|
179
|
+
`--session <your own thread id>` - that makes `leader.sessionId` in team.json a real,
|
|
180
|
+
messageable thread; without it members cannot report to you and you are stuck polling.
|
|
181
|
+
|
|
182
|
+
All member-to-member and member-to-leader traffic is in English; when the END user addresses a
|
|
183
|
+
member, that member replies in the user's own language. Members hand off files and memos
|
|
184
|
+
through the team `artifacts/` directory and reference them by path.
|
|
132
185
|
|
|
133
186
|
## Let members work - do not rush them
|
|
134
187
|
|
|
135
188
|
Members heartbeat every few tool calls and message you on every finding, blocker, and finished
|
|
136
189
|
slice (their manual binds them to this). So a member that is quiet between heartbeats is **working,
|
|
137
190
|
not stalled** - a stretch of silence is the normal sound of focused work, not a problem to chase.
|
|
138
|
-
Re-reading
|
|
139
|
-
|
|
140
|
-
let them cook.
|
|
191
|
+
Re-reading a calm member's state, or sending "any update?" / "are you done?" / "hurry up" pings,
|
|
192
|
+
interrupts that member and slows the whole team. Trust the heartbeat and let them cook.
|
|
141
193
|
|
|
142
194
|
Message a member only when one of these is true:
|
|
143
195
|
- 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:
|
|
|
147
199
|
then send one specific question, not a barrage.
|
|
148
200
|
|
|
149
201
|
Otherwise stay calm and keep the channel open: read inbound updates as they arrive and act on them.
|
|
150
|
-
A long-running member is alive; a heartbeat you have not received yet is not a failure.
|
|
202
|
+
A long-running member is alive; a heartbeat you have not received yet is not a failure. Fallback only when
|
|
203
|
+
a member is completed without its deliverable, explicitly `BLOCKED:`, or no longer running - then
|
|
204
|
+
unblock, reassign, or re-task that slice instead of waiting on it. Wait for
|
|
151
205
|
every required member's final report before you declare the team done - rushing toward "done" while
|
|
152
206
|
members are still mid-slice just produces half-built work you will have to redo.
|
|
153
207
|
|
|
@@ -162,10 +216,12 @@ its own worktree. To land the work, `integrate --team <id>` merges every member
|
|
|
162
216
|
current branch with a merge commit (never a squash or rebase); resolve any conflict it reports, then
|
|
163
217
|
`worktree-remove` each worktree at cleanup.
|
|
164
218
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
`
|
|
219
|
+
Delivering the path differs by transport: on MultiAgentV2, create the worktree BEFORE spawning
|
|
220
|
+
so the bootstrap carries it, or send it to an already-running member as a `followup_task`; on
|
|
221
|
+
Codex App, send a follow-up message that includes both the worktree path and the member's
|
|
222
|
+
`codex://threads/<thread_id>` link. Either way, run `bind-agent`/`bind-thread` with
|
|
223
|
+
`--cwd <worktree>` (or `--worktree-path`) so `team.json`, `guide.md`, `status`, and
|
|
224
|
+
`member-prompt` all point at the same worktree-backed member.
|
|
169
225
|
|
|
170
226
|
When the member starts inside a worktree, it must verify the assigned cwd exists and contains the
|
|
171
227
|
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
|
|
|
194
250
|
is never disbanded is a leak.
|
|
195
251
|
|
|
196
252
|
- `archive` closes the team: notify each active member, copy anything useful into `artifacts/`,
|
|
197
|
-
then
|
|
198
|
-
|
|
253
|
+
then close each member on its transport. On MultiAgentV2, `interrupt_agent` any member still
|
|
254
|
+
mid-turn and record in the note that V2 exposes no runtime archive operation - the durable
|
|
255
|
+
`team.json` state IS the archive; never claim a V2 agent itself was archived. On Codex App,
|
|
256
|
+
try `codex_app.set_thread_archived` per member thread; treat failures such as
|
|
257
|
+
"Ambiguous Codex thread id" or an id that is ambiguous across hosts as an
|
|
199
258
|
app-thread archival blocker, not as a team-state blocker: record the failure in the team log,
|
|
200
259
|
tell the user which member thread was not proven archived, and continue the team-state archive
|
|
201
260
|
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.
|
|
|
212
271
|
- Stop and ask before deleting an unarchived team while any member is still active.
|
|
213
272
|
- Member communication stays English unless the user explicitly requests otherwise; user-facing
|
|
214
273
|
replies follow the user's language.
|
|
215
|
-
- Stop if the
|
|
216
|
-
|
|
274
|
+
- Stop if the selected transport's tools (V2 spawn/message/wait/list/interrupt, or Codex App
|
|
275
|
+
create/read/send/title/archive) are unavailable or stop working; say so instead of faking it
|
|
276
|
+
or silently switching transports.
|