Skip to content

Land Depot agents CLI 1/6: session commands (DEP-7264) - #614

Closed
robstolarz wants to merge 12 commits into
mainfrom
rob/depot-agents-cli-land-01-session
Closed

robstolarz wants to merge 12 commits into
mainfrom
rob/depot-agents-cli-land-01-session

Conversation

@robstolarz

@robstolarz robstolarz commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

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-ff merge onto main, as part of the per-feature landing stack for DEP-7264. Review: git show --remerge-diff f480e5b shows only what the merge changed beyond #606's approved diff.

Stack

  1. Land Depot agents CLI 1/6: session commands (DEP-7264) #614 lands feat: add depot agent session commands #606 ← this PR
  2. Land Depot agents CLI 2/6: hide depot agent until GA (DEP-7247) #615 lands feat: hide depot agent from root help until GA #611
  3. Land Depot agents CLI 3/6: files and chat in attach (DEP-7264) #616 lands feat: send files to Depot agents and chat in attach #607
  4. Land Depot agents CLI 4/6: agent pull and push (DEP-7264) #617 lands feat: add depot agent pull and push #610
  5. Land Depot agents CLI 5/6: local MCP servers on attach (DEP-7247) #618 lands feat: offer local MCP servers to a Depot agent session on attach (DEP-7247) #609
  6. Land Depot agents CLI 6/6: plugin views (DEP-7248) #619 lands Render plugin views and run their controls from the CLI (DEP-7248) #608

Test plan

  • go build ./... and go test ./... pass at this tip, including TestRenderer* (streaming, partials, escape neutralizing), TestSessionTableNeutralizesTerminalEscapes, TestSafeTextDropsBidiAndZeroWidthCharacters, TestCommandErrorsAreSanitized, TestWatchUntilSettled*, TestWatchUntilTurnDoneAcceptsATurnThatFinishedUnseen, TestCreateRetriesWithOneClientRequestID, TestSendRetriesWithOneClientRequestID, TestAttachForwardsLinesAndQuits, TestAttachReturnsAStdinReadFailure
  • TODO(verify): no automated run of session create / attach against 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 agent with session subcommands 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 DepotAgentService Connect 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 json where applicable.

Streaming behavior: a Renderer turns server view_json into a live transcript (partial assistant text, tool calls, queue/retry hints) with deduplication by id, watch reconnect via after_seq, and retries on transient RPC errors while preserving client_request_id on create/send. Output and errors are sanitized for terminal escape/bidi attacks.

Adds github.com/google/uuid for 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.

robstolarz and others added 12 commits October 2, 2026 10:02
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
@linear-code

linear-code Bot commented Oct 3, 2026

Copy link
Copy Markdown

DEP-7264

@robstolarz

Copy link
Copy Markdown
Contributor Author

Superseded by #613 (single cli landing PR)

@robstolarz robstolarz closed this Oct 3, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Risk: medium. Approved: Cursor Bugbot completed successfully with no findings that need human review. This automation did not assign reviewers.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant