Skip to content

Commit 70dbd8a

Browse files
Yang YiHeleonai-agent
authored andcommitted
fix: correct AgentFlags attribute names from camelCase to snake_case
get_metrics() and mark_error() were referencing isStreaming, isCompacting, isWaiting, isBlocked, hasError — none of which exist on AgentFlags. The dataclass defines is_streaming, is_compacting, is_waiting, is_blocked, has_error. This caused AttributeError on every agent response.
1 parent 58394e4 commit 70dbd8a

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎core/runtime/middleware/monitor/state_monitor.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def mark_ready(self) -> bool:
109109

110110
def mark_error(self, error: Exception | None = None) -> bool:
111111
"""标记为错误状态"""
112-
self.flags.hasError = True
112+
self.flags.has_error = True
113113
if error is not None:
114114
# @@@error-snapshot - Capture a small, inspectable error snapshot for debugging.
115115
self.last_error_type = type(error).__name__
@@ -147,11 +147,11 @@ def get_metrics(self) -> dict[str, Any]:
147147
return {
148148
"state": self.state.value,
149149
"flags": {
150-
"streaming": self.flags.isStreaming,
151-
"compacting": self.flags.isCompacting,
152-
"waiting": self.flags.isWaiting,
153-
"blocked": self.flags.isBlocked,
154-
"error": self.flags.hasError,
150+
"streaming": self.flags.is_streaming,
151+
"compacting": self.flags.is_compacting,
152+
"waiting": self.flags.is_waiting,
153+
"blocked": self.flags.is_blocked,
154+
"error": self.flags.has_error,
155155
},
156156
"error": {
157157
"type": self.last_error_type,

0 commit comments

Comments
 (0)