Skip to content
Draft
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
4 changes: 4 additions & 0 deletions src/adapters/cli/codex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,10 @@ export function createCodexAdapter(pathOverride?: string): CliAdapter {

completionPattern: undefined,
readyPattern: /›|\d+% left/, // › for input box, or status bar pattern (e.g. "97% left")
// Codex cold starts can exceed the worker's 15s soft first-prompt timeout.
// Wait for the real composer marker so the bare-shell guard does not treat
// a still-loading zsh wrapper as a failed launch.
deferFirstPromptTimeoutUntilReady: true,
defaultPassthroughCommands: ['/goal'],
systemHints: BOTMUX_SHELL_HINTS,
// Codex 0.134.0+ accepts a message while the current turn is still running:
Expand Down
8 changes: 8 additions & 0 deletions test/cli-adapters.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,14 @@ describe('readyPattern', () => {
expect(adapter.readyPattern!.test('97% left')).toBe(true);
});

it('codex defers the first-prompt timeout until its readyPattern appears', () => {
// Codex can cold-start slower than the worker's 15s soft timeout; keep the
// first Lark message queued until the composer is visible.
const adapter = createCodexAdapter('/bin/codex');
expect(adapter.deferFirstPromptTimeoutUntilReady).toBe(true);
expect(adapter.supportsTypeAhead).toBe(true);
});

it('traex matches prompt and context indicators', () => {
const adapter = createTraexAdapter('/bin/traex');
expect(adapter.readyPattern).toBeDefined();
Expand Down