Skip to content

fix(gateway): wire up message_timestamp config pipeline#15192

Open
kingofhk wants to merge 2 commits into
NousResearch:mainfrom
kingofhk:feat/gateway-message-timestamp
Open

fix(gateway): wire up message_timestamp config pipeline#15192
kingofhk wants to merge 2 commits into
NousResearch:mainfrom
kingofhk:feat/gateway-message-timestamp

Conversation

@kingofhk

@kingofhk kingofhk commented Apr 24, 2026

Copy link
Copy Markdown

Summary

Fix the message_timestamp config pipeline so that the existing timestamp injection code in _prepare_inbound_message_text actually reads from config.yaml.

Problem

Commit b4193b6 added timestamp injection code to gateway/run.py that prepends [MM-DD HH:MM] to inbound messages, controlled by a message_timestamp config section. However, the config pipeline was never wired up:

  1. GatewayConfig dataclass has no message_timestamp field
  2. from_dict() does not map the key into the constructor
  3. load_gateway_config() does not read it from YAML

Result: timestamps are silently disabled even when config.yaml has the setting. Additionally, .get() on the dataclass caused AttributeError crashes.

Solution

  • config.py: dataclass field + from_dict() + load_gateway_config() pipeline (3 fixes)
  • run.py: .get() on dataclass -> getattr()

Testing

Verified [MM-DD HH:MM] prefix on Telegram inbound messages with config: message_timestamp: {enabled: true, format: "%m-%d %H:%M"}

Files Changed

  • gateway/config.py - GatewayConfig field + from_dict + yaml reader pipeline
  • gateway/run.py - getattr fix, removed debug log

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/gateway Gateway runner, session dispatch, delivery area/config Config system, migrations, profiles labels Apr 24, 2026
Prepends a local timestamp to inbound gateway messages so the agent
knows when each message was sent. Useful for agents running on
platforms that don't expose message timestamps (e.g. Telegram).

Controlled by a new config.yaml section:
  message_timestamp:
    enabled: true           # default: false
    format: "%m-%d %H:%M"   # strftime format

Uses the existing top-level timezone config / HERMES_TIMEZONE
env var for timezone resolution. Falls back to UTC if not set.
Disabled by default - users opt in via config.
@kingofhk kingofhk force-pushed the feat/gateway-message-timestamp branch from 2251691 to b4193b6 Compare April 25, 2026 03:34
- config.py: add message_timestamp field to GatewayConfig dataclass,
  from_dict() mapping, and load_gateway_config() yaml reader
- run.py: fix .get() on dataclass -> getattr() for message_timestamp
- Remove debug log line

The upstream commit b4193b6 added timestamp injection code but missed
the config pipeline - config.yaml message_timestamp was silently ignored.
@kingofhk kingofhk changed the title feat(gateway): add configurable message timestamp for inbound messages fix(gateway): wire up message_timestamp config pipeline Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants