Repository navigation
Land Depot agents CLI 1/6: session commands (DEP-7264) - #614
Closed
robstolarz wants to merge 12 commits into
Closed
robstolarz wants to merge 12 commits into
robstolarz wants to merge 12 commits into
Conversation
Adds `depot agent session` with create, send, interrupt, list, watch, and attach, backed by the new DepotAgentService. The proto is copied from api, leaving out the service only the agent's own sandbox calls. watch renders the session's conversation view (user messages, assistant text, tool calls and results) once per entry, reconnects with after_seq when the stream ends, and can exit once a turn settles. attach forwards each stdin line as a follow-up, with /steer, /interrupt, and /quit. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The harness now pushes a bounded projection as view_json instead of the raw conversation entries, so watch and attach printed nothing. Render its messages once by id, announce each live tool call, stream the partial response as it grows, and note queued inputs, retries, and truncation. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The view now names every tool call with a one-line summary and gives each tool result its call id. Print "→ name summary" once per call, from whichever of the assistant message, the live tool slot, or the result shows it first, so a result always follows its call. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
create now sends one client_request_id per invocation and retries transient failures with it, so a create that landed before the error returns that session instead of starting a second one. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- watch --until-idle and create --watch exit when a session fails or is archived, even if it never reported running. - send and attach retry transient failures with the message's one client_request_id, as create does. - A view that fails to decode is returned instead of retried, since only RPC errors can be transient. - A running status prints before the frame's view, so it no longer cuts into the streamed partial and duplicates it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ted queued inputs create --watch and --output json are now mutually exclusive. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ports an error A partial response that cleared without a final message left its line open, so the next response streamed onto it. Attach's command notices wrote straight to the output and could cut into a streaming line; they now go through the renderer, which ends that line first. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…minal Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… from the server Format characters such as U+202E could reorder names and summaries on screen. Errors returned by agent commands, and IDs in their success messages, now go through the same sanitizer as the transcript. Part of DEP-7247. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Refs DEP-7264 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NdhqP6oGqJMRJLwBU5Zepm
This was referenced Oct 3, 2026
Contributor
Author
|
Superseded by #613 (single cli landing PR) |
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.


Adds
depot agent session(create,list,send,watch,attach,interrupt) for driving Depot agent sessions from the terminal. This PR lands approved #606 (head 607b222) as a--no-ffmerge onto main, as part of the per-feature landing stack for DEP-7264. Review:git show --remerge-diff f480e5bshows only what the merge changed beyond #606's approved diff.Stack
Test plan
go build ./...andgo test ./...pass at this tip, includingTestRenderer*(streaming, partials, escape neutralizing),TestSessionTableNeutralizesTerminalEscapes,TestSafeTextDropsBidiAndZeroWidthCharacters,TestCommandErrorsAreSanitized,TestWatchUntilSettled*,TestWatchUntilTurnDoneAcceptsATurnThatFinishedUnseen,TestCreateRetriesWithOneClientRequestID,TestSendRetriesWithOneClientRequestID,TestAttachForwardsLinesAndQuits,TestAttachReturnsAStdinReadFailuresession create/attachagainst a deployed API.Merge resolutions
Clean merge; no conflicts.
🤖 Generated with Claude Code
https://claude.ai/code/session_01NdhqP6oGqJMRJLwBU5Zepm
Note
Medium Risk
New authenticated API client and long-lived streaming attach/watch paths increase exposure to network and untrusted server text, though terminal sanitization and tests mitigate display risks.
Overview
Introduces
depot agentwithsessionsubcommands so users can drive Depot coding-agent sessions from the terminal: create (optional--repo,--model,--watch), list, send (--steer), interrupt, watch (--until-idle), and attach (stdin follow-ups plus/steer,/interrupt,/quit).Wires a new
DepotAgentServiceConnect client (NewDepotAgentClient) and checked-in proto/generated stubs for sessions, streaming WatchSession, and related RPCs (triggers/archive are in the API but not exposed as CLI yet in this slice). Commands resolve org/token like other Depot CLIs and support-o jsonwhere applicable.Streaming behavior: a
Rendererturns serverview_jsoninto a live transcript (partial assistant text, tool calls, queue/retry hints) with deduplication by id, watch reconnect viaafter_seq, and retries on transient RPC errors while preservingclient_request_idon create/send. Output and errors are sanitized for terminal escape/bidi attacks.Adds
github.com/google/uuidfor idempotent client request IDs and unit tests for render, watch, attach, and retry paths.Reviewed by Cursor Bugbot for commit f480e5b. Bugbot is set up for automated code reviews on this repo. Configure here.