SSE reconnect, task switcher state/inbox/new task, stream throttle

This commit is contained in:
Ian Gulliver
2026-10-14 22:28:25 -07:00
parent 8e4c40eb5f
commit 33e682a9d5
27 changed files with 418 additions and 182 deletions
+3 -1
View File
@@ -45,6 +45,7 @@ type Event struct {
Type string
Subtype string
Raw json.RawMessage
Read time.Time
}
type Block struct {
@@ -505,6 +506,7 @@ func (s *Session) readLoop(stdout io.Reader) {
}
func (s *Session) handleLine(line []byte) {
read := time.Now()
env := envelope{}
err := json.Unmarshal(line, &env)
if err != nil {
@@ -540,7 +542,7 @@ func (s *Session) handleLine(line []byte) {
s.idMu.Unlock()
}
s.events <- Event{Type: env.Type, Subtype: env.Subtype, Raw: append(json.RawMessage{}, line...)}
s.events <- Event{Type: env.Type, Subtype: env.Subtype, Raw: append(json.RawMessage{}, line...), Read: read}
}
func (s *Session) learnScrub(raw json.RawMessage) {