Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

feat: model warning in case of apply patch (#7494)

jif-oai42ae738f67ae
diff --git a/codex-rs/core/src/tools/handlers/apply_patch.rs b/codex-rs/core/src/tools/handlers/apply_patch.rs
index 850c74f124..4a28619c76 100644
--- a/codex-rs/core/src/tools/handlers/apply_patch.rs
+++ b/codex-rs/core/src/tools/handlers/apply_patch.rs
@@ -181,6 +181,12 @@ pub(crate) async fn intercept_apply_patch(
) -> Result<Option<ToolOutput>, FunctionCallError> {
match codex_apply_patch::maybe_parse_apply_patch_verified(command, cwd) {
codex_apply_patch::MaybeApplyPatchVerified::Body(changes) => {
+ session
+ .record_model_warning(
+ format!("apply_patch was requested via {tool_name}. Use the apply_patch tool instead of exec_command."),
+ turn,
+ )
+ .await;
match apply_patch::apply_patch(session, turn, call_id, changes).await {
InternalApplyPatchInvocation::Output(item) => {
let content = item?;