Skip to content

Comments

feat(agent): add agent object to allow for agent use in object oriented SDK#659

Open
wall-rl wants to merge 4 commits intonextfrom
wall-agent
Open

feat(agent): add agent object to allow for agent use in object oriented SDK#659
wall-rl wants to merge 4 commits intonextfrom
wall-agent

Conversation

@wall-rl
Copy link
Contributor

@wall-rl wall-rl commented Nov 21, 2025

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

  // Create an agent from git
  const agent = await runloop.agent.create({
    name: 'my-agent',
    source: {
      type: 'git',
      git: {
        repository: 'https://github.com/user/agent-repo',
        ref: 'main'
      }
    }
  });

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

  • Unit tests added
  • Integration tests added
  • Smoke Tests added/updated
  • Tested locally

Breaking Changes

Checklist

  • PR title follows Conventional Commits format (feat: or feat(scope):)
  • Documentation updated (if needed)
  • Breaking changes documented (if applicable)

CodeAnt-AI Description

Expose agent management from the Runloop SDK

What Changed

  • RunloopSDK now exposes agent operations so you can create or look up agents that can be mounted into devboxes via the new Agent object.
  • Added the Agent class and helpers so users can list agents, retrieve their details, and use them when provisioning agent-aware devboxes without touching raw endpoints.

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:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

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:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

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.

@codeant-ai
Copy link
Contributor

codeant-ai bot commented Nov 21, 2025

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 ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai bot added the size:XXL This PR changes 1000+ lines, ignoring generated files label Nov 21, 2025
@codeant-ai
Copy link
Contributor

codeant-ai bot commented Nov 21, 2025

CodeAnt AI finished reviewing your PR.

@github-actions
Copy link

⚠️ Object Smoke Tests & Coverage Report

Test Results

✅ All smoke tests passed

Coverage Results

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)

⚠️ Some object methods are not covered in smoke tests. Please add tests that call all public methods.

View detailed coverage report

Coverage reports are available in the workflow artifacts. Lines/branches/statements coverage is tracked but not required to be 100%.

📋 View workflow run

@wall-rl wall-rl changed the title POC: Add agent object to the OO SDK feat: add agent object to allow for agent use in object oriented SDK Nov 21, 2025
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(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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
Copy link
Contributor

codeant-ai bot commented Nov 22, 2025

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 ·
Reddit ·
LinkedIn

@wall-rl wall-rl requested review from dines-rl and sid-rl November 22, 2025 01:08
@codeant-ai codeant-ai bot added size:XXL This PR changes 1000+ lines, ignoring generated files and removed size:XXL This PR changes 1000+ lines, ignoring generated files labels Nov 22, 2025
@github-actions
Copy link

⚠️ Object Smoke Tests & Coverage Report

Test Results

✅ All smoke tests passed

Coverage Results

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)

⚠️ Some object methods are not covered in smoke tests. Please add tests that call all public methods.

View detailed coverage report

Coverage reports are available in the workflow artifacts. Lines/branches/statements coverage is tracked but not required to be 100%.

📋 View workflow run

@codeant-ai
Copy link
Contributor

codeant-ai bot commented Nov 22, 2025

CodeAnt AI Incremental review completed.

Copy link
Contributor

@sid-rl sid-rl left a comment

Choose a reason for hiding this comment

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

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> {
Copy link
Contributor

Choose a reason for hiding this comment

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

If we expect AgentView properties to be immutable, we should save them as private members and expose them via get

Copy link
Contributor

Choose a reason for hiding this comment

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

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

@dines-rl dines-rl changed the title feat: add agent object to allow for agent use in object oriented SDK feat(agent): add agent object to allow for agent use in object oriented SDK Nov 25, 2025
* @param {Core.RequestOptions} [options] - Request options
* @returns {Promise<Agent>} A new {@link Agent} instance
*/
static async create(
Copy link
Contributor

Choose a reason for hiding this comment

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

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);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

You're missing smoke tests this should fail the smoke test check

Base automatically changed from main to next January 22, 2026 16:28
@stainless-app stainless-app bot force-pushed the next branch 8 times, most recently from f6ec4e2 to 86d8126 Compare February 5, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL This PR changes 1000+ lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants