Conversation
a577d45 to
e308e40
Compare
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Looks Good
- Fixes Matrix sync cursor recovery when cursors are rejected by the server
- Handles the edge case gracefully without losing sync state
- Test coverage added
- Scoped, well-documented fix
- No security concerns
|
Thanks for the focused Matrix recovery patch. The premise is confirmed on current main: Problems
Suggested changes
This is an automated hermes-sweeper review. |
d286e75 to
a8e3e04
Compare
a8e3e04 to
71a9852
Compare
|
@teknium1 Addressed on the current head (
The two requested result-object regressions are in
Fresh focused verification: |
3108c1e to
9afc339
Compare
|
Current head |
6cf682a to
2842fd3
Compare
GottZ
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Summary
Two PRs address the same Matrix failure mode: a persisted incremental sync cursor rejected with 403/M_FORBIDDEN currently terminates the listener. Both distinguish rejected cursors from terminal authentication failures and retry from a fresh sync, while #61206 additionally bounds repeated resets and covers both exception and SyncError-like result-object paths.
Related pull requests
- #57725 [closed]
duplicate— (+226/-17) — superseded: Implements rejected incremental-cursor clearing and retry while preserving terminal handling for 401, unknown-token, and fresh-sync forbidden failures, with exception-path regressions. Although closed, it remains relevant as the original implementation now superseded by the rebased and more complete #61206. - #61206
related— (+379/-16) — preferred: Implements the same root-cause fix, adds a three-reset lifetime budget to prevent endless rejection cycles, and tests exception, textual-status, repeated-rejection, and SyncError-like result-object behavior. It also addresses the keep_open review on #61206 by adding the specifically requested stored-cursor recovery and no-cursor terminal result-object tests.
Duplicates
#57725 and #61206 are substantially duplicate implementations of rejected Matrix incremental-sync cursor recovery; #61206 is the expanded successor.
Suggested consolidation
Merge #61206: it contains the shared root-cause fix, preserves terminal auth behavior, bounds recovery attempts, and incorporates the contributor review's missing result-object coverage. Keep #57725 closed as superseded by #61206.
Complex graph
flowchart LR
classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
classDef best stroke-width:3px,stroke:#b45309
classDef target stroke-width:3px,stroke:#4338ca
subgraph Dup57725 ["PRs duplicating each other"]
P57725["PR #57725 (closed)"]
P61206["PR #61206 (open)"]
end
class P57725 closed
class P61206 open
class P61206 target
click P57725 "https://github.com/NousResearch/hermes-agent/pull/57725"
click P61206 "https://github.com/NousResearch/hermes-agent/pull/61206"
Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed or no verify verdict yet (state tag in the node label).
Cross-PR triage: Reviewed 2 pull requests and 0 issues in this complex. Each diff was read against this issue; Assessment working set: 30 kB of PR diffs, 4 kB of issue/PR text, 3 kB of discussion (5 comments), 1 verify verdict. verdicts reflect diff content, not PR titles. Part of an automated triage batch.
2842fd3 to
46423b4
Compare
|
Rebased onto current main as a clean single-commit recut ( Behavior unchanged in intent: rejected incremental Matrix sync cursors ( Verification on this head: focused sync-cursor suite 7 passed; |
|
Follow-up on the current head: successful Matrix Fresh verification: full |
2f785c5 to
7b92be8
Compare
7b92be8 to
f2f5481
Compare
Status — rebuilt on current main (
|
e67e493 to
d39db3d
Compare
c600059 to
552c948
Compare
596dc04 to
c8881e0
Compare
|
Updated on upstream main The sync recovery gap is still present on current main. This rebase keeps rejected-cursor reset, message-only M_FORBIDDEN handling as both exceptions and result objects, and departed-room dispatch exclusion. Optional SDK cases skip without the Matrix extra. Verified: Matrix 132 passed / 2 skipped, auth retry 4 passed. The rewritten PR description is the current scope and verification reference. Local suite results are not a claim of full-repository or live-homeserver validation; current-head CI is tracked separately by the checks below. |
0e1749d to
64d0f4b
Compare
…itives Keep the structured auth classifier (errcode + http_status). A 403 or M_FORBIDDEN with a live since token, or M_UNKNOWN_POS, clears the cursor and retries a snapshot, bounded to three resets. 401 / M_UNKNOWN_TOKEN and 403 without a cursor still stop the loop. Snapshot recovery drops rooms that disappeared from the join set.
8ba6278 to
702e4af
Compare
|
Rebased onto current This recut keeps main's structured sync-auth classifier ( Verification: |
A successful snapshot with a new next_batch clears the reset counter so three rare cursor rejections over a long process do not stop the loop.
|
Follow-up on review: reset budget is consecutive, not process lifetime. A successful snapshot with a new
|
Summary
Recover from a rejected Matrix
/syncpagination cursor without undoing main's structured auth classifier.Some homeservers and reverse proxies reject a persisted
sincetoken as403/M_FORBIDDEN(orM_UNKNOWN_POS). Main currently treats every structured403as permanent auth and stops the loop, even when a cursor is present. This PR keeps the classifier (errcode +http_statusonly; no HTML substring403scans) and adds a bounded cursor reset.Behavior
401/M_UNKNOWN_TOKEN/M_MISSING_TOKENstill stop the loop.403/M_FORBIDDENwithout a cursor still stop the loop.403/M_FORBIDDENwith a livesincetoken, orM_UNKNOWN_POS, clear the cursor, persistnext_batch=None, and retry a snapshot. Budget: 3 consecutive resets (a healthy snapshot clears the counter). A later403with no cursor is permanent auth.403still retries with the same cursor (main's false-positive fix is preserved).Tests
124 passed on this head.
Non-goals
Security
No new network, credentials, or shell execution. Sync errors are classified from structured mautrix attributes only.