Skip to content

feat: watch and subscribe to ACP session updates - #30903

Merged
hugodutka merged 1 commit into
hugodutka/acp-session-runtime-testsfrom
hugodutka/acp-session-watch
Oct 26, 2026
Merged

hugodutka merged 1 commit into
hugodutka/acp-session-runtime-testsfrom
hugodutka/acp-session-watch

Conversation

@hugodutka

@hugodutka hugodutka commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

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.

@hugodutka
hugodutka added this pull request to stack #30904 October 16, 2026 15:21
@hugodutka
hugodutka force-pushed the hugodutka/acp-session-watch branch from 9af709a to f05ab0e Compare October 16, 2026 17:01
@hugodutka
hugodutka force-pushed the hugodutka/acp-session-watch branch from f05ab0e to bd28aaa Compare October 19, 2026 12:06
@hugodutka
hugodutka force-pushed the hugodutka/acp-session-watch branch from bd28aaa to af6a9ef Compare October 19, 2026 12:58
@hugodutka
hugodutka removed this pull request from stack #30904 October 19, 2026 14:05
@hugodutka
hugodutka added this pull request to stack #31024 October 19, 2026 14:05
@hugodutka
hugodutka force-pushed the hugodutka/acp-session-watch branch from af6a9ef to 5c399b0 Compare October 20, 2026 15:23
@hugodutka
hugodutka force-pushed the hugodutka/acp-session-watch branch 2 times, most recently from 3c8f0a2 to 95c08cc Compare October 20, 2026 17:25
@hugodutka
hugodutka force-pushed the hugodutka/acp-session-watch branch from 95c08cc to 02d0db9 Compare October 20, 2026 17:51
@hugodutka
hugodutka removed this pull request from stack #31024 October 20, 2026 17:52
@hugodutka
hugodutka force-pushed the hugodutka/acp-session-watch branch 2 times, most recently from 2d9161d to 7ffb76c Compare October 20, 2026 18:35
@hugodutka
hugodutka force-pushed the hugodutka/acp-session-watch branch 2 times, most recently from 0eafcb2 to 62c8378 Compare October 20, 2026 18:53
@hugodutka
hugodutka force-pushed the hugodutka/acp-session-watch branch from 62c8378 to 62ec300 Compare October 20, 2026 19:01
@hugodutka
hugodutka force-pushed the hugodutka/acp-session-watch branch from 62ec300 to b265426 Compare October 20, 2026 19:07
@hugodutka
hugodutka force-pushed the hugodutka/acp-session-watch branch from a7d3693 to d514a37 Compare October 21, 2026 13:49
@hugodutka
hugodutka force-pushed the hugodutka/acp-session-watch branch from d514a37 to b506887 Compare October 21, 2026 14:19
@hugodutka
hugodutka force-pushed the hugodutka/acp-session-watch branch 2 times, most recently from 52080a0 to 1170d50 Compare October 21, 2026 16:12
@hugodutka
hugodutka added this pull request to stack #31131 October 21, 2026 16:34
@hugodutka
hugodutka marked this pull request as ready for review October 21, 2026 16:36
@hugodutka
hugodutka force-pushed the hugodutka/acp-session-watch branch from 1170d50 to e43d28d Compare October 21, 2026 16:56
@hugodutka hugodutka changed the title feat(agent/x/agentacp): watch and subscribe to session updates feat: watch and subscribe to ACP session updates Oct 21, 2026
@mafredri
mafredri self-requested a review October 22, 2026 09:44
return r, nil, err
}
subscriber := &sessionSubscriber{
events: make(chan workspacesdk.ACPEvent, 64),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here the result is very predictable. If the subscriber lets the buffer overflow we remove it. This is a pretty standard pattern.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And what happens after it’s removed? Would like to see the reasoning encoded in the code.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment to explain it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hugodutka
hugodutka force-pushed the hugodutka/acp-session-watch branch from e43d28d to 152b431 Compare October 22, 2026 20:31
@hugodutka
hugodutka force-pushed the hugodutka/acp-session-watch branch 3 times, most recently from cb95a04 to 66866e8 Compare October 23, 2026 11:34

@mafredri mafredri left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@hugodutka
hugodutka force-pushed the hugodutka/acp-session-watch branch from 66866e8 to 28c97ff Compare October 26, 2026 16:01
@hugodutka
hugodutka merged commit d2c32e6 into main Oct 26, 2026
27 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 26, 2026
@hugodutka
hugodutka deleted the hugodutka/acp-session-watch branch October 26, 2026 16:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants