fix(session): preserve subsecond message timestamp order#3086
Merged
1 commit merged intoMay 28, 2026
Merged
Conversation
20f8c7c
Collaborator
|
Shipped in v0.51.155 / Release EA (stage-batch37, commit 20f8c7c). Thanks for the contribution! |
AJV20
pushed a commit
to AJV20/hermes-webui
that referenced
this pull request
May 28, 2026
# Conflicts: # CHANGELOG.md
AJV20
pushed a commit
to AJV20/hermes-webui
that referenced
this pull request
May 28, 2026
3-PR very low-risk cleanup: - nesquena#3039 api(): timeoutToast:false opt-in for passive pollers - nesquena#3085 _merged_session_messages_for_display: preserve sidecar order when longer - nesquena#3086 subsecond timestamps for gateway turns + compaction batches
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.
Thinking Path
Two write paths can assign multiple transcript rows the same integer-second timestamp: gateway-backed WebUI turns and batch stamping of timestamp-less messages after streaming/reconciliation. Equal timestamps later make display merges vulnerable to role/content fallback ordering.
What Changed
_stamp_missing_message_timestamps()to assign subsecond sequences to timestamp-less message batches while preserving existingtimestampand_tsmetadata.Why It Matters
This prevents new sidecar/state transcripts from collapsing many rows onto one timestamp and later rendering out of turn order.
Verification
python3 -m pytest tests/test_message_timestamp_stamping.py tests/test_webui_gateway_chat_backend.py -q -o addopts=-> 10 passedpython3 -m py_compile api/streaming.py api/gateway_chat.py-> passedgit diff --check-> passedContract Routing
Task type: runtime/session durability bugfix
Touched areas: gateway-backed chat persistence, streaming session save timestamp stamping, regression tests
Relevant public docs:
AGENTS.mdCONTRIBUTING.mddocs/CONTRACTS.mdScope boundaries: no contract document changes; this preserves transcript ordering metadata and does not change message content, storage format, or UI controls.
Evidence needed before claiming done: regression tests for timestamp sequencing plus focused compile/diff checks.
Risks / Follow-ups
Low risk. Existing float timestamps are already consumed by session summary/display code. This complements the sidecar display-merge recovery PR but does not require it to be useful.
Model Used
OpenAI Codex provider,
gpt-5.5, via Hermes/TARS with local git/pytest/gh tooling and an independent reviewer subagent.