Repository navigation
Add claude_tool_bridge plugin - #613
Open
spcdatapro wants to merge 1 commit into
Open
spcdatapro wants to merge 1 commit into
spcdatapro wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
claude_tool_bridgeClaude Tool Bridge makes Claude 5 models (for example
claude-sonnet-5-5) work in Agent Zero's chat mode.Agent Zero talks to Anthropic in chat mode, without native tools, so a model must write each call as
{"tool_name": ..., "tool_args": {...}}. Some Claude models keep writing their native syntax instead(
<invoke name="..."><parameter name="...">...</parameter></invoke>); Agent Zero treats those replies as unusable andstops the agent after repeated ones. In a replay of 20 real prompts,
claude-sonnet-5-5produced an unusable reply in45-90 % of the turns depending on its thinking settings, almost always a correct call in the wrong syntax.
Translates the first complete
<invoke>of a reply into a JSON tool request before_context_doctorsees it; prosewritten before the call becomes
thoughts.Types arguments from the tool schema, then from Agent Zero's own usage examples; strings that look like JSON stay strings.
Understands
tool:methodnames, MCP tools,antml:prefixes,<function_calls>wrappers andthoughts/headline/tool_argswritten as parameters.Optionally stops the model stream at the first translatable
</invoke>(early_stop, on by default).Leaves a reply untouched when it already holds a JSON call, when the
<invoke>is quoted (code fence or mid-line),when the tool is unknown or a required argument is missing, or when the chat model is not configured
(
providers: [anthropic],model_patterns: ["claude-*"]by default).Plugin repository: https://github.com/spcdatapro/claude-tool-bridge
License: MIT (
LICENSEat the repository root)plugin.yamlname(claude_tool_bridge) matches the folder name in this PRChecks
scripts/validate_plugin_submission.pylocally on this branch, with the currentgenerated-indexreleaseindex.jsonin place for the duplicate checks: passed.plugins/claude_tool_bridge/index.yaml.Sonnet 5.5 replies rescued, no change to the 84 usable ones); a live replay of the same 20 prompts with the plugin
(
claude-sonnet-5-5: 18/20 to 1/20 unusable replies in one configuration and 9/20 to 1/20 in another;claude-opus-5-5control unchanged at 0/20); and a multi-step task in a real instance.context_doctorplugin repairs malformed JSON tool calls; this plugin handles replies thatuse Claude's XML call syntax instead of JSON, and defers to JSON whenever the reply holds a usable call.
Safety notes for reviewers
eval/exec, no third-party dependencies (standard library and the framework only).message_loop_result) and wraps the response callback of thecurrent model call (
call_chat_model_turn). Nothing is written to disk and no API handlers are added._context_doctor, tool policy andtool execution). If anything in the plugin fails, the reply is left untouched.
🤖 Generated with Claude Code