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

This commit is contained in:
jif-oai
2025-12-03 09:07:31 +00:00
committed by GitHub
parent 00ef9d3784
commit 42ae738f67

View File

@@ -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?;