Gateway: keep finished threads in Recent until settled, with a full list and settle-all route
This commit is contained in:
1 parent
cf8995e63f
commit
2a127327bf
5 files changed
+110
-26
No files matched your search
+23
-4
@@ -58,13 +58,15 @@ GET /v1/feed
|
||||
"needsYou": [FeedItem],
|
||||
"working": [FeedItem],
|
||||
"recent": [FeedItem],
|
||||
"recentTotal": 12,
|
||||
"hosts": [{ "id": "...", "label": "Mac mini", "status": "online", "error": null }]
|
||||
}
|
||||
```
|
||||
|
||||
`needsYou` holds threads waiting for an approval or an answer, oldest first. `working` holds running
|
||||
threads, most recently updated first. `recent` holds threads that completed or failed in the last 24
|
||||
hours, at most 10. Host `status` is one of `connecting`, `online`, `offline`, `auth_invalid`, or
|
||||
threads, most recently updated first. `recent` holds threads that completed or failed and are not
|
||||
settled yet, however old, newest first and at most 10. `recentTotal` counts all of them. When it is
|
||||
larger, the rest come from `GET /v1/recent`. Host `status` is one of `connecting`, `online`, `offline`, `auth_invalid`, or
|
||||
`incompatible`.
|
||||
|
||||
```
|
||||
@@ -145,8 +147,25 @@ POST /v1/threads/:hostId/:threadId/settle
|
||||
202
|
||||
```
|
||||
|
||||
Settles a thread, as in T3. A settled thread that finished or failed leaves the feed. To settle all
|
||||
of Recent, settle each item.
|
||||
Settles a thread, as in T3. A settled thread that finished or failed leaves the feed.
|
||||
|
||||
```
|
||||
GET /v1/recent
|
||||
|
||||
200 { "items": [FeedItem] }
|
||||
```
|
||||
|
||||
Every unsettled finished thread, newest first. `lastMessage` is null for threads the gateway has not
|
||||
read yet, since it does not fetch them all for this list.
|
||||
|
||||
```
|
||||
POST /v1/recent/settle
|
||||
|
||||
200 { "settled": 11, "failed": 0 }
|
||||
```
|
||||
|
||||
Settles every completed thread in Recent, including those past the first 10. Failed threads stay.
|
||||
`failed` counts threads T3 refused or whose host was offline.
|
||||
|
||||
Thread detail fills `request` and `via` the same way as the feed when a subagent waits on you.
|
||||
|
||||
|
||||
Reference in new issue
Block a user