You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: apply_patch unavailable on non-OpenAI providers due to hardcoded isOpenAIProvider gate #88357
Remove the isOpenAIProvider() gate from applyPatchEnabled check. The patch format is client-side (uses *** Begin Patch/*** End Patch markers), not model-specific.
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed May 30, 2026, 10:56 AM ET / 14:56 UTC.
Summary
Keep open: current main and latest-release docs still gate apply_patch to OpenAI/OpenAI Codex, while this asks to broaden a core filesystem mutation tool to non-OpenAI providers. Because current docs and tests encode the gate as expected behavior, this needs maintainer product/security review rather than cleanup closure.
Reproducibility: yes. from source inspection: current main gates apply_patch behind isOpenAIProvider, and tests assert it is absent for Anthropic. I did not run a live provider session in this read-only review.
Next step
A source-backed issue remains, but automation should not remove a documented provider gate without maintainer agreement on provider compatibility and security expectations.
Review details
Best possible solution:
Decide the provider contract first, then either make apply_patch provider-independent with focused runtime/policy/docs coverage or explicitly keep and document the OpenAI-only boundary.
Do we have a high-confidence way to reproduce the issue?
Yes, from source inspection: current main gates apply_patch behind isOpenAIProvider, and tests assert it is absent for Anthropic. I did not run a live provider session in this read-only review.
Is this the best way to solve the issue?
Unclear. Removing the gate may be the eventual implementation, but the current OpenAI-only behavior is documented and tested, so the best fix needs an explicit provider/tool compatibility and security decision first.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Removing the gate could expose a mutating filesystem tool to provider/tool-schema paths that do not yet have compatibility, policy, or live-provider proof.
The requested expectation conflicts with current docs and tests, so maintainers need to decide whether this is a contract change or the OpenAI-only gate remains intentional.
Codex review notes: model gpt-5.5, reasoning high; reviewed against 99e8cf22a8ef.
Label changes
Label changes:
add P2: This is a normal-priority provider/tool availability improvement with real coding-workflow impact but no crash, data loss, or urgent regression proof.
add impact:auth-provider: The issue is about provider-based model routing/tool availability for non-OpenAI providers.
add issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.
add clawsweeper:source-repro: Current issue advisory state selects this label.
add clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.
add clawsweeper:fix-shape-clear: Current issue advisory state selects this label.
add clawsweeper:needs-maintainer-review: Current issue advisory state selects this label.
add clawsweeper:needs-product-decision: Current issue advisory state selects this label.
Label justifications:
P2: This is a normal-priority provider/tool availability improvement with real coding-workflow impact but no crash, data loss, or urgent regression proof.
impact:auth-provider: The issue is about provider-based model routing/tool availability for non-OpenAI providers.
Review docs updates for docs/tools/apply-patch.md, docs/tools/exec.md, and docs/gateway/config-tools.md after the provider contract is decided.
What I checked:
Current source gate:createOpenClawCodingTools only enables apply_patch when config allows it, isOpenAIProvider(options?.modelProvider) is true, and model allowlist checks pass. (src/agents/agent-tools.ts:695, 99e8cf22a8ef)
Current source materialization: The apply_patch tool is not added to the tool list when applyPatchEnabled is false, so non-OpenAI providers lose the tool before policy can allow it. (src/agents/agent-tools.ts:829, 99e8cf22a8ef)
Current docs contract: The exec docs say apply_patch is enabled by default for OpenAI/OpenAI Codex and is only available for those models, while policy still treats allow: ["write"] as allowing it for compatible models. Public docs: docs/tools/exec.md. (docs/tools/exec.md:257, 99e8cf22a8ef)
Latest release docs: The latest release tag also documents apply_patch as available by default for OpenAI and OpenAI Codex models, so the reported provider gate is not already fixed in the shipped docs. Public docs: docs/tools/apply-patch.md. (docs/tools/apply-patch.md:37, 27ae826f6525)
History provenance: Blame for the current provider gate, the test expectations, and the docs points to commit 4e2ef87 in this checkout, which carried the current OpenAI-only behavior forward on main. (src/agents/agent-tools.ts:695, 4e2ef87c313d)
Likely related people:
vincentkoc: Blame for the current provider gate, tests, and docs points to the same commit authored by Vincent Koc, and recent local history also shows adjacent agent/runtime work by the same author. (role: current implementation provenance; confidence: medium; commits: 4e2ef87c313d, e780a6b7baca, 1d21646e9645; files: src/agents/agent-tools.ts, src/agents/agent-tools.create-openclaw-coding-tools.test.ts, docs/tools/exec.md)
steipete: Recent main history shows Peter Steinberger touching nearby agent/runtime surfaces and carrying the latest release tag that documents shipped apply_patch behavior. (role: recent adjacent area contributor; confidence: low; commits: 99e8cf22a8ef, 912f66317334, 27ae826f6525; files: src/agents/tools/web-shared.ts, src/agents/embedded-agent-runner/model.ts, CHANGELOG.md)
How this review workflow works
ClawSweeper keeps one durable marker-backed review comment per issue or PR.
Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
Maintainers can also comment @clawsweeper review to request a fresh review only.
Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Activity
clawsweeper commentedon May 30, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed May 30, 2026, 10:56 AM ET / 14:56 UTC.
Summary
Keep open: current
mainand latest-release docs still gateapply_patchto OpenAI/OpenAI Codex, while this asks to broaden a core filesystem mutation tool to non-OpenAI providers. Because current docs and tests encode the gate as expected behavior, this needs maintainer product/security review rather than cleanup closure.Reproducibility: yes. from source inspection: current
maingatesapply_patchbehindisOpenAIProvider, and tests assert it is absent for Anthropic. I did not run a live provider session in this read-only review.Next step
A source-backed issue remains, but automation should not remove a documented provider gate without maintainer agreement on provider compatibility and security expectations.
Review details
Best possible solution:
Decide the provider contract first, then either make
apply_patchprovider-independent with focused runtime/policy/docs coverage or explicitly keep and document the OpenAI-only boundary.Do we have a high-confidence way to reproduce the issue?
Yes, from source inspection: current
maingatesapply_patchbehindisOpenAIProvider, and tests assert it is absent for Anthropic. I did not run a live provider session in this read-only review.Is this the best way to solve the issue?
Unclear. Removing the gate may be the eventual implementation, but the current OpenAI-only behavior is documented and tested, so the best fix needs an explicit provider/tool compatibility and security decision first.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 99e8cf22a8ef.
Label changes
Label changes:
P2: This is a normal-priority provider/tool availability improvement with real coding-workflow impact but no crash, data loss, or urgent regression proof.impact:auth-provider: The issue is about provider-based model routing/tool availability for non-OpenAI providers.issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.clawsweeper:source-repro: Current issue advisory state selects this label.clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.clawsweeper:fix-shape-clear: Current issue advisory state selects this label.clawsweeper:needs-maintainer-review: Current issue advisory state selects this label.clawsweeper:needs-product-decision: Current issue advisory state selects this label.Label justifications:
P2: This is a normal-priority provider/tool availability improvement with real coding-workflow impact but no crash, data loss, or urgent regression proof.impact:auth-provider: The issue is about provider-based model routing/tool availability for non-OpenAI providers.Evidence reviewed
Acceptance criteria:
What I checked:
createOpenClawCodingToolsonly enablesapply_patchwhen config allows it,isOpenAIProvider(options?.modelProvider)is true, and model allowlist checks pass. (src/agents/agent-tools.ts:695, 99e8cf22a8ef)apply_patchtool is not added to the tool list whenapplyPatchEnabledis false, so non-OpenAI providers lose the tool before policy can allow it. (src/agents/agent-tools.ts:829, 99e8cf22a8ef)apply_patch, while Anthropic/OAuth tool construction excludes it. (src/agents/agent-tools.create-openclaw-coding-tools.test.ts:686, 99e8cf22a8ef)apply_patchis enabled by default for OpenAI/OpenAI Codex and is only available for those models, while policy still treatsallow: ["write"]as allowing it for compatible models. Public docs:docs/tools/exec.md. (docs/tools/exec.md:257, 99e8cf22a8ef)apply_patchas available by default for OpenAI and OpenAI Codex models, so the reported provider gate is not already fixed in the shipped docs. Public docs:docs/tools/apply-patch.md. (docs/tools/apply-patch.md:37, 27ae826f6525)src/agents/agent-tools.ts:695, 4e2ef87c313d)Likely related people:
src/agents/agent-tools.ts,src/agents/agent-tools.create-openclaw-coding-tools.test.ts,docs/tools/exec.md)apply_patchbehavior. (role: recent adjacent area contributor; confidence: low; commits: 99e8cf22a8ef, 912f66317334, 27ae826f6525; files:src/agents/tools/web-shared.ts,src/agents/embedded-agent-runner/model.ts,CHANGELOG.md)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.fix: repair model provider edge cases
fix: repair model provider edge cases