Repository navigation
feat: watch and subscribe to ACP session updates - #30903
Conversation
9af709a to
f05ab0e
Compare
f05ab0e to
bd28aaa
Compare
bd28aaa to
af6a9ef
Compare
af6a9ef to
5c399b0
Compare
3c8f0a2 to
95c08cc
Compare
95c08cc to
02d0db9
Compare
2d9161d to
7ffb76c
Compare
0eafcb2 to
62c8378
Compare
62c8378 to
62ec300
Compare
62ec300 to
b265426
Compare
a7d3693 to
d514a37
Compare
d514a37 to
b506887
Compare
52080a0 to
1170d50
Compare
1170d50 to
e43d28d
Compare
| return r, nil, err | ||
| } | ||
| subscriber := &sessionSubscriber{ | ||
| events: make(chan workspacesdk.ACPEvent, 64), |
There was a problem hiding this comment.
I'd like to avoid these pre-determined buffered channels that have unpredictable results. We already have a case in chatd where live streaming just halts because a channel becomes full. Leaving this as-is, there'd have to be a case for why 64 will never overflow, or why it's OK when it does. Ideally this would be a slice or an unbounded channel (e.g. slice-backed). Memory consumption may be a concern, although I find that unlikely.
There was a problem hiding this comment.
Here the result is very predictable. If the subscriber lets the buffer overflow we remove it. This is a pretty standard pattern.
There was a problem hiding this comment.
And what happens after it’s removed? Would like to see the reasoning encoded in the code.
There was a problem hiding this comment.
Added a comment to explain it.
There was a problem hiding this comment.
e43d28d to
152b431
Compare
cb95a04 to
66866e8
Compare
mafredri
left a comment
There was a problem hiding this comment.
Approving as-is with the caveat that it would be nice to clean up the subscriber implementation as a follow-up to be mutex or unbounded channel based.
66866e8 to
28c97ff
Compare
Add atomic transcript snapshots and live event subscriptions for agent-local ACP sessions, with cursor-based replay across turns. Close subscriptions on cancellation, shutdown, or buffer overflow so slow consumers do not block session updates.
Depends on #30841.
Generated with Codex, carefully reviewed by Hugo.