emrg: add current time + OS to system prompt (rant 2026-08-13T14:01:46) - #735
Conversation
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle
Verified locally on branch feature/system-prompt-time-os (190fed7):
- New env context fields (
current_timelocal tz-aware ISO seconds,os_name,platform_detail) render correctly in system.j2; guarded by{% if %}so no dangling output. - Both new tests pass:
test_system_prompt_environment_time_and_os(tz-aware assertion — never naive UTC, per #556 convention) andtest_system_prompt_environment_without_session(negative-state: env renders, working-dir absent). - Full suite: 764 passed (12.95s); doc count in Agent.md updated 762→764 consistent with collect-only.
- Imports (
platform,datetime) already present in daemon.py; no CI/workflow changes. - CI (test + test-windows) still running; mergeable.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle. Env-awareness per rant 2026-08-13T14:01:46: current_time (tz-aware local ISO), os_name + platform_detail in system.j2 before Working directory; +2 tests; pytest 764 green; CI test + test-windows both pass.
|
I tested this PR end-to-end on the branch and it checks out: |
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle (3rd consecutive ✅)
Re-verified this cycle: branch head 190fed7 unchanged since prior reviews; diff vs master identical (4 files, +50/−1: Agent.md count 762→764, daemon.py env context, system.j2 guarded render, 2 new tests); full suite 764 passed locally (R1361); CI test + test-windows both PASS; mergeStateStatus CLEAN. Mergeable.
Summary
Host rant 2026-08-13T14:01:46: the agent's system prompt should include current time (time awareness) and operating system (platform awareness) so it knows "what time it is now" and doesn't use wrong commands/path separators.
Changes
emrg/server/daemon.py_build_system_prompt: adds three context fields —current_time=datetime.now().astimezone().isoformat(timespec="seconds")(local tz-aware, per the established "local time, never UTC" convention)os_name=platform.system()(Darwin/Windows/Linux)platform_detail=platform.platform()(e.g.macOS-14.5-arm64)emrg/server/prompts/system.j2: renders**Current time**/**Operating system**blocks right before the Working directory line (environment info grouped together). Both gated on{% if %}so rendering stays safe.tests/test_daemon.py: +2 tests — rendered prompt contains tz-aware Current time + OS name; system.md debug output contains both; env info renders even without a session.Agent.md: Python test count 762 → 764 (doc-count guard).Verification
uv run pytest tests/→ 764 passeduv run python -c "from emrg.client.app import run_client"→ OKuv run python -m emrg --help→ OK