mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-30 03:00:41 -04:00
refactor(backend): move _BOUNDARY_SCAN_LIMIT to module level, logger.info -> debug
Move _BOUNDARY_SCAN_LIMIT from function body to module level to avoid redefining it on every backward-pagination call. Downgrade GET_SESSION per-request log from INFO to DEBUG to reduce noise at scale.
This commit is contained in:
@@ -543,7 +543,7 @@ async def get_session(
|
||||
_strip_injected_context(message.model_dump()) for message in page.messages
|
||||
]
|
||||
|
||||
logger.info(
|
||||
logger.debug(
|
||||
"[GET_SESSION] session=%s, active=%s, from_start=%s, forward_paginated=%s, "
|
||||
"msg_count=%d, last_role=%s",
|
||||
session_id,
|
||||
|
||||
@@ -30,6 +30,8 @@ from .model import get_chat_session as get_chat_session_cached
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
_BOUNDARY_SCAN_LIMIT = 10
|
||||
|
||||
|
||||
class PaginatedMessages(BaseModel):
|
||||
"""Result of a paginated message query."""
|
||||
@@ -124,7 +126,6 @@ async def get_chat_messages_paginated(
|
||||
# expand backward to include the preceding assistant message that
|
||||
# owns the tool_calls, so convertChatSessionMessagesToUiMessages
|
||||
# can pair them correctly.
|
||||
_BOUNDARY_SCAN_LIMIT = 10
|
||||
if results and results[0].role == "tool":
|
||||
boundary_where: dict[str, Any] = {
|
||||
"sessionId": session_id,
|
||||
|
||||
Reference in New Issue
Block a user