fix: skip malformed template lines instead of failing the whole resource#466
fix: skip malformed template lines instead of failing the whole resource#466JarbasAl wants to merge 2 commits into
Conversation
A single malformed template line in a locale file (translated slot name, truncated slot, adjacent slots, unbalanced group) previously raised MalformedTemplate while loading the resource, so none of the file's valid lines were loaded and the intent was never registered for that language. Each malformed line is now skipped with a warning identifying the skill, resource, language and offending line; the remaining valid lines load and register normally. When a file has no valid lines left, the registration is skipped entirely with a warning instead of raising. The padatious registration payload emitted on the bus now excludes the skipped lines as well, for both intent and entity files. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 32 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 Run ID: 📒 Files selected for processing (3)
✨ 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 |
Greetings! The CI pipeline has delivered its findings. 🏗️I've aggregated the results of the automated checks for this PR below. 📋 Repo HealthEvaluating the repository's overall condition. 📋 ✅ All required files present. Latest Version: ✅ 🔍 LintJust a little bit of automation magic for you. ✨ ❌ ruff: issues found — see job log 🔨 Build TestsChecking if the architectural integrity holds up. 🏛️ ✅ All versions pass
⚖️ License CheckEnsuring our legal documentation is accessible. 📖 ✅ No license violations found. Policy: Apache 2.0 (universal donor). StrongCopyleft / NetworkCopyleft / WeakCopyleft / Other / Error categories fail. MPL allowed. 🔒 Security (pip-audit)Checking if we're following security best practices. 📏 ✅ No known vulnerabilities found (73 packages scanned). Thanks for making OVOS better today! 🙌 |
Summary
A single malformed template line in a skill's locale file — a translated slot name (
{Medien}), a truncated slot ({location), adjacent slots, or an unbalanced group — raisedMalformedTemplateduring resource loading / intent registration. The exception aborted the whole file, so every valid line was lost and the intent was never registered for that language.Changes
ovos_workshop/resource_files.py:IntentFile,VocabularyFileandBlacklistFilenow expand each line individually; a malformed line is skipped with a warning (skill id, resource name, language, offending line) and the remaining lines load normally.DialogFileand theIntentFiledata-formatting step likewise skip lines whose placeholders cannot be resolved. The deprecatedexpand_templateimport is replaced byovos_spec_tools.expand.ovos_workshop/intents.py:register_padatious_intent/register_padatious_entityvalidate each sample before emitting the registration message, so the wire payload excludes malformed lines. When no valid lines remain the registration is skipped with a warning instead of raising. Inline<name>vocabulary references are preserved — they resolve downstream at match time.Tests
test/unittests/test_malformed_template_resilience.pycovers .intent, .voc, .blacklist, .dialog loading and the padatious intent/entity bus emission, including the zero-valid-lines case.🤖 Generated with Claude Code