Open Harness Server subcommands - #1853
Open
SSharma-10 wants to merge 65 commits into
Open
Conversation
anup-deka
reviewed
May 29, 2026
logwolvy
approved these changes
Jun 1, 2026
logwolvy
left a comment
There was a problem hiding this comment.
Assuming, relevant godo changes for sending agent spec yaml are done.
Please address the comments and we should be good to merge.
doctl agent attach connected but printed nothing: the harness-api SSE
stream emits the SPI canonical event envelope (type/data/timestamp/
tenant_id, dot-separated event names) while vendored godo decoded
kind/payload/at/team_id, so every event fell through renderEvent.
- godo HostedAgentEvent: decode the SPI wire via UnmarshalJSON and switch
the HostedAgentEventKind constants to the dot-separated SPI names.
- godo ErrorResponse: also read the nested {"error":{code,message}}
envelope so failed calls show the server's reason, not a bare status.
- agents: align event payload structs/rendering and HITL tracking to the
SPI data shapes, and acknowledge each submit with its run id so the
agent's startup latency isn't mistaken for a hang (which caused
duplicate submits).
- tests for the wire decode, rendering, nested-error surfacing, and ack.
The vendored godo edits mirror the fix being upstreamed to
digitalocean/godo and are in-tree until godo is re-vendored.
Co-authored-by: Cursor <cursoragent@cursor.com>
logwolvy
previously approved these changes
Jun 8, 2026
logwolvy
left a comment
There was a problem hiding this comment.
I will be raising a PR for stream related fixes on doctl and godo.
…endlier attach/start errors
…1866) * displayers: drop SandboxID column from hosted-agent session output * add vendor files --------- Co-authored-by: SSharma-10 <shivanisharma@digitalocean.com>
Mahki0412
reviewed
Jul 1, 2026
| @@ -0,0 +1,1215 @@ | |||
| /* | |||
| Copyright 2026 The Doctl Authors All rights reserved. | |||
| Licensed under the Apache License, Version 2.0 (the "License"); | |||
Vendors glamour and its transitive deps (chroma, goldmark, bluemonday, etc.) and bumps lipgloss/termenv so `doctl agents` can render the agent's markdown replies with syntax-highlighted code blocks. Also re-syncs the pinned godo vendor tree (adds Session.SandboxID). Co-authored-by: Cursor <cursoragent@cursor.com>
* MARSOHS-340: fail agents attach fast on a terminal session doctl agents attach fetched the session via GetSession but never checked its status, so attaching to a destroyed/failed/destroying session printed "Connected to ..." and only failed once the user typed something and SendInput came back 404. This complements the harness-api server-side fix (MARSOHS-340) which now rejects the stream subscribe itself, but the CLI still showed a stale prompt instead of exiting. Add a check right after GetSession succeeds: if the session is in a terminal status (destroying/destroyed/failed), fail immediately with a clear message instead of printing the banner and entering the interactive loop. Reuses the existing isTerminalSessionStatus helper. * MARSOHS-340: add test coverage for attach terminal-session rejection Covers destroyed/destroying/failed statuses erroring immediately with "cannot be attached" plus the humanized status, and pins the SESSION_STATUS_ -> lowercase mapping in humanSessionStatus.
* m0 - first draft * m2 + tests * comment updated * fix pr comments: update agentproxy to use new facade creation for connections and improve event loop handling
Bump godo to the build that points StreamSession at the data plane's
`/v2/agents/sessions/{id}/events`, and handle what the new endpoint adds.
`agents logs` is unaffected: godo keeps replay-only reads on the control
plane's `/stream`, which is the only side holding the stored history.
The live stream carries `stream.state` transport control frames reporting
connection health. They are not session activity, so they never render and
never become the reconnect cursor. One of them needs acting on:
`superseded` means another connection from this device took the session
over, and it is the one stream end we must not reconnect from — re-attaching
would take it back, and the two windows would evict each other indefinitely.
Also drop the "one connected device per session" claim from `start-proxy`'s
help. Distinct devices now coexist; what actually conflicts is running the
proxy and `attach` from the same machine, since both stream as this device.
Test changes: the reconnect test reads the resume cursor from Last-Event-ID
instead of a replay_from query parameter, and 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.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The godo bump in the previous commit updated go.mod/go.sum but not vendor/, so `go test -mod=vendor` (what CI runs) failed with "inconsistent vendoring": go.mod required the new pseudo-version while vendor/modules.txt still declared v1.201.0-beta.1. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Bumps godo to pick up the replay-only move onto
`/v2/agents/sessions/{id}/events?replay_only=true`. `doctl agents logs` was
the last reader still pointed at the control plane's `/stream`; it now shares
the data-plane endpoint with `doctl agents attach`.
No change to how events are parsed or rendered -- the endpoint emits the same
canonical envelope, and the stream still ends after the last stored event,
which is what lets the command exit.
The help text no longer promises the *full* history. The data plane serves
history out of the durable event log rather than the control plane's
database, so it is bounded by retention and by a per-read cap; a long-idle or
unusually long session may replay only its more recent activity.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
4 tasks
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.
No description provided.