feat(config): add configurable timezone for runtime context

Add agent-level timezone configuration with a UTC default, propagate it into runtime context and heartbeat prompts, and document valid IANA timezone usage in the README.
This commit is contained in:
Xubin Ren
2026-03-25 22:07:14 +08:00
committed by Xubin Ren
parent ef10df9acb
commit 13d6c0ae52
7 changed files with 56 additions and 11 deletions
+3 -1
View File
@@ -59,6 +59,7 @@ class HeartbeatService:
on_notify: Callable[[str], Coroutine[Any, Any, None]] | None = None,
interval_s: int = 30 * 60,
enabled: bool = True,
timezone: str | None = None,
):
self.workspace = workspace
self.provider = provider
@@ -67,6 +68,7 @@ class HeartbeatService:
self.on_notify = on_notify
self.interval_s = interval_s
self.enabled = enabled
self.timezone = timezone
self._running = False
self._task: asyncio.Task | None = None
@@ -93,7 +95,7 @@ class HeartbeatService:
messages=[
{"role": "system", "content": "You are a heartbeat agent. Call the heartbeat tool to report your decision."},
{"role": "user", "content": (
f"Current Time: {current_time_str()}\n\n"
f"Current Time: {current_time_str(self.timezone)}\n\n"
"Review the following HEARTBEAT.md and decide whether there are active tasks.\n\n"
f"{content}"
)},