fix(agent): inject turn-level live time context#10448
Conversation
|
Hi @Sapientropic — I noticed this is closely related to my PR #15872 which addresses the same root cause (no turn-level live time). I wanted to flag a key architectural difference for the maintainers: This PR (#10448) injects PR #15872 injects The Hermes codebase itself documents this principle (around
However, this PR has advantages that #15872 initially lacked (now added):
I have updated #15872 to also cover Happy to collaborate on a unified approach — the ideal solution would use user-message injection (for cache preservation) with the comprehensive path coverage and tests from this PR. |
|
Closing this as superseded by #17459/#17476. The problem statement is valid, but the selected direction is to consolidate on a single core ephemeral runtime/user-message context path, preferably based on #15872, while keeping volatile current time out of the cached system prompt/cacheable prefix. A turn-scoped system-prompt path risks reintroducing prompt-cache instability or another parallel timestamp mechanism. Please rebase any still-useful pieces (tests, wording, helper code) into #15872/#17476 rather than pursuing this PR as a standalone path. |
Summary
Hermes currently has a session-level
Conversation started: ...timestamp, but it does not provide a reliable turn-level live sense of "now" for each API call.This PR adds a turn-scoped
Current time: YYYY-MM-DD HH:MM (TZ)hint at API-call time instead of baking live time into the cached session prompt.What changed
_build_live_time_context()inrun_agent.py_build_turn_scoped_system_prompt()so live time is injected per API call, not into_build_system_prompt()run_conversation()_handle_max_iterations()Current time:Why this shape
This is intentionally aligned with the request in #10421:
Relation to other work
This PR is intentionally narrower than #10061.
They are adjacent, but not the same fix.
Repro verified
I re-verified the gap locally on:
v0.9.0released on April 13, 2026mainat422f2866on April 16, 2026In both cases, Hermes still had only the session-start timestamp and no turn-level live
Current time:context.How to test
Refs #10421