Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/loop/tmux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ const buildInteractivePrimaryPrompt = (
);
parts.push(pairedBridgeGuidance(opts.agent, runId));
parts.push(pairedWorkflowGuidance(opts, opts.agent));
parts.push(
`If the human asks for plan mode, write PLAN.md first, ask ${peer} for a plan review, iterate on PLAN.md, then ask the human to review the plan before implementing.`
);
parts.push(
`Wait for the first human task. Do not implement until one arrives. Once it does, coordinate directly with ${peer} and keep the paired review workflow intact. Do not send a message to ${peer} until then.`
);
Expand All @@ -262,6 +265,9 @@ const buildInteractivePeerPrompt = (
appendProofPrompt(parts, opts.proof);
parts.push(pairedBridgeGuidance(agent, runId));
parts.push(pairedWorkflowGuidance(opts, agent));
parts.push(
`If ${primary} asks for a plan review, review PLAN.md only, suggest concrete fixes, and wait for the next request.`
);
parts.push(
`Wait for ${primary} to provide a concrete task or review request. Do not send a message to ${primary} yet. If the human clearly assigns you separate work in this pane, treat that as a new task. If you are answering ${primary}, use the bridge tools instead of a human-facing reply.`
);
Expand Down
6 changes: 6 additions & 0 deletions tests/loop/tmux.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -796,11 +796,17 @@ test("interactive tmux prompts tell both agents to wait for the human", () => {
expect(primaryPrompt).toContain("Agent-to-agent pair programming");
expect(primaryPrompt).toContain("No task has been assigned yet.");
expect(primaryPrompt).toContain("Wait for the first human task");
expect(primaryPrompt).toContain("If the human asks for plan mode");
expect(primaryPrompt).toContain("ask Claude for a plan review");
expect(primaryPrompt).toContain("ask the human to review the plan");
Comment on lines +799 to +801
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

These checks for the primary agent's prompt are a bit fragmented and miss some key parts of the new instruction, such as write PLAN.md first and iterate on PLAN.md. Combining them into a single, more comprehensive assertion will make the test more robust and ensure the entire instruction is present.

Suggested change
expect(primaryPrompt).toContain("If the human asks for plan mode");
expect(primaryPrompt).toContain("ask Claude for a plan review");
expect(primaryPrompt).toContain("ask the human to review the plan");
expect(primaryPrompt).toContain(
"If the human asks for plan mode, write PLAN.md first, ask Claude for a plan review, iterate on PLAN.md, then ask the human to review the plan before implementing"
);

expect(primaryPrompt).toContain(
'Use "send_to_agent" with target: "claude" for Claude-facing messages'
);
expect(primaryPrompt).toContain("worktree isolation");
expect(peerPrompt).toContain("No task has been assigned yet.");
expect(peerPrompt).toContain(
"If Codex asks for a plan review, review PLAN.md only"
);
Comment on lines +807 to +809
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This check for the peer agent's prompt is incomplete. It misses important parts of the instruction like suggest concrete fixes and wait for the next request. A more comprehensive assertion would improve the test's coverage and robustness.

Suggested change
expect(peerPrompt).toContain(
"If Codex asks for a plan review, review PLAN.md only"
);
expect(peerPrompt).toContain(
"If Codex asks for a plan review, review PLAN.md only, suggest concrete fixes, and wait for the next request"
);

expect(peerPrompt).toContain("Wait for Codex to provide a concrete task");
expect(peerPrompt).toContain("human clearly assigns you separate work");
expect(peerPrompt).toContain('"reply"');
Expand Down
Loading