Skip to content

Commit a60c26f

Browse files
committed
fix(codex): send strict: false on translated function tools
The Responses API defaults function tools to strict mode, which makes the model fill every schema property — optional fields included. Claude Code tool schemas rely on optional fields staying omittable; under strict decoding the model always emits e.g. Agent.isolation, forcing worktree isolation and breaking subagent spawns outside git repos. Send an explicit strict: false, matching the official Codex CLI.
1 parent e70ce0c commit a60c26f

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎src/providers/codex/translate/request.rs‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,12 @@ pub struct ResponsesFunctionTool {
174174
#[serde(default, skip_serializing_if = "Option::is_none")]
175175
pub description: Option<String>,
176176
pub parameters: Value,
177+
/// Responses API function tools default to strict mode, which makes the
178+
/// model fill every schema property (optional fields included). Claude
179+
/// Code tool schemas rely on optional fields staying omittable, so send
180+
/// an explicit `strict: false`, matching what the official Codex CLI does.
181+
#[serde(default)]
182+
pub strict: bool,
177183
}
178184

179185
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -518,6 +524,7 @@ fn read_tools(req: &MessagesRequest) -> Result<Option<Vec<ResponsesTool>>, anyho
518524
name,
519525
description,
520526
parameters,
527+
strict: false,
521528
}));
522529
}
523530
}

0 commit comments

Comments
 (0)