mirror of
https://github.com/openai/codex.git
synced 2026-05-03 04:42:20 +03:00
feat: add --reasoning CLI flag (#314)
This PR adds a new CLI flag: `--reasoning`, which allows users to customize the reasoning effort level (`low`, `medium`, or `high`) used by OpenAI's `o` models. By introducing the `--reasoning` flag, users gain more flexibility when working with the models. It enables optimization for either speed or depth of reasoning, depending on specific use cases. This PR resolves #107 - **Flag**: `--reasoning` - **Accepted Values**: `low`, `medium`, `high` - **Default Behavior**: If not specified, the model uses the default reasoning level. ## Example Usage ```bash codex --reasoning=low "Write a simple function to calculate factorial" --------- Co-authored-by: Fouad Matin <169186268+fouad-openai@users.noreply.github.com> Co-authored-by: yashrwealthy <yash.rastogi@wealthy.in> Co-authored-by: Thibault Sottiaux <tibo@openai.com>
This commit is contained in:
@@ -676,7 +676,7 @@ export class AgentLoop {
|
||||
try {
|
||||
let reasoning: Reasoning | undefined;
|
||||
if (this.model.startsWith("o")) {
|
||||
reasoning = { effort: "high" };
|
||||
reasoning = { effort: this.config.reasoningEffort ?? "high" };
|
||||
if (this.model === "o3" || this.model === "o4-mini") {
|
||||
reasoning.summary = "auto";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user