Skip to content

fix: skip malformed template lines instead of failing the whole resource#466

Open
JarbasAl wants to merge 2 commits into
devfrom
fix/malformed-template-resilience
Open

fix: skip malformed template lines instead of failing the whole resource#466
JarbasAl wants to merge 2 commits into
devfrom
fix/malformed-template-resilience

Conversation

@JarbasAl

Copy link
Copy Markdown
Member

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 — raised MalformedTemplate during 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, VocabularyFile and BlacklistFile now 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. DialogFile and the IntentFile data-formatting step likewise skip lines whose placeholders cannot be resolved. The deprecated expand_template import is replaced by ovos_spec_tools.expand.
  • ovos_workshop/intents.py: register_padatious_intent / register_padatious_entity validate 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.py covers .intent, .voc, .blacklist, .dialog loading and the padatious intent/entity bus emission, including the zero-valid-lines case.

🤖 Generated with Claude Code

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

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

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

Next review available in: 32 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

Run ID: 4ba98476-1315-4c34-9646-aac934f7a49c

📥 Commits

Reviewing files that changed from the base of the PR and between 72993f3 and 13c02c1.

📒 Files selected for processing (3)
  • ovos_workshop/intents.py
  • ovos_workshop/resource_files.py
  • test/unittests/test_malformed_template_resilience.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/malformed-template-resilience

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 16, 2026
@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Greetings! The CI pipeline has delivered its findings. 🏗️

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

📋 Repo Health

Evaluating the repository's overall condition. 📋

✅ All required files present.

Latest Version: 9.2.0a1

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

🔍 Lint

Just a little bit of automation magic for you. ✨

ruff: issues found — see job log

🔨 Build Tests

Checking if the architectural integrity holds up. 🏛️

✅ All versions pass

Python Build Install Tests
3.10
3.11
3.12
3.13
3.14

⚖️ License Check

Ensuring 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! 🙌

@JarbasAl
JarbasAl marked this pull request as ready for review July 16, 2026 20:57
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