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
13 changes: 9 additions & 4 deletions Packages/CrowCodex/Sources/CrowCodex/OpenAICodexAgent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,15 @@ public struct OpenAICodexAgent: CodingAgent {
// log and skip rather than producing a malformed command.
guard session.kind == .work else { return nil }

// Bare `codex` launch — the user types their prompt into the TUI.
// No env prefix (Codex has no OTEL equivalent), no `--continue`
// (MVP doesn't auto-resume), no `--rc` (Codex doesn't do remote
// control). The terminal's cwd is already the worktree path.
// Bare `codex` launch in-app. First-launch prompt delivery happens
// in the workspace skill (`crow-workspace/setup.sh launch_codex`),
// which passes the prompt file as Codex's positional argv before
// handing the terminal off to Crow. In-app re-launches resume the
// existing TUI rather than re-running the original prompt — same
// shape as `CursorAgent` `.work` (no `--continue` equivalent in MVP).
// No env prefix (Codex has no OTEL equivalent), no `--rc` (Codex
// doesn't do remote control). The terminal's cwd is already the
// worktree path.
return "codex\n"
}

Expand Down
10 changes: 5 additions & 5 deletions Resources/crow-workspace-setup.sh.template
Original file line number Diff line number Diff line change
Expand Up @@ -714,11 +714,11 @@ launch_codex() {
die "launch_agent" "codex binary not found at PATH or known locations; provide --agent-binary"
fi
log "Resolved codex binary: $bin"
# Codex has no prompt-argv form (matches OpenAICodexAgent.autoLaunchCommand
# — bare `codex` only). The prompt file is still written; the user can
# paste from it into the TUI.
log "Note: Codex has no prompt-argv form; prompt file is at $prompt_path (paste manually if needed)."
local launch_cmd="cd $WORKTREE_PATH && $bin"
# Codex 0.129+ accepts the initial prompt as a positional argv that
# pre-fills the TUI composer — same mechanism Cursor's `agent` uses.
# The prompt-argv form was deferred in MVP because older Codex CLIs
# ignored extra argv; unblocked here (#492).
local launch_cmd="cd $WORKTREE_PATH && $bin \"\$(cat $prompt_path)\""
create_agent_terminal "OpenAI Codex" "$launch_cmd"
}

Expand Down
10 changes: 5 additions & 5 deletions skills/crow-workspace/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -837,11 +837,11 @@ launch_codex() {
die "launch_agent" "codex binary not found at PATH or known locations; provide --agent-binary"
fi
log "Resolved codex binary: $bin"
# Codex has no prompt-argv form (matches OpenAICodexAgent.autoLaunchCommand
# — bare `codex` only). The prompt file is still written; the user can
# paste from it into the TUI.
log "Note: Codex has no prompt-argv form; prompt file is at $prompt_path (paste manually if needed)."
local launch_cmd="cd $WORKTREE_PATH && $bin"
# Codex 0.129+ accepts the initial prompt as a positional argv that
# pre-fills the TUI composer — same mechanism Cursor's `agent` uses.
# The prompt-argv form was deferred in MVP because older Codex CLIs
# ignored extra argv; unblocked here (#492).
local launch_cmd="cd $WORKTREE_PATH && $bin \"\$(cat $prompt_path)\""
create_agent_terminal "OpenAI Codex" "$launch_cmd"
}

Expand Down
Loading