From c975f952ff6b8161929bf9ed6ac4a08d9911f117 Mon Sep 17 00:00:00 2001 From: ruskaruma Date: Fri, 27 Mar 2026 12:28:02 +0530 Subject: [PATCH 1/2] fix(core):mandate ao send and ban raw tmux (#340) --- .../core/src/__tests__/orchestrator-prompt.test.ts | 12 ++++++++++++ packages/core/src/orchestrator-prompt.ts | 7 +++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/packages/core/src/__tests__/orchestrator-prompt.test.ts b/packages/core/src/__tests__/orchestrator-prompt.test.ts index 27e943a4a..7283ce9a3 100644 --- a/packages/core/src/__tests__/orchestrator-prompt.test.ts +++ b/packages/core/src/__tests__/orchestrator-prompt.test.ts @@ -43,6 +43,18 @@ describe("generateOrchestratorPrompt", () => { expect(prompt).toContain("do not edit repository files or implement fixes"); }); + it("mandates ao send and bans raw tmux access", () => { + const prompt = generateOrchestratorPrompt({ + config, + projectId: "my-app", + project: config.projects["my-app"]!, + }); + + expect(prompt).toContain("Always use `ao send`"); + expect(prompt).toContain("never use raw `tmux send-keys`"); + expect(prompt).toContain("ao send --no-wait"); + }); + it("pushes implementation and PR claiming into worker sessions", () => { const prompt = generateOrchestratorPrompt({ config, diff --git a/packages/core/src/orchestrator-prompt.ts b/packages/core/src/orchestrator-prompt.ts index 935954faa..53b60135c 100644 --- a/packages/core/src/orchestrator-prompt.ts +++ b/packages/core/src/orchestrator-prompt.ts @@ -34,7 +34,9 @@ Your role is to coordinate and manage worker agent sessions. You do NOT write co - Investigations from the orchestrator session are **read-only**. Inspect status, logs, metadata, PR state, and worker output, but do not edit repository files or implement fixes from the orchestrator session. - Any code change, test run tied to implementation, git branch work, or PR takeover must be delegated to a **worker session**. - The orchestrator session must never own a PR. Never claim a PR into the orchestrator session, and never treat the orchestrator as the worker responsible for implementation. -- If an investigation discovers follow-up work, either spawn a worker session or direct an existing worker session with clear instructions.`); +- If an investigation discovers follow-up work, either spawn a worker session or direct an existing worker session with clear instructions. +- **Always use \`ao send\` to communicate with sessions** — never use raw \`tmux send-keys\` or \`tmux capture-pane\`. Direct tmux access bypasses busy detection, retry logic, and input sanitization, and breaks multi-line input for some agents (e.g. Codex). +- When a session might be busy, use \`ao send --no-wait \` to queue the message without blocking.`); // Project Info sections.push(`## Project Info @@ -87,7 +89,8 @@ ao open ${projectId} | \`ao session attach \` | Attach to a session's tmux window | | \`ao session kill \` | Kill a specific session | | \`ao session cleanup [-p project]\` | Kill completed/merged sessions | -| \`ao send \` | Send a message to a running session | +| \`ao send \` | Send a message to a running session (waits for idle) | +| \`ao send --no-wait \` | Send without waiting for session to become idle | | \`ao dashboard\` | Start the web dashboard (http://localhost:${config.port ?? 3000}) | | \`ao open \` | Open all project sessions in terminal tabs |`); From b65cc702beeb5ce898348d0d3ea8cf15a387c413 Mon Sep 17 00:00:00 2001 From: ruskaruma Date: Fri, 27 Mar 2026 20:50:13 +0530 Subject: [PATCH 2/2] fix: correct ao send --no-wait wording per review --- packages/core/src/orchestrator-prompt.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/orchestrator-prompt.ts b/packages/core/src/orchestrator-prompt.ts index 53b60135c..37df887a4 100644 --- a/packages/core/src/orchestrator-prompt.ts +++ b/packages/core/src/orchestrator-prompt.ts @@ -36,7 +36,7 @@ Your role is to coordinate and manage worker agent sessions. You do NOT write co - The orchestrator session must never own a PR. Never claim a PR into the orchestrator session, and never treat the orchestrator as the worker responsible for implementation. - If an investigation discovers follow-up work, either spawn a worker session or direct an existing worker session with clear instructions. - **Always use \`ao send\` to communicate with sessions** — never use raw \`tmux send-keys\` or \`tmux capture-pane\`. Direct tmux access bypasses busy detection, retry logic, and input sanitization, and breaks multi-line input for some agents (e.g. Codex). -- When a session might be busy, use \`ao send --no-wait \` to queue the message without blocking.`); +- When a session might be busy, use \`ao send --no-wait \` to send without waiting for the session to become idle.`); // Project Info sections.push(`## Project Info @@ -89,7 +89,7 @@ ao open ${projectId} | \`ao session attach \` | Attach to a session's tmux window | | \`ao session kill \` | Kill a specific session | | \`ao session cleanup [-p project]\` | Kill completed/merged sessions | -| \`ao send \` | Send a message to a running session (waits for idle) | +| \`ao send \` | Send a message to a running session | | \`ao send --no-wait \` | Send without waiting for session to become idle | | \`ao dashboard\` | Start the web dashboard (http://localhost:${config.port ?? 3000}) | | \`ao open \` | Open all project sessions in terminal tabs |`);