-
Notifications
You must be signed in to change notification settings - Fork 61
Description
Currently, when we run uv run examples/02_remote_agent_server/01_convo_with_local_agent_server.py, we will see that the visualizer will print boxes showing cost $0.00 until the conversation.run returns.
The main reason is beacuse in openhands-sdk/openhands/sdk/conversation/impl/remote_conversation.py, we implement:
@property
def stats(self) -> ConversationStats:
"""Get conversation stats (fetched from remote)."""
info = self._get_conversation_info()
stats_data = info.get("stats", {})
return ConversationStats.model_validate(stats_data)
And _get_conversation_info will always re-use the cached value instead of fetching the up-to-date value from remote.
This works for most state values (since they will stay unchanged), but not for "stats," since it will be updated on every agent action.
We should figure out a way to stream these "stats" changes as part of the conversation state update via WebSockets. We should also check if there's other fields in ConversationState that should be updated but we haven't do it