Skip to content

fix: adopt config/bus ToolBox constructor contract#12

Merged
JarbasAl merged 5 commits into
devfrom
fix/toolbox-config-bus-contract
Jul 24, 2026
Merged

fix: adopt config/bus ToolBox constructor contract#12
JarbasAl merged 5 commits into
devfrom
fix/toolbox-config-bus-contract

Conversation

@JarbasAl

@JarbasAl JarbasAl commented Jul 23, 2026

Copy link
Copy Markdown
Member

What was broken

All six built-in ToolBox plugins (SkillMDToolBox, ClockToolBox,
FileSystemToolBox, MathToolBox, ShellToolBox, WebSearchToolBox)
called super().__init__(toolbox_id=self.toolbox_id) and had no way to
receive a bus. This repo's own toolbox loader
(AgenticLoopEngine._load_toolboxes_from_config) assumed a loader
function that both looked up and instantiated a plugin by id.

The fix

  • Each toolbox's __init__(self, config=None, bus=None, ...) calls
    super().__init__(toolbox_id="<entry-point-name>", config=config, bus=bus), passing its own entry-point id explicitly (verified against
    pyproject.toml's opm.agents.toolbox group). toolbox_id is a
    normal constructor parameter, not a class attribute.
  • SkillMDToolBox keeps its extra brain kwarg, added after bus.
  • AgenticLoopEngine._load_toolboxes_from_config calls
    find_toolbox_plugins() from ovos_plugin_manager.persona (the
    existing discovery API on OPM dev, returns {toolbox_id: ToolBox subclass}) and instantiates the matching class directly as
    cls(config=cfg, bus=bus).
  • Docs updated to describe find_toolbox_plugins() instead of the
    removed loader helper.

This depends on a not-yet-merged ovos-plugin-manager change that adds
config to ToolBox.__init__(self, toolbox_id, config=None, bus=None).
Until that lands, ToolBox.__init__() on OPM dev/release rejects the
config kwarg and toolbox construction raises TypeError.

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_config and don't touch ToolBox.__init__
    directly.
  • test/test_tools.py, test/test_math_toolbox.py,
    test/test_coverage.py::TestFileSystemToolBoxAdditional,
    TestFileSystemToolBoxErrorPaths — fail with TypeError: ToolBox.__init__() got an unexpected keyword argument 'config'. The
    installed OPM base class does not yet accept config; this is
    expected until the paired OPM change merges.
  • Skipped: test/end2end/ and test/test_native_toolcall_e2e.py, per
    instructions.

Authored with AI assistance (Claude).

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>
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@JarbasAl, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 10 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 52911788-ee84-4a4b-8ed2-854c6f682af0

📥 Commits

Reviewing files that changed from the base of the PR and between 726a122 and 7175954.

📒 Files selected for processing (14)
  • docs/index.md
  • docs/opm-integration.md
  • ovos_agentic_loop/base.py
  • ovos_agentic_loop/skills/toolbox.py
  • ovos_agentic_loop/tools/clock.py
  • ovos_agentic_loop/tools/filesystem.py
  • ovos_agentic_loop/tools/math.py
  • ovos_agentic_loop/tools/shell.py
  • ovos_agentic_loop/tools/web.py
  • pyproject.toml
  • test/end2end/test_e2e_persona_pipeline.py
  • test/test_base.py
  • test/test_coverage.py
  • test/test_tools.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/toolbox-config-bus-contract

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the fix label Jul 23, 2026
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown

Reporting for duty! The automated checks have completed. 🎖️

I've aggregated the results of the automated checks for this PR below.

🏷️ Release Preview

Ensuring the 'Dependency Updates' are documented. 📦

Current: 0.2.1a3Next: 0.2.2a1

Signal Value
Label fix
PR title fix: adopt config/bus ToolBox constructor contract
Bump build

✅ PR title follows conventional commit format.


🚀 Release Channel Compatibility

Predicted next version: 0.2.2a1

Channel Status Note Current Constraint
Stable Not in channel -
Testing Not in channel -
Alpha Compatible ovos-agentic-loop>=0.1.1a1

⚖️ License Check

Ensuring 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 Health

Evaluating the repository's overall condition. 📋

✅ All required files present.

Latest Version: 0.2.1a3

ovos_agentic_loop/version.py — Version file
README.md — README
LICENSE — License file
pyproject.toml — pyproject.toml
⚠️ setup.py — setup.py
CHANGELOG.md — Changelog
ovos_agentic_loop/version.py has valid version block markers

🔌 Plugin Detection

Verifying the plugin's hooks and handles. 🎣

Plugin Status: ERRORS (1)

Plugin Info:

  • Name: ovos-agentic-loop
  • Description: AgenticLoopEngine base and ReAct implementation for OVOS, with SKILL.md and AGENTS.md runtime consumption

Plugin Types: agents.chat, agents.toolbox, agents.memory

OPM Detection:

Plugin Type Wheel Editable
agents.chat
agents.memory
agents.toolbox

Entry Point Validation:

Entry Point Type Import Interface
ovos-agents-md-context-plugin agents.memory ✅ 1ms
ovos-chain-of-thought-loop agents.chat
ovos-clock-tools agents.toolbox
ovos-critic-loop agents.chat
ovos-filesystem-tools agents.toolbox ✅ 43ms
ovos-math-tools agents.toolbox
ovos-native-toolcall-loop agents.chat
ovos-plan-execute-loop agents.chat
ovos-react-loop agents.chat ✅ 861ms
ovos-reflexion-loop agents.chat
ovos-self-ask-loop agents.chat
ovos-shell-tools agents.toolbox
ovos-skill-md-toolbox agents.toolbox ✅ 237ms
ovos-tree-of-thoughts-loop agents.chat
ovos-web-search-tools agents.toolbox

⊘ No settingsmeta.json
requires-python >=3.10 — running Python 3.11

Issues:

  • ❌ Import time for ovos-react-loop exceeds 500ms (861ms)
  • ⚠️ No settingsmeta.json found
  • ⚠️ No settingsmeta.json found

🔒 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
TestLooperPersonaSpeaks — 2/2

🚌 Bus Coverage

Checking the 'conversational surface area' of your skill. 🗺️

⚠️ Bus coverage report unavailable — check the job log.

📊 Coverage

A forensic analysis of your test coverage. 🔍

94.6% total coverage

Full report: download the coverage-report artifact.

🔨 Build Tests

I've poured the digital concrete for this build. 🏗️

✅ All versions pass

Python Build Install Tests
3.10
3.11
3.12
3.13
3.14

🔍 Lint

The 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.
@github-actions github-actions Bot added fix and removed fix labels Jul 23, 2026
…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>
@github-actions github-actions Bot added fix and removed fix labels Jul 23, 2026
JarbasAl added 2 commits July 24, 2026 00:32
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.
@JarbasAl
JarbasAl marked this pull request as ready for review July 24, 2026 00:02
@JarbasAl
JarbasAl merged commit f6ef8b1 into dev Jul 24, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant