fix(gateway): wire up message_timestamp config pipeline#15192
Open
kingofhk wants to merge 2 commits into
Open
Conversation
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.
2251691 to
b4193b6
Compare
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix the
message_timestampconfig pipeline so that the existing timestamp injection code in_prepare_inbound_message_textactually reads from config.yaml.Problem
Commit b4193b6 added timestamp injection code to
gateway/run.pythat prepends[MM-DD HH:MM]to inbound messages, controlled by amessage_timestampconfig section. However, the config pipeline was never wired up:GatewayConfigdataclass has nomessage_timestampfieldfrom_dict()does not map the key into the constructorload_gateway_config()does not read it from YAMLResult: timestamps are silently disabled even when config.yaml has the setting. Additionally,
.get()on the dataclass caused AttributeError crashes.Solution
Testing
Verified [MM-DD HH:MM] prefix on Telegram inbound messages with config:
message_timestamp: {enabled: true, format: "%m-%d %H:%M"}Files Changed