Skip to content

Conversation

35C4n0r
Copy link
Collaborator

@35C4n0r 35C4n0r commented Sep 14, 2025

Description

This PR handles the Step 1 of the feedback mentioned here #86 (review).

@35C4n0r 35C4n0r changed the title feat: integrate SDK wip: integrate SDK Sep 14, 2025
Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

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

I think this is too large a change to make in one swoop.
The way I see it, we have two things we need to do:

  1. Refactor the existing codebase such that the HTTP handler only has to worry about a single interface that exposes the methods common to all agent implementations, e.g.
  type AgentHandler interface {
      GetStatus(ctx context.Context) (*types.StatusResponse, error)
      GetMessages(ctx context.Context) (*types.MessagesResponse, error)
      CreateMessage(ctx context.Context, input *types.MessageRequest) (*types.MessageResponse, error)
      SubscribeEvents(ctx context.Context, input *struct{}) (<-chan Event, error)
  }

A lot of agent-specific 'quirks' are currently handled in lib/msgfmt but this could be still used behind the scenes of the implementation.

  1. Once the above is completed, a new implementation of the above interface can use the SDK methods but expose them in the same way.

What you're doing right now is essentially both 1 and 2 at the same time, which is a lot at once.

@35C4n0r 35C4n0r changed the title wip: integrate SDK feat: abstract CLI Agent Handler Sep 22, 2025
@35C4n0r 35C4n0r marked this pull request as ready for review September 22, 2025 17:50
@35C4n0r 35C4n0r requested a review from johnstcn September 22, 2025 17:50
@35C4n0r
Copy link
Collaborator Author

35C4n0r commented Sep 22, 2025

@johnstcn Thanks for the feedback.
This PR now handles only the Step 1.

PS: I haven't exposed the --interaction flag yet as the overall feature is still wip.

@35C4n0r 35C4n0r requested a review from johnstcn September 23, 2025 15:41
Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

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

The attach command is broken with this change, can you take a look?

Copy link

github-actions bot commented Oct 1, 2025

✅ Preview binaries are ready!

To test with modules: agentapi_version = "agentapi_86" or download from: https://github.com/coder/agentapi/releases/tag/agentapi_86

Copy link

github-actions bot commented Oct 1, 2025

✅ Preview binaries are ready!

To test with modules: agentapi_version = "agentapi_86" or download from: https://github.com/coder/agentapi/releases/tag/agentapi_86

1 similar comment
Copy link

github-actions bot commented Oct 1, 2025

✅ Preview binaries are ready!

To test with modules: agentapi_version = "agentapi_86" or download from: https://github.com/coder/agentapi/releases/tag/agentapi_86

@35C4n0r
Copy link
Collaborator Author

35C4n0r commented Oct 1, 2025

The attach command is broken with this change, can you take a look?

@johnstcn fixed this.

@35C4n0r 35C4n0r requested a review from johnstcn October 1, 2025 18:00
Copy link

github-actions bot commented Oct 1, 2025

✅ Preview binaries are ready!

To test with modules: agentapi_version = "agentapi_86" or download from: https://github.com/coder/agentapi/releases/tag/agentapi_86

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.

2 participants