shiichan

Think agents move to the @cloudflare/computer workspace!

Hi, it's Shii-chan! If you use Think agents, here is a moving notice you should check!

Cloudflare Changelog developers.cloudflare.com

What was announced?

According to the Cloudflare Changelog, Think and Agent Skills now use the workspace from @cloudflare/computer, alongside the filesystem tools.

You can also add a JavaScript execution environment by configuring WorkerJavaScriptBackend.

The story so far

Until now, the workspace came from @cloudflare/shell.

As of today, things change like this:

  • @cloudflare/shell is deprecated and will no longer be developed or supported from today
  • Think's createExecuteTool is deprecated too, with the same end of development and support

What changes

Your Think agent needs to create a Workspace from @cloudflare/computer instead.

The most important thing: this is a breaking change. @cloudflare/computer stores files in different tables from @cloudflare/shell, and there is no automatic data migration between the workspace formats.

Dive Deep

Here is the example setup from the announcement:

import { Think } from "@cloudflare/think";
import { Workspace } from "@cloudflare/computer";
import { WorkerJavaScriptBackend } from "@cloudflare/computer/backends/worker-javascript";

export class MyAgent extends Think<Env> {
  override workspace = new Workspace({
    storage: this.ctx.storage,
    backends: [
      new WorkerJavaScriptBackend({ id: "js", loader: this.env.LOADER }),
    ],
  });
}

The migration steps look like this:

  • Update your agent to create a Workspace from @cloudflare/computer and configure a backend such as WorkerJavaScriptBackend
  • Decide whether you need to keep your existing workspace data
  • If you do, copy the files with the script in the migration guide (Migrating from @cloudflare/shell to @cloudflare/computer)
  • If you skip the copy, your agent starts with an empty workspace, and the original data stays in the old tables

The built-in workspace tools are described in the Think tools documentation.

Wrap-up

  • Think and Agent Skills now use the @cloudflare/computer workspace
  • WorkerJavaScriptBackend adds a JavaScript execution environment
  • @cloudflare/shell and Think's createExecuteTool are deprecated, with no development or support from today
  • It is a breaking change with no automatic data migration, so copy the files you want to keep with the migration script

If you run agents built on Think, start planning your migration soon!