Repository navigation
refactor: assemble the tool list in one place, drop the compat shim - #1552
Conversation
|
Understand this PR’s impact Explore downstream dependencies and potential security impact with Blast Radius. Warning Review limit reachedNext included review available in 38 minutes. View limit detailsLimit details: You’ve used all 2 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository: mozilla-ai/clawbolt/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (44)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: mozilla-ai/clawbolt/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (43)
💤 Files with no reviewable changes (4)
Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review. WalkthroughThe PR centralizes agent tool assembly for runtime and preview paths, removes the ChangesAgent runtime and module cleanup
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Refactor 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
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 |
2fb965a to
26534bc
Compare
f381a27 to
bdc25ef
Compare
26534bc to
c1be62a
Compare
bdc25ef to
9bf5244
Compare
c1be62a to
aaa8213
Compare
9bf5244 to
773ca35
Compare
773ca35 to
e8d1071
Compare
The runtime turn, the heartbeat's Phase 2 agent, and the system-prompt
preview each built the same six-step tool list inline: core tools, ready
specialists, then list_capabilities when anything was left to discover.
Three copies meant the preview could drift from what the agent was handed.
assemble_turn_tools in tool_assembly.py is now that build, and all three
call it. Heartbeat's media auto-approve moves after the call, where it
reads as the exception it is.
Tests that patched the registry through backend.app.agent.tools.registry
were relying on heartbeat's deferred import; they now patch
backend.app.agent.tool_assembly, which is the module that uses it.
Also in this commit:
- deleted agent/file_store.py, a re-export shim kept for backwards
compatibility the project does not need before its first release,
and pointed its 34 importers at the owning modules
- webchat's upload size check now calls check_media_size instead of
repeating the comparison, which also aligns its rejection message
with the rest of the media pipeline
- removed three functions nothing called: latest_saved_file,
_disk_path_for, get_is_allowed_override
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
e8d1071 to
253cd36
Compare
Description
Third of five. Targets #1551.
assemble_turn_tools. The runtime turn, the heartbeat's Phase 2 agent, and the system-prompt preview each built the same six-step tool list inline, so the preview could drift from what the agent was handed. One function now, called by all three.agent/file_store.py, a re-export shim kept for backwards compatibility this project does not need before its first release. Its 34 importers point at the owning modules.webchatupload size check callscheck_media_sizeinstead of repeating the comparison, which aligns its rejection message with the rest of the media pipeline.latest_saved_file,_disk_path_for,get_is_allowed_override.Tests that patched the registry through
backend.app.agent.tools.registrywere relying on heartbeat's deferred import. They now patchbackend.app.agent.tool_assembly, the module that uses it.Type
Checklist
uv run pytest -v): 4268 passed, 6 skipped, unchangedruff check backend/ && ruff format --check backend/)AI Usage
🤖 Generated with Claude Code
Summary
assemble_turn_toolsfor runtime turns, heartbeat tasks, and system-prompt previews.file_store.pycompatibility shim and updated imports to use dedicated modules.check_media_size.Benefits