Repository navigation
fix(room-ops): read returns messages newest first by timestamp, as it declares - #6230
Open
mybelovedstar123 wants to merge 1 commit into
Open
mybelovedstar123 wants to merge 1 commit into
mybelovedstar123 wants to merge 1 commit into
Conversation
… declares The gateway's /messages answer pulls a replied-to (or referenced) message up behind its reply, so the order is not chronological (sonichi#6176). read_room passed that order through while declaring `order: newest_first`, and its `limit` slice then kept the old replied-to message instead of newer ones. read_room now sorts by timestamp, newest first, before the limit, when every message carries a numeric ts; ties keep the gateway's order (stable), and a page with any non-numeric ts keeps the gateway's order rather than guessing. Refs sonichi#6176
mybelovedstar123
requested review from
marklysze and
qingyun-wu
as code owners
November 4, 2026 18:29
Contributor
Coverage Gate✅ Diff coverage PASSES the 95% bar. Whole-tree (informational): 92%. Diff CoverageDiff: origin/main...HEAD, staged and unstaged changes
Summary
|
Contributor
Author
|
@cla-assistant check (agent-assisted, Claude for slovertop) |
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.
Priority
Level: low
Reason:
room_ops readdeclaredorder: newest_firstwhile returning the gateway's reply-chain order, and a smalllimitthen kept an old replied-to message instead of newer ones. That matters to every "has anyone replied?" probe that reads a few messages.Closes
Refs #6176. The reordering itself comes from the gateway's
/messagesanswer, which isn't in this repo. This makes the engine's reader return the order it declares, whatever the gateway sends.Summary
read_room(skills/agent-room-ops/read.py) took the gateway's message order as-is and labelled itnewest_first. The gateway pulls a replied-to message (and a referenced one) up behind its reply, so:messages[:limit]kept the replied-to message and dropped newer ones.Now, before the limit,
_newest_first()sorts byts, newest first:reverse=Truetoo.ts. A page where anytsis missing or non-numeric keeps the gateway's order, rather than guessing where those messages go.oldest_firststill reverses only the rendering, now of the sorted list.File:
skills/agent-room-ops/read.py.Checklist
upstream/main("before" below)tests/room-ops-read-order.test.py(5 checks)read_roomwith the gateway's reply-chain order as the fake's answer.Before / after evidence
The gateway answer used:
reply(400, in_reply_to $1), replied-to(100), between-2(300), between-1(200).main:This branch: every check in
room-ops-read-orderpasses, sections 1–6.Test plan
agent-room-ops/read.py,read_roomorroom_ops(41 test files) passes, except two that this change doesn't touch:gateway-credential-sources(fails identically onmainhere) andhermetic-env-sentinels(hit my 300 s per-file timeout).check-python39-compat.pyon Python 3.9.25, everylint-*.sh --diffagainstupstream/main,gen-src-map.py --check,agents-md-sync.sh --checkandreview-checks.sh. All pass.Author: discord username :: slovertop :: agent-assisted (Claude)