[claude] Break up MCPBridge.run() into helper methods (#1135) #1148
Reference in New Issue
Block a user
Delete Branch "claude/issue-1135"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #1135
What
Refactored
MCPBridge.run()insrc/timmy/mcp_bridge.pyfrom 129 lines down to ~35 lines of logic by extracting three private helper methods:_build_initial_messages()— static method that constructs the initial prompt message list_process_round_tool_calls()— executes all tool calls in a single round and appends results to the message history_run_tool_loop()— drives the multi-round tool-call loop, returns a(content, tool_calls_made, rounds, error)tupleError recovery is consolidated into a single
BridgeResultreturn at the end ofrun()instead of three separate returns.All 20 existing unit tests pass.