|
1 | 1 | import asyncio
|
2 | 2 | import os
|
3 | 3 | import uuid
|
| 4 | +from datetime import datetime, timezone |
4 | 5 | from typing import Callable
|
5 | 6 |
|
6 | 7 | import openhands
|
@@ -170,6 +171,7 @@ def _on_workspace_context_recall(
|
170 | 171 | else '',
|
171 | 172 | microagent_knowledge=microagent_knowledge,
|
172 | 173 | content='Added workspace context',
|
| 174 | + date=self.runtime_info.date if self.runtime_info is not None else '', |
173 | 175 | )
|
174 | 176 | return obs
|
175 | 177 | return None
|
@@ -263,13 +265,17 @@ def set_repository_info(self, repo_name: str, repo_directory: str) -> None:
|
263 | 265 | def set_runtime_info(self, runtime: Runtime) -> None:
|
264 | 266 | """Store runtime info (web hosts, ports, etc.)."""
|
265 | 267 | # e.g. { '127.0.0.1': 8080 }
|
| 268 | + utc_now = datetime.now(timezone.utc) |
| 269 | + date = str(utc_now.date()) |
| 270 | + |
266 | 271 | if runtime.web_hosts or runtime.additional_agent_instructions:
|
267 | 272 | self.runtime_info = RuntimeInfo(
|
268 | 273 | available_hosts=runtime.web_hosts,
|
269 | 274 | additional_agent_instructions=runtime.additional_agent_instructions,
|
| 275 | + date=date, |
270 | 276 | )
|
271 | 277 | else:
|
272 |
| - self.runtime_info = None |
| 278 | + self.runtime_info = RuntimeInfo(date=date) |
273 | 279 |
|
274 | 280 | def send_error_message(self, message_id: str, message: str):
|
275 | 281 | """Sends an error message if the callback function was provided."""
|
|
0 commit comments