fix: remove accidental 'from json import tool' import; align abstract completion() default - #2406
Conversation
|
✅ Deploy Preview for holmes-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. WalkthroughThe abstract ChangesLLM interface cleanup
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to The changes remove an unused import and replace a mutable abstract-method default without changing runtime behavior; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
… abstract completion() Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Harshad Khetpal <harshadkhetpal@users.noreply.github.com>
f5c610f to
bb1bc9e
Compare
Summary
holmes/core/tool_calling_llm.py— line 3 hasfrom json import tool, which imports Python'sjson.toolCLI module (the thing behindpython -m json.tool). It looks like an IDE auto-import accident: the name is never used as that module — every use oftoolin this file is a local variable (tool = self.tool_executor.get_tool_by_name(...)) that shadows it, which is why ruff reports F811 twice. Removed the import.holmes/core/llm.py— the abstractcompletion()declarestools: Optional[List[Dict[str, Any]]] = [](mutable default, ruff B006), while the concrete implementation of the same method in this same file already uses= None. Aligned the abstract signature to= None.Testing
python -m py_compilepasses on both files;ruff check --select F811,B006goes from 3 errors to clean. No behavior change: the removed import was shadowed everywhere, and the abstract method's default is never executed (implementations define their own).🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Chores