Skip to content
Open
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
8 changes: 8 additions & 0 deletions electron/mcp/agent-frame-fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ export const READY_AGENT_FRAME_FIXTURES: AgentFrameFixture[] = [
'> Type your message or @path/to/file',
].join('\n'),
},
{
name: 'Codex CLI 0.154.0 "Ask Codex to do anything" prompt (custom nono agent wrapper)',
frame: [
'› Ask Codex to do anything',
'',
'gpt-5.6-luna high · /Users/brooksc/git/parallel-code/.worktrees/task-031-nono',
].join('\n'),
},
];

export const NOT_READY_AGENT_FRAME_FIXTURES: NotReadyAgentFrameFixture[] = [
Expand Down
4 changes: 2 additions & 2 deletions electron/mcp/coordinator-test-harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ vi.mock('../shared/prompt-detect.js', () => ({
.slice(-1000)
.split(/\r\n?|\n/)
.some((line) =>
/(?:^|\s)[❯›]\s*$|^\s*--\s*INSERT\s*--\s*$|^\s*>\s*(?:Type your message|$)/i.test(
/(?:^|\s)\s*$|^\s*--\s*INSERT\s*--\s*$|^\s*[›>]\s*(?:Type your message|Ask Codex to do anything|$)/i.test(
line.trim(),
),
);
Expand All @@ -171,7 +171,7 @@ vi.mock('../shared/prompt-detect.js', () => ({
return tail
.split(/\r\n?|\n/)
.some((line) =>
/(?:^|\s)[❯›]\s*$|^\s*--\s*INSERT\s*--\s*$|^\s*>\s*(?:Type your message|$)/i.test(
/(?:^|\s)\s*$|^\s*--\s*INSERT\s*--\s*$|^\s*[›>]\s*(?:Type your message|Ask Codex to do anything|$)/i.test(
line.trim(),
),
);
Expand Down
15 changes: 15 additions & 0 deletions electron/mcp/prompt-detect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,21 @@ describe('chunkContainsAgentPrompt', () => {
).toBe(true);
});

it('returns true for Codex CLI 0.154.0 "Ask Codex to do anything" prompt (› prompt char)', () => {
expect(chunkContainsAgentPrompt('› Ask Codex to do anything')).toBe(true);
});

it('returns true for Codex CLI "Ask Codex to do anything" prompt above footer/status text', () => {
const footer = '\n\ngpt-5.6-luna high · ~/repo/worktree';
expect(chunkContainsAgentPrompt(`› Ask Codex to do anything${footer}`)).toBe(true);
});

it('returns true for a plain-> variant of the "Ask Codex to do anything" prompt', () => {
// Defensive: some agent builds may render the composer with a plain `>`
// instead of Codex's usual `›` — both should be recognized as ready.
expect(chunkContainsAgentPrompt('> Ask Codex to do anything')).toBe(true);
});

it('does not treat Codex startup screens as ready', () => {
expect(
chunkContainsAgentPrompt('Starting MCP servers (0/2): codex_apps, parallel-code\n›'),
Expand Down
3 changes: 1 addition & 2 deletions electron/shared/prompt-detect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ export const PROMPT_PATTERNS: RegExp[] = [
export const AGENT_READY_TAIL_PATTERNS: RegExp[] = [
/^\s*❯\s*$/,
/^\s*--\s*INSERT\s*--(?:$|\s|[^\w].*$)/i,
/^\s*›\s*$/,
/^\s*>\s*(?:Type your message|$)/i,
/^\s*[›>]\s*(?:Type your message|Ask Codex to do anything|$)/i,
];

export const AGENT_READY_TAIL_CHARS = 1000;
Expand Down