fix: make Tesla action commands case-insensitive#1522
Merged
openminddev merged 3 commits intoOpenMind:mainfrom Jan 19, 2026
Merged
fix: make Tesla action commands case-insensitive#1522openminddev merged 3 commits intoOpenMind:mainfrom
openminddev merged 3 commits intoOpenMind:mainfrom
Conversation
Commands from LLM output may have varying capitalization (e.g., "Lock Doors", "LOCK DOORS", "lock doors"). Previously, only exact lowercase match worked. Changes: - Normalize action string to lowercase before comparison - Add comprehensive test suite with 19 test cases covering all commands - Test various case combinations: lowercase, Title Case, UPPERCASE, mixed This ensures reliable command execution regardless of LLM output formatting.
6f8d8ce to
f00b4f7
Compare
Consolidated and refactored case-insensitive command tests for the Tesla connector, removing redundant class wrappers and improving test parametrization. Added tests for error logging on unknown actions and missing JWT. Removed unnecessary comments and docstrings for brevity.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes case-sensitive string comparison in
DIMOTeslaConnectorthat caused Tesla commands to fail when LLM output had different capitalization.Problem
File:
src/actions/dimo/connector/tesla.pyThe connector compared action strings with exact match:
Impact:
Root Cause
LLM models don't guarantee consistent casing in their outputs. The same prompt might return:
"lock doors"(lowercase)"Lock Doors"(title case)"LOCK DOORS"(uppercase)"Lock doors"(sentence case)Solution
Normalize the action string to lowercase before comparison:
Testing
Added comprehensive test suite in
tests/actions/dimo/test_tesla.pywith 19 test cases:"lock doors","Lock Doors","LOCK DOORS","Lock doors","lOcK dOoRs""unlock doors","Unlock Doors","UNLOCK DOORS""open frunk","Open Frunk","OPEN FRUNK""open trunk","Open Trunk","OPEN TRUNK""idle","Idle","IDLE"Plus basic tests for unknown actions and missing JWT handling.
Test Results:
Before & After
"lock doors""Lock Doors""LOCK DOORS""lOcK dOoRs"Checklist
pyrightpasses with 0 errorspre-commithooks pass (black, ruff, isort)