Skip to content

fix: recognize Codex CLI "Ask Codex to do anything" ready prompt - #277

Open
Deltoyd wants to merge 3 commits into
johannesjo:mainfrom
Deltoyd:fix/codex-nono-ready-prompt-detection
Open

Deltoyd wants to merge 3 commits into
johannesjo:mainfrom
Deltoyd:fix/codex-nono-ready-prompt-detection

Conversation

@Deltoyd

@Deltoyd Deltoyd commented Sep 14, 2026

Copy link
Copy Markdown

Summary

Parallel Code 2.0.0 cannot deliver automatic sub-task prompts to Codex CLI v0.154.0 when launched through a custom codex-nono agent. The child process reaches:

> Ask Codex to do anything

but the task stays stuck at "Waiting to send prompt..." — the initial prompt and any queued follow-up never send.

AGENT_READY_TAIL_PATTERNS in electron/shared/prompt-detect.ts only recognized > Type your message (Gemini) or a bare > as a ready main-input prompt for the >-style agents. Codex CLI 0.154.0's placeholder text (Ask Codex to do anything) fell through, so getAgentPromptReadiness/chunkContainsAgentPrompt never reported the agent as ready and the coordinator never wrote the queued prompt.

  • Extends the >-prompt pattern to also match Ask Codex to do anything
  • Adds a recorded fixture + targeted unit tests reproducing the reported frame
  • Fixes coordinator-test-harness.ts's hand-duplicated copy of the same regex (used to mock ../shared/prompt-detect.js in coordinator.test.ts), which was out of sync with the real pattern and caused the new fixture's it.each coordinator tests to fail even after the real fix

Test plan

  • npx vitest run electron/mcp/prompt-detect.test.ts — 58/58 pass (new tests fail without the fix, confirmed via reverting locally)
  • npx vitest run electron/mcp/coordinator.test.ts — 285/285 pass
  • npm run typecheck — clean
  • npm run lint — clean
  • npm run test:unit full suite — no new failures introduced (compared against a clean checkout of main via git stash); 8 pre-existing failures unrelated to this change remain (local git identity requirements in documents/setup.test.ts, a keychain-fallback token leak in claude-usage.test.ts, and a recovered flag regression in plans.test.ts — none touched by this diff)

🤖 Generated with Claude Code

https://claude.ai/code/session_0159pgngC1aN4DEVBQoiCGNc

Deltoyd and others added 3 commits September 14, 2026 15:50
Codex CLI 0.154.0 (as launched via a custom codex-nono agent) renders
its idle input prompt as "> Ask Codex to do anything" instead of the
"> Type your message" text the readiness detector already handled.
AGENT_READY_TAIL_PATTERNS only matched "Type your message" or a bare
">", so the coordinator never saw the agent as ready and automatic
prompt delivery stayed stuck at "Waiting to send prompt...".

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0159pgngC1aN4DEVBQoiCGNc
… fix

coordinator-test-harness.ts vi.mock's ../shared/prompt-detect.js with a
hand-duplicated copy of AGENT_READY_TAIL_PATTERNS instead of importing
the real module, so the previous commit's regex fix wasn't reflected
here and the new "Ask Codex to do anything" fixture failed only in
coordinator.test.ts's it.each suites.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0159pgngC1aN4DEVBQoiCGNc
The original bug report described the Codex 0.154.0 idle prompt as
literal "> Ask Codex to do anything", so the first pass extended only
the ">" branch of AGENT_READY_TAIL_PATTERNS. A screenshot of the real
app confirms Codex still renders its usual "›" prompt character, just
with the new placeholder text trailing it ("›  Ask Codex to do
anything") instead of standing alone the way the readiness detector
expected. The bare "›" pattern required end-of-line right after the
character, so it never matched either.

Merges the bare-"›" and ">"-with-placeholder patterns into one that
accepts either prompt character followed by either known placeholder
(or nothing, preserving the old bare-prompt behavior), and fixes the
fixture/tests to use the real "›" character instead of the
transcribed ">".

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0159pgngC1aN4DEVBQoiCGNc
@Deltoyd

Deltoyd commented Sep 14, 2026

Copy link
Copy Markdown
Author

Update: my first pass matched the wrong prompt character. The bug report transcribed the prompt as literal > Ask Codex to do anything, but a screenshot of the actual app shows Codex still renders its usual character, just with the new placeholder text trailing it (› Ask Codex to do anything) instead of standing alone. Pushed a follow-up commit that merges the bare- and >-with-placeholder patterns into one that accepts either prompt character with either placeholder (or a bare prompt, preserving prior behavior), and corrected the fixture/tests to use the real character. Verified directly against the literal text from the screenshot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant