fix(pheby): restore paged history across session resets

This commit is contained in:
2026-09-23 12:04:31 +00:00
parent e8c60a1001
commit 7ad8bf1155
4 changed files with 155 additions and 39 deletions
+7 -1
View File
@@ -99,6 +99,7 @@ Limits: chat text ≤ 64,000 chars; inbound WS frame ≤ 2 MiB (violations get
"messages": [
{ "message_id": "m12", "role": "user", "text": "hey", "ts": "…|null" },
{ "message_id": "m13", "role": "assistant", "text": "hi!", "ts": "…|null" } ],
"has_more": true,
"attachments": [],
"run": null,
"tools": [],
@@ -107,7 +108,12 @@ Limits: chat text ≤ 64,000 chars; inbound WS frame ≤ 2 MiB (violations get
```
History is the authoritative Hermes transcript (`role` is always `user` or
`assistant`). The other fields form a recoverable snapshot: unexpired
`assistant`). It spans all durable reset and compression generations sharing
the Pheby conversation key. `limit` is capped at 500; the response returns the
newest page in chronological order. While `has_more` is true, request earlier
pages with `"before_message_id": "m12"`, using the first message ID from the
previous page as an exclusive cursor. This is display history only; model
context can still be compressed. The other fields form a recoverable snapshot: unexpired
attachments, the active run (if any), latest structured tool states, and
pending approval/clarification requests. On reconnect, replace local state
with this snapshot, then consume new live events. Unknown conversation →