Repository navigation
agent: use the turn's token for watch, send and launch in a sandbox (DEP-8577) - #690
Merged
Merged
Conversation
…DEP-8577) Inside a Dispatch sandbox, watch, create --watch, send and launch now call the API with the turn's own token, which the API takes on WatchSession, SendInput and Launch for a session the turn's own session started. create --watch uses it for both calls. stop keeps the organization credential, and nothing changes outside a sandbox. An API that refuses the token there is named in the error, and when a watch fails after a create, send or launch the error says which session was acted on and how to read its reply. Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RQk3K7GpvQg7ySXyCrirEe
…ed (DEP-8577) Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RQk3K7GpvQg7ySXyCrirEe
Contributor
Author
|
From Claude: merge proof.
|
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.


Inside a Dispatch sandbox,
depot agent watch,create --watch,sendandlaunchnow call the API with the turn's own token. The API takes that token onWatchSession,SendInputandLaunchfor a session the turn's own session started, so an agent can start a session, follow it to its reply and message it again. DEP-8577.create,list,logswatch,create --watchsend,launchstop--tokenandDEPOT_TOKENstill come first, and the error says so.depot agent logs <id>. The session is left running, because archiving it is a call the turn's token cannot make.Tests and post-deploy test plan
pkg/cmd/agent/credential_test.goasserts theAuthorizationeach RPC arrives with for every command, with and without a cache token, and the error text against an API that refuses the token. Both tests fail on currentmain.Post-deploy test plan
Needs the API change deployed and a CLI release carrying this change. From inside a sandbox on the test organization, as an agent turn a person sent:
depot agent create "Reply with the word ready" --watch -o jsonexits 0 and prints the reply.depot agent send <id> "Now reply with the word done" --watch -o jsonexits 0 and prints the second reply.depot agent watch <id> --until-idleexits 0.🤖 Generated with Claude Code
https://claude.ai/code/session_01RQk3K7GpvQg7ySXyCrirEe
Note
Medium Risk
Changes agent CLI authentication for several session RPCs in sandbox environments; mistakes could block agent turns from watching or messaging sessions, though stop/org flows and explicit user tokens are preserved.
Overview
In a Dispatch sandbox,
depot agent watch,create --watch,send, andlaunchnow authenticate with the turn’s own token (not the cache/org token) forWatchSession,SendInput, andLaunch, matching DEP-8577.stopstill requires an org token forInterruptSession/ArchiveSession.ResolveAgentAuthnow returns a single credential plus aturnflag: inside a turn it prefers the minted turn token ahead ofDEPOT_CACHE_TOKEN; explicit--token/ env paths are unchanged.Agent commands route through
turnCallerand a unifiedauthedhelper instead of the old split betweenasTurnand org auth. When the API rejects the turn token,caller.refusednames the RPC and points users to--token/DEPOT_TOKEN; failed watches after create/send/launch add guidance to usedepot agent logs.Tests in
credential_test.goandtoken_test.goassert per-RPCAuthorizationheaders (with and without a cache token) and backward-compatible error text when the API still refuses the turn token.Reviewed by Cursor Bugbot for commit 694445b. Bugbot is set up for automated code reviews on this repo. Configure here.