The dupl tool identified 431 clone groups in the codebase.
Significant duplication was found in:
- Provider implementations (
anthropic, google, openai, openrouter, openaicompat)
language_model_hooks.go
provider_options.go
- Core provider logic
agent.go
- Test files (
*_test.go, providertests)
We should refactor this code to use shared abstractions where possible to improve maintainability and reduce technical debt.