refactor: replace fresh getattr string access and a restating comment (#45017)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
devin-ai-integration[bot] 2026-10-07 02:08:22 -07:00 • committed by GitHub
parent 2c67ae90bd
commit 7b439d9138
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View file

@ -90,7 +90,7 @@ def _fold_message_cache_control(
return base
def _message_role_mapping(role: str) -> type[ChatMessage]: # returns the SAP message model class, not an instance
def _message_role_mapping(role: str) -> type[ChatMessage]:
return {
"user": SAPUserMessage,
"assistant": SAPAssistantMessage,

View file

@ -4550,7 +4550,7 @@ async def _adaptive_router_flusher_loop():
ar = tagged.strategy
# Lazy state load: covers adaptive routers registered via
# `/config/reload` after proxy boot.
if not getattr(ar, "state_loaded", False):
if not ar.state_loaded:
try:
await ar.load_state_from_db(prisma_client)
finally:

View file

@ -1393,10 +1393,10 @@ def _schedule_async_success_logging(
)
)
if not getattr(logging_obj, "defer_async_logging", False):
if not logging_obj.defer_async_logging:
_enqueue_async_logging()
return
if getattr(logging_obj, "enqueue_deferred_logging", None) is not None:
if logging_obj.enqueue_deferred_logging is not None:
return
logging_obj.enqueue_deferred_logging = _enqueue_async_logging