fix: adopt config/bus ToolBox constructor contract#12
Conversation
All six built-in ToolBox plugins (SkillMDToolBox, ClockToolBox, FileSystemToolBox, MathToolBox, ShellToolBox, WebSearchToolBox) now forward `__init__(self, config=None, bus=None)` straight to `ToolBox.__init__(config=config, bus=bus)` instead of the old `super().__init__(toolbox_id=self.toolbox_id)` call. `toolbox_id` stays a class attribute matching each plugin's `opm.agents.toolbox` entry-point name, as it already was. AgenticLoopEngine._load_toolboxes_from_config now gets the class from `load_toolbox_plugin(tid)` and instantiates it directly with `cls(config=cfg, bus=bus)` -- no signature guessing, no try/except fallback around construction. This is a coordinated, deliberate alpha breaking change with no back-compat shims, tracking a not-yet-merged ovos-plugin-manager PR that introduces this contract (superseding ovos-plugin-manager#416). Authored with AI assistance (Claude). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 10 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (14)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Reporting for duty! The automated checks have completed. 🎖️I've aggregated the results of the automated checks for this PR below. 🏷️ Release PreviewEnsuring the 'Dependency Updates' are documented. 📦 Current:
✅ PR title follows conventional commit format. 🚀 Release Channel Compatibility Predicted next version:
⚖️ License CheckEnsuring our project remains legally compliant. ✅ ✅ No license violations found. Policy: Apache 2.0 (universal donor). StrongCopyleft / NetworkCopyleft / WeakCopyleft / Other / Error categories fail. MPL allowed. 📋 Repo HealthEvaluating the repository's overall condition. 📋 ✅ All required files present. Latest Version: ✅ 🔌 Plugin DetectionVerifying the plugin's hooks and handles. 🎣 ❌ Plugin Status: ERRORS (1) Plugin Info:
Plugin Types: agents.chat, agents.toolbox, agents.memory OPM Detection:
Entry Point Validation:
⊘ No Issues:
🔒 Security (pip-audit)I've checked the vulnerability database for hits. 🎯 ✅ No known vulnerabilities found (66 packages scanned). 🔌 Skill Tests (ovoscope)Scanning for any 'dead intents' that never fire. 💀 ✅ 6/6 passed ✅ TestLooperMemory — 4/4 🚌 Bus CoverageChecking the 'conversational surface area' of your skill. 🗺️ 📊 CoverageA forensic analysis of your test coverage. 🔍 ✅ 94.6% total coverage Full report: download the 🔨 Build TestsI've poured the digital concrete for this build. 🏗️ ✅ All versions pass
🔍 LintThe results are fresh out of the pipeline. 🏗️ ❌ ruff: issues found — see job log Catch you at the next merge! 🌊 |
…_init__ Maintainer rejected the class-attribute toolbox_id design. No other OPM plugin type declares identity as a class attribute. toolbox_id stays a constructor parameter on the ToolBox base; each concrete toolbox now supplies it explicitly through super().__init__(toolbox_id=..., config=, bus=) using its own entry-point name from pyproject.toml. Loader is unchanged (cls(config=cfg, bus=bus)). Updates the class-attribute assertion test to check the instance attribute after construction instead.
…ader
ovos_plugin_manager.agent_tools (load_toolbox_plugin) is being removed from
OPM. Switch toolbox discovery to find_toolbox_plugins() from
ovos_plugin_manager.persona, which already exists on OPM dev and returns
{toolbox_id: ToolBox subclass}. Construction stays cls(config=cfg, bus=bus).
Update tests and docs to match.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ovos-workshop now emits ovos.utterance.speak instead of the legacy speak topic; the e2e persona pipeline test still asserted on the old name and failed on every Python version once the OPM floor bump (previous commit) let the real ToolBox contract through to the rest of the suite.
What was broken
All six built-in
ToolBoxplugins (SkillMDToolBox,ClockToolBox,FileSystemToolBox,MathToolBox,ShellToolBox,WebSearchToolBox)called
super().__init__(toolbox_id=self.toolbox_id)and had no way toreceive a
bus. This repo's own toolbox loader(
AgenticLoopEngine._load_toolboxes_from_config) assumed a loaderfunction that both looked up and instantiated a plugin by id.
The fix
__init__(self, config=None, bus=None, ...)callssuper().__init__(toolbox_id="<entry-point-name>", config=config, bus=bus), passing its own entry-point id explicitly (verified againstpyproject.toml'sopm.agents.toolboxgroup).toolbox_idis anormal constructor parameter, not a class attribute.
SkillMDToolBoxkeeps its extrabrainkwarg, added afterbus.AgenticLoopEngine._load_toolboxes_from_configcallsfind_toolbox_plugins()fromovos_plugin_manager.persona(theexisting discovery API on OPM dev, returns
{toolbox_id: ToolBox subclass}) and instantiates the matching class directly ascls(config=cfg, bus=bus).find_toolbox_plugins()instead of theremoved loader helper.
This depends on a not-yet-merged
ovos-plugin-managerchange that addsconfigtoToolBox.__init__(self, toolbox_id, config=None, bus=None).Until that lands,
ToolBox.__init__()on OPM dev/release rejects theconfigkwarg and toolbox construction raisesTypeError.Verification
Run in the foreground against the shared dev venv
(
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1,~/.venvs/ovos):test/test_base.py,test/test_coverage.py::Test...LoadToolboxesFromConfig—pass; these cover the discovery/construction logic in
_load_toolboxes_from_configand don't touchToolBox.__init__directly.
test/test_tools.py,test/test_math_toolbox.py,test/test_coverage.py::TestFileSystemToolBoxAdditional,TestFileSystemToolBoxErrorPaths— fail withTypeError: ToolBox.__init__() got an unexpected keyword argument 'config'. Theinstalled OPM base class does not yet accept
config; this isexpected until the paired OPM change merges.
test/end2end/andtest/test_native_toolcall_e2e.py, perinstructions.
Authored with AI assistance (Claude).