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
This issue might be a duplicate of existing issues. Please check:
[FEATURE]: ToolBuild hook #28353: Requests PreToolBuild/PostToolBuild hooks for runtime manipulation of the tool list before it is sent to the LLM — closely related to the per-model tool filtering design described here.
Shipped a band-aid fix in #34558 (merged): ToolRegistry.materialize now takes the resolved model and gates the edit-tool family the way V1 did — OpenAI/GPT models get apply_patch, every other model gets edit/write. This unblocks the immediate concern (GPT no longer receives edit + write + apply_patch simultaneously).
This is intentionally minimal and does not address the actual design ask in this issue, so keeping it open. Still needed for the proper solution:
Make filtering configurable (by model / provider / agent / plugin / request hook) instead of a hardcoded provider+id string check in materialize.
Define precedence when multiple configs/plugins affect the tool list.
TUI/client awareness of unavailable tools.
Note: a plugin-based approach isn't feasible today — the V2 PluginHost has no tool capability and there's no model-aware turn-time hook (only aisdk, which sees the model but operates on the language-model object, not the tool roster). The proper design would need that infra first. The architecture already earmarks materialize as the filtering seam (tool/builtins.ts: "provider/model filtering belongs to a future materialization phase"), so the band-aid lives in the right place — it just needs to become driven by configuration rather than hardcoded.
#34558 fixed the immediate failure mode and added coverage: GPT/OpenAI models receive apply_patch, while other models receive edit/write.
Keeping this open for the unresolved design: replace the hardcoded provider/model check with configurable policy, define composition and precedence across model/provider/agent/plugin inputs, and decide whether unavailable tools require client representation.
Superseded by #35408, which defines the shared V2 model-context hook and includes per-model tool filtering. The remaining precedence and client-representation questions have been carried into that tracker.
Activity
github-actions commentedon Jun 29, 2026
This issue might be a duplicate of existing issues. Please check:
PreToolBuild/PostToolBuildhooks for runtime manipulation of the tool list before it is sent to the LLM — closely related to the per-model tool filtering design described here.rekram1-node commentedon Jun 30, 2026
Shipped a band-aid fix in #34558 (merged):
ToolRegistry.materializenow takes the resolved model and gates the edit-tool family the way V1 did — OpenAI/GPT models getapply_patch, every other model getsedit/write. This unblocks the immediate concern (GPT no longer receives edit + write + apply_patch simultaneously).This is intentionally minimal and does not address the actual design ask in this issue, so keeping it open. Still needed for the proper solution:
materialize.Note: a plugin-based approach isn't feasible today — the V2
PluginHosthas notoolcapability and there's no model-aware turn-time hook (onlyaisdk, which sees the model but operates on the language-model object, not the tool roster). The proper design would need that infra first. The architecture already earmarksmaterializeas the filtering seam (tool/builtins.ts: "provider/model filtering belongs to a future materialization phase"), so the band-aid lives in the right place — it just needs to become driven by configuration rather than hardcoded.Related: #19942.
kitlangton commentedon Jul 4, 2026
#34558 fixed the immediate failure mode and added coverage: GPT/OpenAI models receive
apply_patch, while other models receiveedit/write.Keeping this open for the unresolved design: replace the hardcoded provider/model check with configurable policy, define composition and precedence across model/provider/agent/plugin inputs, and decide whether unavailable tools require client representation.
opencode-agent commentedon Jul 5, 2026
Superseded by #35408, which defines the shared V2 model-context hook and includes per-model tool filtering. The remaining precedence and client-representation questions have been carried into that tracker.