Skip to content

feat: add agent-local ACP session interaction - #30831

Merged
hugodutka merged 1 commit into
hugodutka/acp-session-recoveryfrom
hugodutka/acp-subagents-sessions
Oct 26, 2026
Merged

hugodutka merged 1 commit into
hugodutka/acp-session-recoveryfrom
hugodutka/acp-subagents-sessions

Conversation

@hugodutka

@hugodutka hugodutka commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Expose agent-local ACP session creation, messaging, interruption, transcript reads, and event streams through the agent HTTP and WebSocket API and workspace SDK. Support cursor-based reconnection and extend response write deadlines to allow harness initialization and session recovery to finish.

Depends on #30857.

Generated with Codex, carefully reviewed by Hugo.

@hugodutka
hugodutka added this pull request to stack #30832 October 15, 2026 10:17
@hugodutka
hugodutka force-pushed the hugodutka/acp-subagents-sessions branch from 0162cf0 to 1abacb1 Compare October 15, 2026 11:04
@hugodutka
hugodutka removed this pull request from stack #30832 October 15, 2026 11:06
@hugodutka
hugodutka changed the base branch from hugodutka/acp-subagents-discovery to hugodutka/acp-session-runtime October 15, 2026 11:06
@hugodutka
hugodutka added this pull request to stack #30836 October 15, 2026 11:06
@hugodutka
hugodutka force-pushed the hugodutka/acp-subagents-sessions branch from 1abacb1 to dd506cf Compare October 15, 2026 12:05
@hugodutka
hugodutka removed this pull request from stack #30836 October 15, 2026 13:08
@hugodutka
hugodutka changed the base branch from hugodutka/acp-session-runtime to hugodutka/acp-session-runtime-tests October 15, 2026 13:08
@hugodutka
hugodutka added this pull request to stack #30843 October 15, 2026 13:08
@hugodutka
hugodutka force-pushed the hugodutka/acp-subagents-sessions branch from dd506cf to 412a03e Compare October 15, 2026 15:48
@hugodutka
hugodutka removed this pull request from stack #30843 October 15, 2026 15:50
@hugodutka
hugodutka changed the base branch from hugodutka/acp-session-runtime-tests to hugodutka/acp-session-recovery October 15, 2026 16:12
@hugodutka
hugodutka added this pull request to stack #30859 October 15, 2026 16:13
@hugodutka
hugodutka force-pushed the hugodutka/acp-subagents-sessions branch from 412a03e to 8f2b9e2 Compare October 15, 2026 17:31
@hugodutka
hugodutka force-pushed the hugodutka/acp-subagents-sessions branch from 8f2b9e2 to 9abf9e9 Compare October 16, 2026 15:19
@hugodutka
hugodutka removed this pull request from stack #30859 October 16, 2026 15:20
@hugodutka
hugodutka added this pull request to stack #30904 October 16, 2026 15:21
@hugodutka
hugodutka force-pushed the hugodutka/acp-subagents-sessions branch from 9abf9e9 to 2805ba3 Compare October 16, 2026 16:51
@hugodutka
hugodutka force-pushed the hugodutka/acp-subagents-sessions branch from 2805ba3 to 6d7d999 Compare October 16, 2026 17:01
@hugodutka
hugodutka force-pushed the hugodutka/acp-subagents-sessions branch 2 times, most recently from 785534d to bcecca6 Compare October 19, 2026 12:58
@hugodutka
hugodutka force-pushed the hugodutka/acp-subagents-sessions branch from bcecca6 to a0b501e Compare October 19, 2026 13:40
@hugodutka
hugodutka force-pushed the hugodutka/acp-subagents-sessions branch from b9414e0 to b4371c3 Compare October 20, 2026 18:53
@hugodutka
hugodutka force-pushed the hugodutka/acp-subagents-sessions branch from b4371c3 to 96107ed Compare October 20, 2026 19:01
@hugodutka
hugodutka force-pushed the hugodutka/acp-subagents-sessions branch from 96107ed to 79886e5 Compare October 20, 2026 19:07
@hugodutka
hugodutka force-pushed the hugodutka/acp-subagents-sessions branch from 79886e5 to 7f3c75a Compare October 20, 2026 19:28
@hugodutka
hugodutka force-pushed the hugodutka/acp-subagents-sessions branch 2 times, most recently from 34211b2 to 45d8ee5 Compare October 21, 2026 12:19
@hugodutka
hugodutka force-pushed the hugodutka/acp-subagents-sessions branch from 45d8ee5 to b8a4bfe Compare October 21, 2026 13:20
@hugodutka
hugodutka force-pushed the hugodutka/acp-subagents-sessions branch from b8a4bfe to bd11f2c Compare October 21, 2026 13:36
@hugodutka
hugodutka force-pushed the hugodutka/acp-subagents-sessions branch from bd11f2c to 72da6b4 Compare October 21, 2026 13:49
@hugodutka
hugodutka force-pushed the hugodutka/acp-subagents-sessions branch from 72da6b4 to c731ddf Compare October 21, 2026 14:19
@hugodutka
hugodutka force-pushed the hugodutka/acp-subagents-sessions branch from c731ddf to e89507b Compare October 21, 2026 14:21
@hugodutka
hugodutka force-pushed the hugodutka/acp-subagents-sessions branch from e89507b to a0fb450 Compare October 21, 2026 16:12
Comment thread agent/x/agentacp/api.go Resolved
Comment thread agent/x/agentacp/api.go Resolved
Comment thread agent/x/agentacp/api.go Resolved
Comment thread agent/x/agentacp/api.go Resolved
Comment thread agent/x/agentacp/api.go Resolved
Comment thread agent/x/agentacp/api.go Outdated
api.manager.logger.Debug(ctx, "close ACP stream websocket", slog.Error(err))
}
}()
ctx = conn.CloseRead(ctx)

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.

Using this ctx is a bit sketchy here. Due to the websocket upgrade, it will never resolve (until this function returns).

I would suggest using CloseRead(context.Background()) here and overwrite ctx which doesn't serve a purpose within this method any longer. The only time it would be relevant is if we spawned a long-running thing here that we want to stop once this function returns.

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.

I'll base watchCtx on context.Background too. we wouldn't need the separate streamCtx too.

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.

done

Comment thread agent/x/agentacp/api.go Resolved
Comment thread agent/x/agentacp/api.go Resolved
Expose session creation, messages, interruption, reads, and event streams
through the agent HTTP and WebSocket API and workspace SDK. Adapt runtime
watches into subscriptions that complete when the current turn ends.
Extend tool call handling to preserve connection deadline control during
session setup.

Include subscription, API, SDK transport, and agent integration tests.
Session lifecycle and restoration are implemented in preceding changes.
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