Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: Think agents now use a @cloudflare/computer workspace
description: Think and Agent Skills now use @cloudflare/computer for their workspace. @cloudflare/shell is deprecated.
products:
- agents
- workers
date: 2026-10-20
---

import { TypeScriptExample } from "~/components";

[Think](/agents/harnesses/think/) and [Agent Skills](/agents/runtime/execution/agent-skills/) now use the workspace from [`@cloudflare/computer`](https://github.com/cloudflare/computer) as well as the filesystem tools. A JavaScript execution environment can be configured by adding the `JavaScriptWorkerBackend`.

`@cloudflare/shell` is deprecated, and so is Think's `createExecuteTool`. These will no longer be developed nor supported from today onwards.

<TypeScriptExample>

```ts
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 }),
],
});
}
```

</TypeScriptExample>

## Migrate your workspace data

This is a breaking change. @cloudflare/computer stores files in different tables from @cloudflare/shell, and there is no automatic data migration between workspace formats. To keep an existing workspace, copy its files with the script in [Migrating from `@cloudflare/shell` to `@cloudflare/computer`](https://github.com/cloudflare/agents/blob/main/docs/shell/migrating-to-computer.md). Otherwise your agent will start with an empty workspace, though the original data will still be present in the existing tables.

For more information, refer to [Think tools](/agents/harnesses/think/tools/#built-in-workspace-tools).
37 changes: 17 additions & 20 deletions src/content/docs/agents/harnesses/think/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@ Think is configured by overriding methods and properties on your `Think` subclas
| `configureSession()` | identity | Add context blocks, compaction, search, skills — refer to [Sessions](/agents/runtime/lifecycle/sessions/) |
| `getSkills()` | `[]` | Return Agent Skills sources for on-demand skill activation — refer to [Agent Skills](/agents/runtime/execution/agent-skills/) |
| `getSkillScriptRunner()` | `null` | Enable the optional `run_skill_script` tool |
| `workspaceBash` | `true` | Include or configure the default workspace `bash` tool — refer to [Tools](/agents/harnesses/think/tools/) |
| `messageConcurrency` | `"queue"` | How overlapping submits behave — refer to [Client tools](/agents/harnesses/think/client-tools/#message-concurrency) |
| `includeMcpTools` | `true` | Convert connected MCP tools to AI SDK tools and add them to model turns. Refer to [MCP tools](/agents/harnesses/think/tools/#mcp-tools) |
| `includeMcpTools` | `true` | Convert connected MCP tools to AI SDK tools and add them to model turns. Refer to [MCP tools](/agents/harnesses/think/tools/#mcp-tools) |
| `waitForMcpConnections` | `false` | Wait for MCP servers before inference |
| `chatRecovery` | Always on | Durable recovery configuration. Refer to [Durable recovery](/agents/harnesses/think/recovery/) for all options and defaults |
| `chatStreamStallTimeoutMs` | `0` (off) | Opt-in inactivity watchdog: abort a turn whose model stream produces no chunk for this long (measures the gap between chunks, including tool execution). A stall routes into bounded recovery |
| `chatRecovery` | Always on | Durable recovery configuration. Refer to [Durable recovery](/agents/harnesses/think/recovery/) for all options and defaults |
| `chatStreamStallTimeoutMs` | `0` (off) | Opt-in inactivity watchdog: abort a turn whose model stream produces no chunk for this long (measures the gap between chunks, including tool execution). A stall routes into bounded recovery |
| `contextOverflow` | `undefined` | Opt-in mid-turn context-overflow handling with `reactive`, `maxRetries`, and `proactive` options. Requires `classifyChatError` plus a session compaction function — refer to [Context-window overflow recovery](/agents/harnesses/think/recovery/#context-window-overflow-recovery) |

For `chatRecovery` and `chatStreamStallTimeoutMs` behavior, refer to [Durable recovery](/agents/harnesses/think/recovery/).
Expand Down Expand Up @@ -122,17 +121,16 @@ For the full Session API — context blocks, compaction, search, skills, and mul

## Package exports

| Export | Description |
| --------------------------------------- | ------------------------------------------------------------- |
| `@cloudflare/think` | `Think`, `Session`, `Workspace`, `skills` namespace |
| `@cloudflare/think/messengers` | Messenger contracts, Chat SDK bridge, state agent, delivery |
| `@cloudflare/think/messengers/telegram` | Telegram messenger provider and delivery helpers |
| `@cloudflare/think/workflows` | `ThinkWorkflow`, `step.prompt()` — Workflow prompts |
| `@cloudflare/think/tools/workspace` | `createWorkspaceTools()` — for custom storage backends |
| `@cloudflare/think/tools/execute` | `createExecuteTool()` — sandboxed code execution via Code Mode |
| `@cloudflare/think/tools/browser` | `createBrowserTools()` — Chrome DevTools Protocol tools |
| `@cloudflare/think/tools/extensions` | `createExtensionTools()` — LLM-driven extension loading |
| `@cloudflare/think/extensions` | `ExtensionManager`, `HostBridgeLoopback` — extension runtime |
| Export | Description |
| --------------------------------------- | ------------------------------------------------------------ |
| `@cloudflare/think` | `Think`, `Session`, `skills` namespace |
| `@cloudflare/think/messengers` | Messenger contracts, Chat SDK bridge, state agent, delivery |
| `@cloudflare/think/messengers/telegram` | Telegram messenger provider and delivery helpers |
| `@cloudflare/think/workflows` | `ThinkWorkflow`, `step.prompt()` — Workflow prompts |
| `@cloudflare/think/tools/execute` | `createExecuteTool()` — deprecated Code Mode execution tool |
| `@cloudflare/think/tools/browser` | `createBrowserTools()` — Chrome DevTools Protocol tools |
| `@cloudflare/think/tools/extensions` | `createExtensionTools()` — LLM-driven extension loading |
| `@cloudflare/think/extensions` | `ExtensionManager`, `HostBridgeLoopback` — extension runtime |

## Dependencies

Expand All @@ -143,14 +141,13 @@ Peer dependencies you provide:
| `agents` | yes | Cloudflare Agents SDK |
| `ai` | yes | AI SDK v6 |
| `zod` | yes | Schema validation (v4) |
| `@cloudflare/computer` | yes | Workspace and workspace tools |
| `@chat-adapter/telegram` | optional | Required for Telegram messengers |

Bundled with `@cloudflare/think`:

| Package | Notes |
| ---------------------- | ----------------------------------------------------- |
| `@cloudflare/shell` | `Workspace` filesystem |
| `@cloudflare/codemode` | Code execution for `createExecuteTool()` |
| `just-bash` | Sandboxed shell for the default workspace `bash` tool |
| Package | Notes |
| ---------------------- | ---------------------------------------- |
| `@cloudflare/codemode` | Code execution for `createExecuteTool()` |

The Agent Skills engine and its script runner live in [`agents/skills`](/agents/runtime/execution/agent-skills/), so skill scripts pull `@cloudflare/worker-bundler` and `just-bash` through `agents`, not Think.
8 changes: 4 additions & 4 deletions src/content/docs/agents/harnesses/think/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ By the end of this tutorial you will have a Think agent that:

- Streams responses to a React chat UI
- Has persistent memory the model can read and write
- Includes workspace file tools (read, write, edit, find, grep, delete)
- Includes workspace file tools (read, ls, find, grep, write, edit, delete) from @cloudflare/computer
- Supports custom server-side tools

## Prerequisites
Expand All @@ -37,7 +37,7 @@ npm init -y
Install dependencies:

```sh
npm install @cloudflare/think @cloudflare/ai-chat agents ai @cloudflare/shell zod workers-ai-provider react react-dom
npm install @cloudflare/think @cloudflare/computer @cloudflare/ai-chat agents ai zod workers-ai-provider react react-dom
npm install -D wrangler @cloudflare/vite-plugin @cloudflare/workers-types @vitejs/plugin-react @tailwindcss/vite tailwindcss typescript vite
```

Expand Down Expand Up @@ -133,7 +133,7 @@ This is a working agent. Think automatically provides:
- WebSocket chat protocol (compatible with `useAgentChat`)
- Message persistence in SQLite
- Resumable streaming (page refresh replays buffered chunks)
- Workspace file tools (read, write, edit, list, find, grep, delete)
- Workspace file tools (read, ls, find, grep, write, edit, delete)
- Abort/cancel support
- Error handling with partial message persistence

Expand Down Expand Up @@ -297,7 +297,7 @@ export class MyAgent extends Think<Env> {

Think merges tools from multiple sources automatically. On every turn, the model has access to:

1. **Workspace tools** — read, write, edit, list, find, grep, delete, bash (built-in)
1. **Workspace tools** — read, ls, find, grep, write, edit, delete, plus exec when the Workspace has a backend (built-in)
2. **Your tools** — from `getTools()`
3. **Extension tools** — from loaded extensions
4. **Session tools** — set_context, load_context, search_context (from `configureSession`)
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/agents/harnesses/think/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ If this is your first agent, start with the [Getting started tutorial](/agents/h

### Install

<PackageManagers pkg="@cloudflare/think @cloudflare/ai-chat agents ai @cloudflare/shell zod workers-ai-provider" />
<PackageManagers pkg="@cloudflare/think @cloudflare/computer @cloudflare/ai-chat agents ai zod workers-ai-provider" />

Think supports AI SDK v6 and v7. Use `ai@^6` with `@ai-sdk/react@^3`, or use `ai@^7` with `@ai-sdk/react@^4`. Keep the AI SDK packages on matching major versions throughout your project.

Expand Down
Loading
Loading