feat(plugin): restore ai request hook

This commit is contained in:
Dax Raad 2026-07-15 15:58:14 -04:00
commit f2f5eb6f16
19 changed files with 261 additions and 10 deletions

View file

@ -195,6 +195,19 @@ export const Plugin = {
),
)
.pipe(Effect.orDie)
yield* ctx.ai.hook("request", (event) =>
Effect.sync(() => {
const usePatch =
event.model.providerID.toLowerCase() === "openai" || event.model.id.toLowerCase().includes("gpt")
if (usePatch) {
delete event.tools.edit
delete event.tools.write
return
}
delete event.tools.patch
}),
)
}),
}