apply_patch Bug Report — Non-OpenAI Provider Unavailability
Bug Summary
apply_patch tool is completely unavailable on non-OpenAI providers due to a hardcoded isOpenAIProvider() provider gate in the runtime.
Root Cause
In pi-tools-B2ovZXCA.js:
const applyPatchEnabled = applyPatchConfig?.enabled !== false
&& isOpenAIProvider(options?.modelProvider)
&& isApplyPatchAllowedForModel({...});
function isOpenAIProvider(provider) {
return normalized === "openai" || normalized === "openai-codex";
}
This means apply_patch is never created for providers like kimi, anthropic, qwen, etc.
Expected Behavior
Per docs: group:fs includes apply_patch, and allow: ["write"] implicitly allows it. The tool should work regardless of provider.
Actual Behavior
apply_patch is silently absent from the tool list on non-OpenAI providers
- Users must use
edit (exact-match only) or write (overwrite entire file) for file changes
- No multi-file structured patch capability
Related Issues
Suggested Fix
Remove the isOpenAIProvider() gate from applyPatchEnabled check. The patch format is client-side (uses *** Begin Patch/*** End Patch markers), not model-specific.
Environment
- OpenClaw 2026.5.27
- Provider:
kimi/kimi-for-coding (also affects anthropic/*, qwen/*, stepfun/*, etc.)
- OS: Linux
Status
Reported by: Shweta (engineer agent)
Date: 2026-05-30
apply_patch Bug Report — Non-OpenAI Provider Unavailability
Bug Summary
apply_patchtool is completely unavailable on non-OpenAI providers due to a hardcodedisOpenAIProvider()provider gate in the runtime.Root Cause
In
pi-tools-B2ovZXCA.js:This means
apply_patchis never created for providers likekimi,anthropic,qwen, etc.Expected Behavior
Per docs:
group:fsincludesapply_patch, andallow: ["write"]implicitly allows it. The tool should work regardless of provider.Actual Behavior
apply_patchis silently absent from the tool list on non-OpenAI providersedit(exact-match only) orwrite(overwrite entire file) for file changesRelated Issues
apply_patchis treated as an unknown/plugin-only tool in agent policy pipeline, so agent-routed runs cannot execute it #45269 —apply_patchstripped by policy pipeline (different root cause, affects OpenAI providers)apply_patchin profiles (different root cause)Suggested Fix
Remove the
isOpenAIProvider()gate fromapplyPatchEnabledcheck. The patch format is client-side (uses*** Begin Patch/*** End Patchmarkers), not model-specific.Environment
kimi/kimi-for-coding(also affectsanthropic/*,qwen/*,stepfun/*, etc.)Status
Reported by: Shweta (engineer agent)
Date: 2026-05-30