-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: implement agent socket api, client and cli #20758
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
300321f to
0308560
Compare
a17863a to
9fdc98d
Compare
f75b9fa to
53a0bb9
Compare
f7245fa to
79d783a
Compare
53a0bb9 to
eb34bc4
Compare
eb34bc4 to
c8e8c20
Compare
mafredri
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, some minor feedback inline, mainly re: lib design.
agent/agentsocket/server.go
Outdated
| return c.conn.Close() | ||
| } | ||
| return nil | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: client.go
relates to: coder/internal#1094 This is number 4 of 5 pull requests in an effort to add agent script ordering. It adds an API client that can call the workspace agent socket API for script ordering operations. In a follow-up PR, CLI commands will be added that consume this API. I used an LLM to produce some of these changes, but I have conducted thorough self review and consider this contribution to be ready for an external reviewer. --------- Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
mafredri
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor nit about test placement, otherwise good to go 👍🏻
| }) | ||
| } | ||
|
|
||
| func TestAgentInitializesOnWindowsWithoutSocketServer(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test belongs IMO in agent/agent_test.go.
| ping Test agent socket connectivity and health | ||
| start Wait until all unit dependencies are satisfied | ||
| status Show unit status and dependency state | ||
| want Declare that a unit depends on another unit completing before it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be shorter to make it look nicer (follow-up PR if you want).
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.