Repository navigation
Conversation
_observe_unmentioned_group_message (Telegram) and _observe_group_message / the recall system note (Yuanbao) wrote datetime.now(tz=timezone.utc).isoformat() into the transcript entry's timestamp. hermes_state_messages._coerce_timestamp trusts numbers, numeric strings and datetime only, so every observed row was persisted with a substituted fallback and logged one 'Ignoring corrupt message timestamp' WARNING per message -- hundreds a day in a group running observe_unmentioned_group_messages, drowning errors.log. All other append_to_transcript callers (run_turn.py) already pass time.time().
Diaspar4u
pushed a commit
to Diaspar4u/hermes-agent
that referenced
this pull request
Sep 24, 2026
_coerce_timestamp only trusts numbers and datetime, so the ISO string the observe path wrote was replaced by the write-time fallback and logged one 'Ignoring corrupt message timestamp' WARNING per observed message (same bug class as NousResearch#118105 on the Telegram/Yuanbao observe paths, fixed there by NousResearch#118106).
2 of 3 tasks
4 of 5 tasks
Diaspar4u
pushed a commit
to Diaspar4u/hermes-agent
that referenced
this pull request
Oct 11, 2026
_coerce_timestamp only trusts numbers and datetime, so the ISO string the observe path wrote was replaced by the write-time fallback and logged one 'Ignoring corrupt message timestamp' WARNING per observed message (same bug class as NousResearch#118105 on the Telegram/Yuanbao observe paths, fixed there by NousResearch#118106).
This branch has not been deployed
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.
Fixes #118105.
Problem
The observe paths stamped the transcript entry with
datetime.now(tz=timezone.utc).isoformat().hermes_state_messages._coerce_timestamp→hermes_cli.timefmt.coerce_epochtrusts numbers,numeric strings and
datetime— but not a string spelling of one — so every observed row waspersisted with a substituted fallback and logged:
222 of them in one day in a Telegram group running
observe_unmentioned_group_messages, inerrors.log— the WARNING+ channel operators read to find real problems.Approach
Stamp
time.time(), matching every otherappend_to_transcriptcaller (gateway/run_turn.pyalready did). Three sites, the whole class:
plugins/platforms/telegram/adapter.py::_observe_unmentioned_group_messagegateway/platforms/yuanbao.py::GroupAtGuardMiddleware._observe_group_messagegateway/platforms/yuanbao.pyrecall system notetimeis already imported in both modules; no new imports, no behaviour change beyond the storedvalue being the adapter's own stamp instead of a fallback.
Excluded:
gateway/mirror.pyalso builds an ISOtimestampkey, but_append_to_sqliteneverforwards it to
append_message— a dead field, not a corrupt write. Fixing it is a separatequestion (drop the key or wire it through) and does not belong in this diff.
Tests
tests/gateway/test_observed_transcript_timestamp.py, parametrized over the Telegram and Yuanbaoobserve paths. It asserts the relationship rather than a snapshot: the entry an observe path
produces is written through the real
SessionDBand read back, and the stored value must equalwhat the adapter stamped, with no
Ignoring corrupt message timestampin the log.Sabotage run (restoring
.isoformat()at both sites) — both parameters fail on pre-fix code:With the fix, via
scripts/run_tests.sh:Risk
Low. The stored instant moves by microseconds (fallback was the write time); no schema, API or
config change. Readers are untouched —
coerce_epochkeeps degrading genuinely corrupt rows to?as before.