Gateway: activity line, thread history paging, a project's threads, and a thread's subagents
Gateway / check (push) Successful in 9s
Gateway / image (push) Successful in 21s

This commit is contained in:
gib committed 2026-11-02 12:42:44 -05:00
1 parent 6bc9cac6ca
commit 52210d0223
11 files changed
+474 -19

No files matched your search

+34 -2
View File
@@ -77,6 +77,7 @@ FeedItem {
"phase": "waiting_for_approval",
"updatedAt": "2026-11-01T09:41:00.000Z",
"lastMessage": "Parser and tests are written. I want to run the suite.",
"activity": { "kind": "command", "text": "bun test", "startedAt": "..." } | null,
"request": PendingRequest | null,
"via": { "hostId": "...", "threadId": "...", "title": "Check Panama PATH" } | null
}
@@ -92,6 +93,12 @@ when the gateway cannot find its parent, or the parent already shows a request.
`failed`. `lastMessage` is the agent's latest message trimmed to about 280 characters. It can be null
for a moment after a thread changes.
`activity` is the newest step the agent has in progress. `kind` is `command`, `edit`, `search`,
`web`, `subagent`, `thinking` or `tool`, and `text` is the command line, the file name (without its
directory), the search, the subagent's title or the tool's name, trimmed to about 80 characters.
Monitors are left out, since they run for hours. It is null when no step is in progress. The gateway
rereads a running thread at most every 5 seconds, so it can lag that much.
```
PendingRequest {
"id": "...",
@@ -112,11 +119,25 @@ thread". For questions (`kind: "user_input"`), `options` is empty and `questions
```
GET /v1/threads/:hostId/:threadId
200 { "item": FeedItem, "messages": [Message], "canStop": true, "askFirst": false }
200 { "item": FeedItem, "messages": [Message], "canStop": true, "askFirst": false,
"earlierCursor": "w12" | null, "subagents": [ThreadRow] }
ThreadRow { "hostId": "...", "threadId": "...", "title": "Check PATH", "phase": "running" | null,
"settled": false, "updatedAt": "..." }
Message { "id": "...", "role": "assistant", "text": "...", "createdAt": "..." }
```
`messages` holds the last 20, oldest first, each trimmed to 2000 characters.
`messages` holds the last 20, oldest first, each trimmed to 2000 characters. `subagents` lists the
threads this one started, its own subagents and `delegate_task` children on any host, newest first.
A ThreadRow's `phase` is null for a thread that never ran or was stopped.
```
GET /v1/threads/:hostId/:threadId/history?cursor=<earlierCursor>
200 { "messages": [Message], "earlierCursor": "..." | null }
```
The 20 messages before the ones the watch has, oldest first. Pass the returned `earlierCursor` for
the page before that. It is null at the start of the thread. Cursors are opaque.
```
POST /v1/threads/:hostId/:threadId/messages
@@ -192,6 +213,17 @@ GET /v1/summary
`next` is the thread that has waited longest for you, or null.
## Browse
```
GET /v1/projects/:hostId/:projectId/threads
200 { "items": [ThreadRow] }
```
A project's newest 50 threads, settled ones included, newest first. Subagents are left out and
listed under their parents instead. Hosts and projects come from `GET /v1/projects`.
## New thread
```