Multi-Agent Collaboration for Team and Friends
TypeScript agent-automationagent-orchestrationagent-workflowai-agentsai-collaborationai-memoryai-workforceautonomous-agentsclaude-codeclaude-code-skillscodexcoding-agentmulti-agentmultiple-agentone-person-businessone-person-companyone-person-teamopencodesolopreneur
refactor(daemon): drop --chaotic_level flag, fold chaos check into judgment
Gusb492337a920f
diff --git a/src/daemon/src/cli/index.test.ts b/src/daemon/src/cli/index.test.tsindex 18fd0042c..db7e37690 100644--- a/src/daemon/src/cli/index.test.ts+++ b/src/daemon/src/cli/index.test.ts@@ -59,7 +59,7 @@ describe("envelope contract", () => {}),}),);- const code = await main(["message", "send", "--target", "/s/general", "--text", "hi", "--chaotic_level", "fine"]);+ const code = await main(["message", "send", "--target", "/s/general", "--text", "hi"]);const env = parseEnvelope(cap.lines());expect(code).toBe(0);expect(env).toEqual({ success: { sent: "/s/general#7" } });@@ -69,13 +69,12 @@ describe("envelope contract", () => {it("prints only `error` on failure (with hint when available)", async () => {setApiForTesting(stubApi());- // No --chaotic_level → error with hint- await main(["message", "send", "--target", "/s/general", "--text", "hi"]);+ // Emoji ref without a seq → error carries a recovery hint+ await main(["message", "emoji", "--target", "/s/general", "--emoji", "👍"]);const env = parseEnvelope(cap.lines());expect(typeof env.error).toBe("string");- expect(env.error).toContain("--chaotic_level");expect("success" in env).toBe(false);- expect("hint" in env).toBe(true); // Chaos level errors include a hint+ expect("hint" in env).toBe(true);});it("always exits 0 even on error", async () => {@@ -97,7 +96,7 @@ describe("channel alignment (message send)", () => {setApiForTesting(stubApi({ send: async () => ({ state: "blocked", reason: "unaligned", unreadCount: 3, latestSeq: 12 }) }),);- await main(["message", "send", "--target", "/s/general", "--text", "hi", "--chaotic_level", "fine"]);+ await main(["message", "send", "--target", "/s/general", "--text", "hi"]);const env = parseEnvelope(cap.lines());expect("success" in env).toBe(false);expect(env.error).toContain("not aligned");diff --git a/src/daemon/src/cli/index.ts b/src/daemon/src/cli/index.tsindex ce342419f..d16242a78 100755--- a/src/daemon/src/cli/index.ts+++ b/src/daemon/src/cli/index.ts@@ -133,24 +133,6 @@ async function cmdMessageSend(opts: Record<string, unknown>): Promise<unknown> {const channel = opts.target as string;if (!channel) throw new CliError("message send: --target <ref> is required (e.g. /demo-workspace/general)");- // Chaos level validation- const chaoticLevel = (opts.chaotic_level || opts.chaoticLevel) as string | undefined;- const chaoticHint = "Re-read the Chaos Awareness section in AGENTS.md and reflect before sending.";-- if (!chaoticLevel || (chaoticLevel !== "fine" && chaoticLevel !== "severe")) {- throw new CliError(- "message send: --chaotic_level must be 'fine' or 'severe'.",- chaoticHint,- );- }-- if (chaoticLevel === "severe") {- throw new CliError(- "message send: --chaotic_level is 'severe'.",- chaoticHint,- );- }-let text: string | undefined;const fileFlag = opts.file as string | undefined;const textFlag = opts.text as string | undefined;@@ -433,7 +415,6 @@ function buildProgram(): Command {(v, prev: string[] = []) => [...prev, v],[] as string[],)- .option("--chaotic_level <level>", "chaos level: 'fine' or 'severe' (required)").exitOverride().configureOutput({ writeOut: () => {}, writeErr: () => {} }).action(async function (this: Command) {diff --git a/src/daemon/src/drivers/systemPrompt.ts b/src/daemon/src/drivers/systemPrompt.tsindex aaff02e5b..e9690bba0 100644--- a/src/daemon/src/drivers/systemPrompt.ts+++ b/src/daemon/src/drivers/systemPrompt.ts@@ -317,14 +317,12 @@ function chaosAwarenessSection(): string {"8. **Actively doing others' job.** Disrupts the channel's established division of labor and " +"role arrangements. Stay in your lane unless asked to help.","",- "**DM channels (one-on-one):** The above chaos behaviors don't apply in DM channels since " +- "they're one-on-one conversations. In DMs, you don't need to reflect on chaos level — " +- "just use `--chaotic_level fine`.",- "",- "**Before sending** any message to a multi-person channel, reflect on the above chaotic " +- "behaviors. If any apply, you MUST " +- `set \`${CLI} message send --chaotic_level severe\`. If none apply, use ` +- "`--chaotic_level fine`.",+ "**DM channels (one-on-one):** The above chaos behaviors don't apply in DMs — they're " ++ "one-on-one, so just say what you mean.",+ "",+ "**Before sending** to a multi-person channel, run the list above against your message. If " ++ "any behavior applies, don't send it as-is — research first, ack instead of narrating, " ++ "or hold your peace. Send when you add signal, not when you'd add noise.","","**Before staying silent** in a multi-person channel, also reflect:","",