- Notifications
You must be signed in to change notification settings - Fork1.1k
feat: implement agent socket api, client and cli (#20758)#20976
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Open
SasSwart wants to merge1 commit intorelease/2.29Choose a base branch fromjjs/release-2.29-scriptordering
base:release/2.29
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
+1,313 −276
Conversation
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
closes:#10352closes:coder/internal#1094closes:coder/internal#1095In this pull request, we enable a new set of experimental cli commandsgrouped under `coder exp sync`.These commands allow any process acting within a coder workspace toinform the coder agent of its requirements and execution progress. Thecoder agent will then relay this information to other processes thathave subscribed.These commands are:```# Check if this feature is enabled in your environment coder exp sync ping# express that your unit depends on anothercoder exp sync want <unit> <dependency_unit> # express that your unit intends to start a portion of the script that requires # other units to have completed first. This command blocks until all dependencies have been metcoder exp sync start <unit> # express that your unit has completes its work, allowing dependent units to begin their executioncoder exp sync complete <unit>```Example:In order to automatically run claude code in a new workspace, it mustfirst have a git repository cloned. The scripts responsible for cloningthe repository and for running claude code would coordinate in thefollowing way:```bash# Script A: Claude code# Inform the agent that the claude script wants the git script.# That is, the git script must have completed before the claude script can begin its executioncoder exp sync want claude git# Inform the agent that we would now like to begin execution of claude.# This command will block until the git script (and any other defined dependencies)# have completedcoder exp sync start claude# Now we run claude code and any other commands we needclaude ...# Once our script has completed, we inform the agent, so that any scripts that depend on this one# may begin their executioncoder exp sync complete claude``````bash# Script B: Git# Because the git script does not have any dependencies, we can simply inform the agent that we # intend to startcoder exp sync start gitgit clone ssh://git@github.com/coder/coder# Once the repository have been cloned, we inform the agent that this script is complete, so that# scripts that depend on it may begin their execution.coder exp sync complete git```Notes:* Unit names (ie. `claude` and `git`) given as input to the synccommands are arbitrary strings. You do not have to conform to specificidentifiers. We recommend naming your scripts descriptively, butsuccinctly.* Scripts unit names should be well documented. Other scripts will needto know the names you've chosen in order to depend on yours. Therefore,you---------Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
Sign up for freeto 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.
closes:#10352
closes:coder/internal#1094
closes:coder/internal#1095
In this pull request, we enable a new set of experimental cli commands grouped under
coder exp sync.These commands allow any process acting within a coder workspace to inform the coder agent of its requirements and execution progress. The coder agent will then relay this information to other processes that have subscribed.
These commands are:
Example:
In order to automatically run claude code in a new workspace, it must first have a git repository cloned. The scripts responsible for cloning the repository and for running claude code would coordinate in the following way:
Notes:
claudeandgit) given as input to the sync commands are arbitrary strings. You do not have to conform to specific identifiers. We recommend naming your scripts descriptively, but succinctly.