fix: compare bound method by equality, not identity

Bound methods are created fresh on each attribute access, so
'self._missing_function_call_handler is self._missing_function_call_handler'
is always False. Using 'is' meant the placeholder branch never fired and
both warnings logged when a function was missing at queue time.

Switch to == so equality compares the underlying function and instance.
Strengthen the missing-at-queue-time test to assert the second warning
does not fire.
This commit is contained in:
borislav
2026-04-27 17:34:31 +02:00
parent 822392b0d4
commit 8869e25142
2 changed files with 19 additions and 12 deletions

View File

@@ -792,7 +792,7 @@ class LLMService(UserTurnCompletionLLMServiceMixin, AIService):
item = self._functions[runner_item.function_name]
elif None in self._functions.keys():
item = self._functions[None]
elif runner_item.registry_item.handler is self._missing_function_call_handler:
elif runner_item.registry_item.handler == self._missing_function_call_handler:
item = runner_item.registry_item
else:
logger.warning(