Skip to content

Commit 42ae738

Browse files
authored
feat: model warning in case of apply patch (openai#7494)
1 parent 00ef9d3 commit 42ae738

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

codex-rs/core/src/tools/handlers/apply_patch.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,12 @@ pub(crate) async fn intercept_apply_patch(
181181
) -> Result<Option<ToolOutput>, FunctionCallError> {
182182
match codex_apply_patch::maybe_parse_apply_patch_verified(command, cwd) {
183183
codex_apply_patch::MaybeApplyPatchVerified::Body(changes) => {
184+
session
185+
.record_model_warning(
186+
format!("apply_patch was requested via {tool_name}. Use the apply_patch tool instead of exec_command."),
187+
turn,
188+
)
189+
.await;
184190
match apply_patch::apply_patch(session, turn, call_id, changes).await {
185191
InternalApplyPatchInvocation::Output(item) => {
186192
let content = item?;

0 commit comments

Comments
 (0)