Skip to content

Commit 57f2d9d

Browse files
committed
fix: pass request model to Codex CLI options
1 parent 5857319 commit 57f2d9d

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Precedence:
9393
Default mapping from `RunRequest`:
9494
- `prompt` -> streamed turn input
9595
- `cwd` -> `thread_opts.working_directory`
96-
- `model` -> `thread_opts.model`
96+
- `model` -> `codex_opts.model` and `thread_opts.model`
9797
- `max_turns` -> `turn_opts.max_turns`
9898
- `timeout_ms` -> `turn_opts.timeout_ms`
9999
- `system_prompt` -> `thread_opts.developer_instructions`

lib/jido_codex/options.ex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ defmodule Jido.Codex.Options do
9393
thread_id: nil,
9494
resume_last: false,
9595
cancel_mode: :immediate,
96-
codex_opts: %{},
96+
codex_opts:
97+
%{}
98+
|> maybe_put(:model, request.model),
9799
thread_opts:
98100
%{}
99101
|> maybe_put(:working_directory, request.cwd)

test/jido/codex/options_test.exs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ defmodule Jido.Codex.OptionsTest do
2121
assert options.prompt == "hello"
2222
assert options.transport == :exec
2323
assert options.cancel_mode == :immediate
24+
assert options.codex_opts.model == "gpt-5"
2425
assert options.thread_opts.working_directory == "/tmp/project"
2526
assert options.thread_opts.model == "gpt-5"
2627
assert options.thread_opts.developer_instructions == "be concise"

0 commit comments

Comments
 (0)