fix: replay intent registrations when matchers lose compiled state#467
fix: replay intent registrations when matchers lose compiled state#467JarbasAl wants to merge 1 commit into
Conversation
Registration broadcasts are load-time announcements (OVOS-INTENT-4 §10): an intent matcher (re)constructed after a skill loaded has missed them and matches nothing until they are replayed, e.g. after the intent service reloads its pipeline plugins or restarts while the skill process keeps running. IntentServiceInterface now records vocabulary/entity registration payloads and exposes reregister_all(), replaying every registration currently in effect (re-registration is implicit replacement per OVOS-INTENT-4 §8.1; adapt intents are detached first because legacy consumers append parsers instead of replacing). OVOSSkill replays on the intent service's intent.service.pipelines.loaded announcement and on the bus client's open event after a websocket drop; FallbackSkill additionally re-emits its fallback registration.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
A new update is available for your PR checks! 📥I've aggregated the results of the automated checks for this PR below. 📋 Repo HealthChecking the repo's mental health (aka developer happiness). 😊 ✅ All required files present. Latest Version: ✅ 🔍 LintThe results are in the bag! 🎒 ❌ ruff: issues found — see job log 🔒 Security (pip-audit)I've checked the security of our build pipeline. 🏗️ ✅ No known vulnerabilities found (73 packages scanned). ⚖️ License CheckI've checked the license history of this repo. 📜 ✅ No license violations found. Policy: Apache 2.0 (universal donor). StrongCopyleft / NetworkCopyleft / WeakCopyleft / Other / Error categories fail. MPL allowed. 🔨 Build TestsEnsuring all components are in alignment. 📏
❌ 3.10: Install OK, tests failed Final report submitted. Over and out. 📻 |
Closes the resilience gap where intent matching is permanently lost once the pipeline matchers drop their compiled state while skills keep running.
The problem
Registration broadcasts (
register_vocab,register_intent,padatious:*, fallback registration) are load-time announcements (OVOS-INTENT-4 §10) — the bus has no catch-up channel. A matcher (re)constructed after a skill loaded has missed them and matches nothing: every utterance ends inovos.intent.unmatcheduntil the skill process is restarted. This happens when the intent service reloads its pipeline plugins (intent.service.pipelines.reloadrebuilds every plugin with empty engines) or restarts in a separate process, and can follow a messagebus restart.The fix
IntentServiceInterfacerecords vocabulary/entity registration payloads alongside the already-recorded intents and exposesreregister_all(), which replays every registration currently in effect. Re-registration is implicit replacement (OVOS-INTENT-4 §8.1) so the replay is always safe; adapt intents are detached first because legacy consumers append parsers instead of replacing. Detached intents stay detached.OVOSSkillreplays on two triggers:intent.service.pipelines.loaded— the orchestrator's announcement that pipeline plugins were (re)loaded (emitted by the companion ovos-core change);openevent after a websocket drop, so a messagebus restart can never leave matchers without this skill's registrations.FallbackSkilladditionally re-emits its fallback registration, which lives in the fallback matcher's memory just like intents do.Tests
test/unittests/test_reregister_intents.py: replay fidelity (replayed payloads identical to originals), detach-before-replay for adapt intents, detached intents skipped, skill_id context propagation, both skill-level triggers, and fallback re-registration.Companion PR: ovos-core emits
intent.service.pipelines.loadedafter (re)loading pipeline plugins and adds a real-messagebus end2end regression test that restarts the messagebus process.🤖 Generated with Claude Code