Skip to content

fix: voc_list loads the vocabulary for the requested lang - #611

Closed
JarbasAl wants to merge 1 commit into
devfrom
fix/voc-list-lang
Closed

JarbasAl wants to merge 1 commit into
devfrom
fix/voc-list-lang

Conversation

@JarbasAl

@JarbasAl JarbasAl commented Sep 8, 2026

Copy link
Copy Markdown
Member

🤖 Auto-generated by Claude Code (claude-fable-5-1) — NOT human-reviewed. Verify before acting. The reproduction, the fail-before run and the suite counts below were executed by the same model; nothing here has been checked by a human.

Fixes #610.

voc_list used its lang argument only for the cache key and read the vocabulary from self.resources, which is bound to self.lang. With the skill in en-US and colour.voc shipped for both en-US (red, blue) and es-ES (rojo, azul), voc_list("colour", "es-ES") returned ['red', 'blue'], so voc_match("quiero rojo", "colour", lang="es-ES") was False and voc_match("I want red", "colour", lang="es-ES") was True.

The change is one line: the vocabulary is loaded from self.load_lang(lang=lang), the skill's existing per-language SkillResources loader (self.resources is the same call with self.lang). The per-language cache key is unchanged, so repeated calls still hit the cache.

test_voc_list and test_voc_match in test/unittests/skills/test_ovos.py (previously TODO placeholders) build a skill with both locale files and assert the es-ES list, the en-US list before and after an es-ES call, and the two voc_match outcomes. With the source change reverted both tests fail (['red', 'blue'] != ['rojo', 'azul']; False is not true); with it applied both pass.

Unit suite: 701 passed, 1 failed (test_scheduler_delegation::test_a_delay_in_seconds_becomes_a_relative_timing, KeyError: 'owner'), and that one failure reproduces on a fresh clone of origin/dev at 09050fb in the same venv, so it is not from this change. End-to-end suite: 13 passed.

voc_list used its lang argument only to build the cache key and then read
the vocabulary from self.resources, which is bound to self.lang. Asking for
another language returned the skill's current-language words: with the skill
in en-US, voc_list("colour", "es-ES") returned the en-US list, so
voc_match("quiero rojo", "colour", lang="es-ES") was False while
voc_match("I want red", "colour", lang="es-ES") was True.

voc_list now loads the SkillResources for the requested lang through
load_lang, which already caches one SkillResources per language; the
per-language cache key is unchanged.

Regression tests: test_voc_list and test_voc_match in
test/unittests/skills/test_ovos.py, both failing before the fix
(['red', 'blue'] != ['rojo', 'azul']; voc_match on "quiero rojo" False) and
passing after. Unit suite: 701 passed, 1 pre-existing failure
(test_scheduler_delegation, also red on dev); end2end 13 passed.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

The results of your automated verification are here! 📜

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

📡 Channel Compat — stable

I've finished the digital walk-through of your PR. 🚶‍♂️

🚧 Channel unresolvable with this checkout — the repo's dependency floors exceed what the channel pins (fleet finding; see the install log).

Constraints: https://raw.githubusercontent.com/OpenVoiceOS/OpenVoiceOS/main/constraints-stable.txt
Resolved stack: channel-compat-stable artifact (constraints + pip freeze).

📡 Channel Compat — testing

A detailed summary of the latest automation run. 📝

🚧 Channel unresolvable with this checkout — the repo's dependency floors exceed what the channel pins (fleet finding; see the install log).

Constraints: https://raw.githubusercontent.com/OpenVoiceOS/OpenVoiceOS/main/constraints-testing.txt
Resolved stack: channel-compat-testing artifact (constraints + pip freeze).

📋 Repo Health

I've checked the repo's eyesight (aka observability). 👓

✅ All required files present.

Latest Version: 9.7.0a2

✅ 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

⚖️ License Check

Checking for any restrictive patent clauses. 📜

✅ No license violations found.

Policy: Apache 2.0 (universal donor). StrongCopyleft / NetworkCopyleft / WeakCopyleft / Other / Error categories fail. MPL allowed.

🔍 Lint

I've tidied up the results for you. 🧹

❌ ruff: issues found — see job log

🔒 Security (pip-audit)

Checking for any potential security breaches. 🔓

✅ No known vulnerabilities found (72 packages scanned).

🔨 Build Tests

Checking the alignment of our build components. 📏

Python Build Install Tests
3.10 ✅ ✅ ⚠️
3.11 ✅ ✅ ⚠️
3.12 ✅ ✅ ⚠️
3.13 ✅ ✅ ⚠️
3.14 ✅ ✅ ⚠️

❌ 3.10: Install OK, tests failed
❌ 3.11: Install OK, tests failed
❌ 3.12: Install OK, tests failed
❌ 3.13: Install OK, tests failed
❌ 3.14: Install OK, tests failed
Check job logs for details.


A robot's work is never done... but this PR check is! ⚙️

@JarbasAl JarbasAl closed this Sep 13, 2026
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.

OVOSSkill.voc_list ignores its lang argument

1 participant