Skip to content

Commit ace0930

Browse files
committed
fix: add support for codex 0.20.0
1 parent 3624b91 commit ace0930

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

registry/coder-labs/modules/codex/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,8 @@ module "codex" {
7373
}
7474
```
7575

76-
> **Security Notice**: This module uses the `--dangerously-bypass-approvals-and-sandbox` flag when running Codex CLI. This flag
77-
> bypasses standard permission checks and allows Codex CLI broader access to your system than normally permitted. While
78-
> this enables more functionality, it also means Codex CLI can potentially execute commands with the same privileges as
79-
> the user running it. Use this module _only_ in trusted environments and be aware of the security implications.
76+
> **Security Notice**: This module marks the workspace/folder as trusted that allows Codex to work in this workspace without asking for approval.
77+
> Use this module _only_ in trusted environments and be aware of the security implications.
8078
8179
## How it Works
8280

registry/coder-labs/modules/codex/scripts/install.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,13 @@ description = "Report ALL tasks and statuses (in progress, done, failed) you are
104104
type = "stdio"
105105
EOF
106106
)
107-
107+
TRUSTED_FOLDER=$(cat <<EOF
108+
projects = { "${ARG_CODEX_START_DIRECTORY}" = { trust_level = "trusted" } }
109+
EOF
110+
)
108111
echo "
112+
${TRUSTED_FOLDER}
113+
109114
${ARG_EXTRA_CODEX_CONFIG}
110115
111116
${BASE_EXTENSIONS}

registry/coder-labs/modules/codex/scripts/start.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ printf "start_directory: %s\n" "$ARG_CODEX_START_DIRECTORY"
2525
printf "task_prompt: %s\n" "$ARG_CODEX_TASK_PROMPT"
2626
echo "--------------------------------"
2727
set +o nounset
28-
CODEX_ARGS=("--skip-git-repo-check")
28+
CODEX_ARGS=()
2929

3030
if command_exists codex; then
3131
printf "Codex is installed\n"
@@ -58,8 +58,8 @@ fi
5858

5959
if [ -n "$ARG_CODEX_TASK_PROMPT" ]; then
6060
printf "Running the task prompt %s\n" "$ARG_CODEX_TASK_PROMPT"
61-
PROMPT="Every step of the way, report tasks to Coder with proper descriptions and statuses. Your task at hand: $ARG_CODEX_TASK_PROMPT"
62-
CODEX_ARGS+=("--dangerously-bypass-approvals-and-sandbox" "$PROMPT")
61+
PROMPT="Complete the task at hand and at every step of the way, report tasks to Coder with proper summary and statuses. Your task at hand: $ARG_CODEX_TASK_PROMPT"
62+
CODEX_ARGS+=("$PROMPT")
6363
else
6464
printf "No task prompt given.\n"
6565
fi
@@ -73,4 +73,4 @@ fi
7373
# use low width to fit in the tasks UI sidebar
7474
# we adjust the height to 930 due to a bug in codex, see: https://github.com/openai/codex/issues/1608
7575
printf "Starting codex with %s\n" "${CODEX_ARGS[@]}"
76-
agentapi server --term-width 63 --term-height 930 -- codex "${CODEX_ARGS[@]}"
76+
agentapi server --term-width 67 --term-height 1190 -- codex "${CODEX_ARGS[@]}"

0 commit comments

Comments
 (0)