feat(agent): add agent object to allow for agent use in object oriented SDK#659
feat(agent): add agent object to allow for agent use in object oriented SDK#659
Conversation
|
CodeAnt AI is reviewing your PR. Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
CodeAnt AI finished reviewing your PR. |
|
| Metric | Coverage | Required | Status |
|---|---|---|---|
| Functions | 91.73% | 100% | ❌ |
| Lines | 81.74% | - | ℹ️ |
| Branches | 47.11% | - | ℹ️ |
| Statements | 81.4% | - | ℹ️ |
Coverage Requirement: 100% function coverage (all public methods must be called in smoke tests)
View detailed coverage report
Coverage reports are available in the workflow artifacts. Lines/branches/statements coverage is tracked but not required to be 100%.
src/sdk/agent.ts
Outdated
| * @param {Core.RequestOptions & { polling?: Partial<PollingOptions<DevboxView>> }} [options] - Request options with optional polling configuration | ||
| * @returns {Promise<Devbox>} A new {@link Devbox} instance with this agent mounted | ||
| */ | ||
| async createDevbox( |
There was a problem hiding this comment.
I am not sure if this makes sense - probably not? should I make changes to the devbox.create path to accept agent objects or just pass in ids or what is convention?
|
CodeAnt AI is running Incremental review Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
| Metric | Coverage | Required | Status |
|---|---|---|---|
| Functions | 92.5% | 100% | ❌ |
| Lines | 82.55% | - | ℹ️ |
| Branches | 51.04% | - | ℹ️ |
| Statements | 82.18% | - | ℹ️ |
Coverage Requirement: 100% function coverage (all public methods must be called in smoke tests)
View detailed coverage report
Coverage reports are available in the workflow artifacts. Lines/branches/statements coverage is tracked but not required to be 100%.
|
CodeAnt AI Incremental review completed. |
sid-rl
left a comment
There was a problem hiding this comment.
nit: cache AgentView properties within the Agent object
| * @param {Core.RequestOptions} [options] - Request options | ||
| * @returns {Promise<AgentView>} The agent data | ||
| */ | ||
| async getInfo(options?: Core.RequestOptions): Promise<AgentView> { |
There was a problem hiding this comment.
If we expect AgentView properties to be immutable, we should save them as private members and expose them via get
There was a problem hiding this comment.
We yeah could just have a private variable this pattern isn't really followed elsewhere but we could start here, the only thing is if you call fromId you don't have this info and you'd have to always call it, or lazy load it. Idk probably fine just to leave it as is for now
| * @param {Core.RequestOptions} [options] - Request options | ||
| * @returns {Promise<Agent>} A new {@link Agent} instance | ||
| */ | ||
| static async create( |
There was a problem hiding this comment.
This OO object really doesn't provide much value, is this going to be passed into say an devbox agent mount? What operations can you do on an agent... maybe launch a devbox with that agent via a similar command to blueprint.createDevbox or snapshot.createDevbox. This is a nit something to think about
| */ | ||
| async getInfo(options?: Core.RequestOptions): Promise<AgentView> { | ||
| return await this.client.agents.retrieve(this._id, options); | ||
| } |
There was a problem hiding this comment.
You're missing smoke tests this should fail the smoke test check
f6ec4e2 to
86d8126
Compare
User description
This change adds a new agent object for use as part of the object oriented SDK.
Description
Users can now use the SDK to create a agent, this returns an agent object
or list agents which returns a list of agents. or fast create a devbox w/ the agent running on it.
Motivation
The agent API is a new extension of the runloop platform and we want first class support for it.
Changes
Testing
Breaking Changes
Checklist
feat:orfeat(scope):)CodeAnt-AI Description
Expose agent management from the Runloop SDK
What Changed
Impact
✅ Easier agent onboarding✅ Simpler devbox provisioning with agents✅ Clearer agent discovery💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.