Skip to content

Migrate to pyproject.toml and register as ChatEngine (opm.agents.chat) - #18

Merged
JarbasAl merged 1 commit into
devfrom
feat/pyproject-chatengine
Aug 14, 2026
Merged

Migrate to pyproject.toml and register as ChatEngine (opm.agents.chat)#18
JarbasAl merged 1 commit into
devfrom
feat/pyproject-chatengine

Conversation

@JarbasAl

@JarbasAl JarbasAl commented Aug 14, 2026

Copy link
Copy Markdown
Member

🤖 Auto-generated by Claude Opus 5 (claude-opus-5) via Claude Code — NOT human-reviewed. Verify before acting.

This repo was still a setup.py package, and its only entry point was the pre-OPM neon.plugin.solver group. I went and checked what current ovos-plugin-manager (2.11.1a2, the version this venv actually runs) does with that group before touching anything, because I did not want to assume. It turns out neon.plugin.solver is aliased to opm.solver.question through a backwards-compat shim in find_plugins, so this plugin is not literally invisible today, it still answers through the deprecated QuestionSolver path. But that alias only exists because opm.solver.question itself is deprecated and slated for removal in ovos-plugin-manager 3.0.0, and RiveScript is a pattern matcher with no real use for a QuestionSolver's single-turn API, so leaving it there just delays the actual breakage instead of fixing it.

So this PR does two things. First it swaps setup.py for a pyproject.toml, following the same layout as ovos-solver-plugin-aiml (the closest sibling, also a classic chatbot solver already migrated). Second it ports the RiveScript brain to a ChatEngine and registers it under opm.agents.chat, which is the group ovos-persona-server and any future OVOS persona pipeline actually query going forward. continue_chat takes the last user message and asks the brain for a reply the same way the old get_spoken_answer did; it accepts a tools keyword because the base ChatEngine.continue_chat signature requires it, but RiveScript has no notion of tool calling so it is ignored and supports_tools stays False.

The old RivescriptSolver class is untouched and still registered under neon.plugin.solver, so anything that still loads it by that old group keeps working exactly as before. Nothing was removed, only added and reorganized.

I installed the plugin in two fresh venvs to check this rather than trust the diff: one against this branch, one against unmodified dev. find_plugins("opm.agents.chat") returns {} on unmodified dev and returns {'ovos-solver-rivescript-plugin': <class 'ovos_solver_rivescript_plugin.RivescriptChatEngine'>} on this branch. find_plugins("neon.plugin.solver") still returns the original RivescriptSolver class on both. There were no tests in this repo before; I added test/test_plugin.py covering both entry points and a continue_chat call including a tools= kwarg to prove it does not raise. All 5 tests pass. A separate PR builds a Docker image on top of this one and does a live chat-completions round trip against the resulting server.

Summary by CodeRabbit

  • New Features

    • Added chat-engine support for RiveScript conversations.
    • Added modern and legacy plugin registration for solver and chat integrations.
    • Added compatibility with older plugin-manager versions.
  • Improvements

    • Added automated build checks for pull requests and manual runs.
    • Streamlined stable publishing and release synchronization workflows.
  • Tests

    • Added coverage for responses, plugin discovery, message roles, and tool handling.
  • Release

    • Updated the package version to 0.1.0a1.

Move packaging from setup.py to pyproject.toml, matching the sibling
ovos-solver-plugin-aiml layout, and register the plugin under the modern
opm.agents.chat entry point group by porting RiveScript to ChatEngine.

The legacy neon.plugin.solver entry point is kept pointing at the original
RivescriptSolver class, so nothing that still looks there breaks.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 19a64ebc-496a-482c-ba66-3a5a666a5acb

📥 Commits

Reviewing files that changed from the base of the PR and between ac260b6 and cf7ae70.

📒 Files selected for processing (8)
  • .github/workflows/build-tests.yml
  • .github/workflows/publish_stable.yml
  • ovos_solver_rivescript_plugin/__init__.py
  • ovos_solver_rivescript_plugin/version.py
  • pyproject.toml
  • requirements.txt
  • setup.py
  • test/test_plugin.py

📝 Walkthrough

Walkthrough

The package moves to pyproject.toml, adds RivescriptChatEngine, registers solver and chat entry points, adds plugin tests, updates the version, and introduces build and stable-release workflows.

Changes

Plugin packaging and release integration

Layer / File(s) Summary
Packaging and compatibility contracts
pyproject.toml, ovos_solver_rivescript_plugin/version.py, ovos_solver_rivescript_plugin/__init__.py, setup.py, requirements.txt
Packaging metadata and entry points move to pyproject.toml. The version becomes 0.1.0a1. Legacy dependency and setup configuration are removed. Compatibility imports support older plugin-manager versions.
RiveScript chat engine
ovos_solver_rivescript_plugin/__init__.py
RivescriptChatEngine loads a RiveScript brain and returns an assistant message for the latest user message. Empty queries return an empty assistant message.
Plugin registration and response validation
test/test_plugin.py
Tests validate solver responses, chat responses, ignored tools, disabled tool support, and registration under both plugin groups.
Build and stable-release automation
.github/workflows/build-tests.yml, .github/workflows/publish_stable.yml
Build tests run for pull requests and manual dispatches across Python 3.10–3.14. Stable publishing uses a guarded reusable workflow with explicit permissions and secrets.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant RivescriptChatEngine
  participant RiveScriptBrain
  Caller->>RivescriptChatEngine: continue_chat(messages)
  RivescriptChatEngine->>RiveScriptBrain: reply(latest user message)
  RiveScriptBrain-->>RivescriptChatEngine: response text
  RivescriptChatEngine-->>Caller: assistant AgentMessage
Loading
✨ Finishing Touches 💡 1
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch feat/pyproject-chatengine
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/pyproject-chatengine

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

Copy link
Copy Markdown

I've completed the automated review of your changes. 📑

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

🔨 Build Tests

Measuring the stability of the build output. 📏

✅ All versions pass

Python Build Install Tests
3.10
3.11
3.12
3.13
3.14

Your loyal script, at your command 🫡

@JarbasAl
JarbasAl marked this pull request as ready for review August 14, 2026 01:09
@JarbasAl
JarbasAl merged commit dc6e641 into dev Aug 14, 2026
8 checks passed
@JarbasAl
JarbasAl deleted the feat/pyproject-chatengine branch August 14, 2026 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant