agents: read session events from the data-plane /events endpoint (stack on feat/agents-subcommands) - #1899
Open
logwolvy wants to merge 2 commits into
Open
agents: read session events from the data-plane /events endpoint (stack on feat/agents-subcommands)#1899logwolvy wants to merge 2 commits into
logwolvy wants to merge 2 commits into
Conversation
Points godo at digitalocean/godo#1072, which re-applies the two commits reverted from `OHS_endpoints`, so `StreamSession` reads both live and replay-only streams from the data plane's `/v2/agents/sessions/{id}/events` again. Vendor-only in effect: the sole diff under vendor/ is the 89 lines that the earlier pin to the released v1.202.0-beta.1 had dropped from hosted_agents.go. The next commit moves doctl's own code back onto it. Co-authored-by: Cursor <cursoragent@cursor.com>
…oint With godo back on `/events`, undo the three local accommodations that were made while the endpoint was unavailable. `commands/agents.go` drops its local copies of the `stream.state` kind and payload and uses godo's `HostedAgentEventKindStreamState` / `HostedAgentStreamState` again, so the wire contract lives in one place rather than being restated here. The reconnect test reads the resume cursor from the `Last-Event-ID` header instead of a `replay_from` query parameter, matching where the live lane actually carries it. `replay_from` stays the cursor for replay-only reads, which are a different lane. The agentproxy harness serves `/events` and opens every stream with a `stream.state` frame, so the codex facade tests exercise a stream shaped like the real one. The control plane's `/stream` is deliberately left unregistered: no agentproxy caller makes a replay-only read, so a request landing there is a bug worth failing on rather than quietly serving. Co-authored-by: Cursor <cursoragent@cursor.com>
ElanHasson
approved these changes
Jul 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Puts
doctl agents attachanddoctl agents logsback on the OHP data plane's/v2/agents/sessions/{id}/events, on a branch of its own so these builds can be tested against the data plane without moving either shared PR branch.Pairs with digitalocean/godo#1072. Merge that first — this PR pins a pseudo-version of its head commit, which should be swapped for a tagged godo release before this lands.
Why this is a restore rather than new work
The doctl-side changes were never reverted outright; they were dismantled piecemeal on
feat/agents-subcommands(#1853) while the endpoint was unavailable:9532be7dre-pinned godo to the releasedv1.202.0-beta.1, which dropped/eventsout ofvendor/entirely.0438544fmoved the agentproxy test harness back to the control plane's/stream, switched the reconnect test's resume cursor back to areplay_fromquery parameter, and replaced godo's exportedstream.statesymbols with locally-declared copies so the package would still compile against that pin.The help-text changes from the original commits survived and are untouched here.
What this PR does
agents: pin godo to the data-plane /events build— repointsgo.modat godo#1072 and re-vendors. The only diff undervendor/is the 89 lines9532be7dhad removed fromhosted_agents.go; no transitive dependency moved.agents: read live and replay streams from the data-plane /events endpoint— undoes the three accommodations:commands/agents.gouses godo'sHostedAgentEventKindStreamState/HostedAgentStreamStateinstead of local copies, so the wire contract lives in one place.Last-Event-ID, which is where the live lane carries it.replay_fromstays the cursor for replay-only reads, which are a separate lane with pagination rather than resume semantics./eventsand opens every stream with astream.stateframe, so the codex facade tests exercise a stream shaped like the real one./streamis deliberately left unregistered: no agentproxy caller makes a replay-only read, so a request landing there is a bug worth failing on.Testing
go build ./...,go vet ./commands/... ./internal/...andgo test ./commands/... ./internal/...all pass, including everyagentstest and the eightTestStreamWithReconnect_*cases. Thedoctlbinary builds and runs.Two pre-existing failures on
feat/agents-subcommandsare unchanged by this PR, and both reproduce on the base branch:TestRegistryLogoutfails on local keychain access, andintegration/database_create_restore_from_cluster.godoes not compile undergo build ./...(it is a non-_test.gofile referencing test-only symbols).