Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.29.0"
".": "1.30.0"
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.30.0 (2026-08-20)

Full Changelog: [v1.29.0...v1.30.0](https://github.com/runloopai/api-client-ts/compare/v1.29.0...v1.30.0)

### Features

* **devboxes:** use optimistic create endpoint ([#825](https://github.com/runloopai/api-client-ts/issues/825)) ([07c0ca0](https://github.com/runloopai/api-client-ts/commit/07c0ca079a3ed09d2350d320323b616e471d0b03))

## 1.29.0 (2026-08-20)

Full Changelog: [v1.28.0...v1.29.0](https://github.com/runloopai/api-client-ts/compare/v1.28.0...v1.29.0)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@runloop/api-client",
"version": "1.29.0",
"version": "1.30.0",
"description": "The official TypeScript library for the Runloop API",
"author": "Runloop <support@runloop.ai>",
"types": "dist/sdk.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"dxt_version": "0.2",
"name": "@runloop/api-client-mcp",
"version": "1.29.0",
"version": "1.30.0",
"description": "The official MCP Server for the Runloop API",
"author": {
"name": "Runloop",
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@runloop/api-client-mcp",
"version": "1.29.0",
"version": "1.30.0",
"description": "The official MCP Server for the Runloop API",
"author": "Runloop <support@runloop.ai>",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const newMcpServer = async (stainlessApiKey: string | undefined) =>
new McpServer(
{
name: 'runloop_api_client_api',
version: '1.29.0',
version: '1.30.0',
},
{
instructions: await getInstructions(stainlessApiKey),
Expand Down
8 changes: 7 additions & 1 deletion src/resources/devboxes/devboxes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,13 @@ export class Devboxes extends APIResource {
options?: LongPollRequestOptions<DevboxView>,
): Promise<DevboxView> {
const { longPoll, polling, ...requestOptions } = options ?? {};
const devbox = await this.create(body, requestOptions);
const devbox = (await this._client.post('/v1/devboxes/create_and_await_running', {
body: body ?? {},
...requestOptions,
})) as DevboxView;
if (devbox.status === 'running') {
return devbox;
}
return this.awaitRunning(devbox.id, { ...requestOptions, longPoll, polling });
}
/**
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '1.29.0'; // x-release-please-version
export const VERSION = '1.30.0'; // x-release-please-version
22 changes: 17 additions & 5 deletions tests/api-resources/devboxes/devboxes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ describe('resource devboxes', () => {
expect(mockPost).toHaveBeenCalledTimes(2);

// Check create call
expect(mockPost).toHaveBeenNthCalledWith(1, '/v1/devboxes', {
expect(mockPost).toHaveBeenNthCalledWith(1, '/v1/devboxes/create_and_await_running', {
body: { name: 'test-devbox' },
});

Expand All @@ -731,16 +731,28 @@ describe('resource devboxes', () => {
mockPost.mockRestore();
});

test('createAndAwaitRunning: returns an optimistic running response without polling', async () => {
const mockPost = jest.spyOn(client.devboxes['_client'], 'post');
mockPost.mockResolvedValueOnce({ id: 'new-devbox-id', status: 'running' });

const result = await client.devboxes.createAndAwaitRunning({ name: 'test-devbox' });

expect(result).toEqual({ id: 'new-devbox-id', status: 'running' });
expect(mockPost).toHaveBeenCalledTimes(1);
expect(mockPost).toHaveBeenCalledWith('/v1/devboxes/create_and_await_running', {
body: { name: 'test-devbox' },
});
});

test('createAndAwaitRunning: handles creation failure', async () => {
const mockPost = jest.spyOn(client.devboxes['_client'], 'post');

const createError = new Error('Creation failed');
mockPost.mockRejectedValueOnce(createError);
const createError = new APIError(400, undefined, 'Creation failed', {});
mockPost.mockRejectedValue(createError);

await expect(client.devboxes.createAndAwaitRunning()).rejects.toThrow('Creation failed');

expect(mockPost).toHaveBeenCalledTimes(1);
expect(mockPost).toHaveBeenCalledWith('/v1/devboxes', { body: {} });
expect(mockPost).toHaveBeenCalledWith('/v1/devboxes/create_and_await_running', { body: {} });

mockPost.mockRestore();
});
Expand Down