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
Maintainability Risk: High — Both patterns are in hot paths. A bug fix or behavioral change in one copy is unlikely to be applied consistently to the others without a helper extraction.
Refactoring Priority: Medium — The code works correctly today but will accumulate drift. Extracting shared helpers is low-risk and follows the existing codebase idiom (e.g., newErrorCallToolResult, parseToolArguments, writeJSONResponse).
Next Steps
Review individual pattern sub-issues for detailed analysis
Summary
Analysis of commit
4b13882bac5052cd1febf6bf92b5a3727f16b1a3(refactor: consolidate micro-files and extract Docker helpers) identified 2 significant duplication patterns ininternal/server/unified.go. Both patterns represent structural duplication of backend request/response handling logic.Detected Patterns
Overall Impact
internal/server/unified.go)newErrorCallToolResult,parseToolArguments,writeJSONResponse).Next Steps
executeBackendToolCallhelper to unify the backend call block (sub-issue [duplicate-code] Duplicate Code Pattern: Backend Tool Call Execution Block #1662)callSysServerhelper to unify sysServer delegation (sub-issue [duplicate-code] Duplicate Code Pattern: Sys Tool sysServer Delegation Block #1663)Analysis Metadata
internal/server/unified.go4b13882bac5052cd1febf6bf92b5a3727f16b1a3