From 90e8cf466c00548cad1fbd706ae5001801fcdd3c Mon Sep 17 00:00:00 2001 From: zhuzx17 <103081686+zhuzx17@users.noreply.github.com> Date: Fri, 20 Nov 2026 10:31:57 +0000 Subject: [PATCH 1/3] Initial plan From ec342cd2cab34c974cdde8d2747782f77754d3d8 Mon Sep 17 00:00:00 2001 From: zhuzx17 <103081686+zhuzx17@users.noreply.github.com> Date: Fri, 20 Nov 2026 10:41:55 +0000 Subject: [PATCH 2/3] Fix capability semantic lookup compatibility Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- src/linkerbot_hand/capabilities/types.py | 12 ++++++++++-- .../hand/api_v1/test_capabilities_and_conversion.py | 7 +++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/linkerbot_hand/capabilities/types.py b/src/linkerbot_hand/capabilities/types.py index 9e29670..4666386 100644 --- a/src/linkerbot_hand/capabilities/types.py +++ b/src/linkerbot_hand/capabilities/types.py @@ -321,7 +321,11 @@ def command(self, semantic: CommandSemantic) -> CommandCapability | None: """Look up writable metadata without device I/O.""" return next( - (value for value in self.commands if value.semantic is semantic), + ( + value + for value in self.commands + if value.semantic == semantic + ), None, ) @@ -332,7 +336,11 @@ def telemetry_channel( """Look up readable/cache metadata without device I/O.""" return next( - (value for value in self.telemetry if value.semantic is semantic), + ( + value + for value in self.telemetry + if value.semantic == semantic + ), None, ) diff --git a/tests/hand/api_v1/test_capabilities_and_conversion.py b/tests/hand/api_v1/test_capabilities_and_conversion.py index d1d4091..0610eeb 100644 --- a/tests/hand/api_v1/test_capabilities_and_conversion.py +++ b/tests/hand/api_v1/test_capabilities_and_conversion.py @@ -76,6 +76,13 @@ def test_supported_model_names_are_canonical_and_stable() -> None: ) +def test_capability_lookup_accepts_equivalent_string_semantics() -> None: + capabilities = get_declared_capabilities("l6", side="left") + + assert capabilities.command("angles") is not None # ty: ignore[invalid-argument-type] + assert capabilities.telemetry_channel("angles") is not None # ty: ignore[invalid-argument-type] + + @pytest.mark.parametrize( ("model", "canonical"), ( From 081c3a8f6ecd7941c032a4eaf18eab54742bb4e8 Mon Sep 17 00:00:00 2001 From: zhuzx17 <103081686+zhuzx17@users.noreply.github.com> Date: Fri, 20 Nov 2026 10:43:39 +0000 Subject: [PATCH 3/3] Format capability lookup implementation Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- src/linkerbot_hand/capabilities/types.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/linkerbot_hand/capabilities/types.py b/src/linkerbot_hand/capabilities/types.py index 4666386..df7ae02 100644 --- a/src/linkerbot_hand/capabilities/types.py +++ b/src/linkerbot_hand/capabilities/types.py @@ -321,11 +321,7 @@ def command(self, semantic: CommandSemantic) -> CommandCapability | None: """Look up writable metadata without device I/O.""" return next( - ( - value - for value in self.commands - if value.semantic == semantic - ), + (value for value in self.commands if value.semantic == semantic), None, ) @@ -336,11 +332,7 @@ def telemetry_channel( """Look up readable/cache metadata without device I/O.""" return next( - ( - value - for value in self.telemetry - if value.semantic == semantic - ), + (value for value in self.telemetry if value.semantic == semantic), None, )