Skip to content

Conversation

@SasSwart
Copy link
Contributor

@SasSwart SasSwart commented Nov 11, 2025

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.

@SasSwart SasSwart force-pushed the jjs/internal-1095-branch4-sdk-client branch 2 times, most recently from 23f500f to 01f7f04 Compare November 13, 2025 10:09
@SasSwart SasSwart changed the base branch from main to jjs/internal-1095-branch3-agent-integration November 13, 2025 10:10
@SasSwart SasSwart changed the title Jjs/internal 1095 branch4 sdk client chore(agentsdk): add agentsocket api client Nov 13, 2025
@SasSwart SasSwart changed the title chore(agentsdk): add agentsocket api client chore(codersdk): add agentsocket api client Nov 14, 2025
@SasSwart SasSwart marked this pull request as ready for review November 14, 2025 09:32
@mafredri mafredri self-requested a review November 14, 2025 12:03
@SasSwart SasSwart force-pushed the jjs/internal-1095-branch3-agent-integration branch from af5fe5a to f75b9fa Compare November 14, 2025 13:16
@SasSwart SasSwart force-pushed the jjs/internal-1095-branch4-sdk-client branch from 831a36b to c300efb Compare November 14, 2025 13:22
@SasSwart SasSwart force-pushed the jjs/internal-1095-branch3-agent-integration branch from f75b9fa to 53a0bb9 Compare November 17, 2025 13:54
@SasSwart SasSwart force-pushed the jjs/internal-1095-branch4-sdk-client branch from c300efb to 234bb48 Compare November 17, 2025 14:18
@SasSwart SasSwart force-pushed the jjs/internal-1095-branch3-agent-integration branch 2 times, most recently from eb34bc4 to c8e8c20 Compare November 21, 2025 11:13
@SasSwart SasSwart force-pushed the jjs/internal-1095-branch4-sdk-client branch from 234bb48 to 72a8f70 Compare November 24, 2025 10:15
@SasSwart SasSwart changed the title chore(codersdk): add agentsocket api client chore: add agentsocket api client Nov 24, 2025
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

Since logic doesn't change much, this PR would normally be an easy approve, but fundamentally I think this might be the wrong approach. I think there should be a larger benefit than slight improvements in ergonomics of using the client as the burden to maintain it becomes greater. Are there any future plans I'm overlooking?

@SasSwart
Copy link
Contributor Author

SasSwart commented Nov 25, 2025

I think there should be a larger benefit than slight improvements in ergonomics of using the client as the burden to maintain it becomes greater. Are there any future plans I'm overlooking?

Ergonomics are a benefit. But I primarily include clients like these as an Anti Corruption Layer. It translates between abstractions layers. This feature is still in its early stages and I would like to isolate changes on one side of this client so they don't impact the other side as far as possible.

I judge the benefits of such a layer to outweigh the cost of its maintenance, but if you feel strongly that its not the right move, we can remove it. It will be easy to take out once we have the CLI in place. How do you feel about deferring judgement on the removal of the client until we've seen the CLI use it?

@SasSwart SasSwart requested a review from mafredri November 25, 2025 10:02
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

This is now basically in approve territory, but I'm on the fence about the Windows change. (And one more suggestion.)

}

// SyncStatus gets the status of a unit and its dependencies.
func (c *Client) SyncStatus(ctx context.Context, unitName string) (*SyncStatusResponse, error) {
Copy link
Member

Choose a reason for hiding this comment

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

For this case, I'd still advise to consider returning the proto types directly. This is a 1-to-1 conversion where the only change is where this type is defined.

If you disagree with the above, consider at least simplifying the return signature and dropping the pointer to response. Less indirection, safer to use, conveys that "this is not referenced elsewhere and safe to mutate".

…ndows despite the unsupported agentsocket feature
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

Approved based on changes in next PR.

…20719)

relates to: coder/internal#1094

This is number 5 of 5 pull requests in an effort to add agent script
ordering. It adds CLI commands that allow coder scripts to manage
dependencies between one another at runtime.

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>
@SasSwart SasSwart merged commit 75771dc into jjs/internal-1095-branch3-agent-integration Nov 27, 2025
26 checks passed
@SasSwart SasSwart deleted the jjs/internal-1095-branch4-sdk-client branch November 27, 2025 13:18
@github-actions github-actions bot locked and limited conversation to collaborators Nov 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants