Skip to content

feat(think): move to Computer 0.10 and its codemode names - #2819

Draft
ben-reitz wants to merge 2 commits into
mainfrom
computer/next-release
Draft

ben-reitz wants to merge 2 commits into
mainfrom
computer/next-release

Conversation

@ben-reitz

@ben-reitz ben-reitz commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Computer 0.10 renames the JavaScript backend and its host modules, so Think, its docs and the examples need to follow before they can move to it. This upgrades every @cloudflare/computer dependency, and Think's peer range, to ^0.10.0.

Draft until Computer 0.10.0 is published. The top commit points everything at the preview build of cloudflare/computer#305 so CI can run now, and gets dropped before merging.

Summary

- import { WorkerJavaScriptBackend } from "@cloudflare/computer/backends/worker-javascript";
+ import { CodemodeBackend } from "@cloudflare/computer/backends/codemode";

- new WorkerJavaScriptBackend({
-   id: "js",
-   modules: { "ws:tools": createToolBindings(...) }
+ new CodemodeBackend({
+   modules: { "codemode:tools": createToolBindings(...) }
  })

  // code the model runs
- import { getWeather } from "ws:tools";
+ import { getWeather } from "codemode:tools";
  • Backends use the new default id "codemode" instead of setting "js" or "javascript", and backend references follow.
  • The pi and opencode harness examples pass exec: { backends } instead of the deprecated shell option.
  • Think gets a minor changeset, since its Computer peer range moves to ^0.10.0.

Evidence

With the preview build: pnpm run build, pnpm run check, and nx affected -t test all pass (27 projects, including Think's workspace tools tests running code on the "codemode" backend).

Merge Danger

Door: two-way

Blast Radius: Think users

Think's peer range moves to ^0.10.0, so upgrading Think means upgrading Computer, and their code needs the same renames.

Before merging

  1. Drop the TEMP commit.
  2. pnpm install and commit the lockfile.
  3. Rerun build, check and tests.

Move every @cloudflare/computer dependency, and Think's peer range, to
^0.10.0. Computer 0.9 renamed the host module prefix from ws: to
codemode:, and 0.10 renames WorkerJavaScriptBackend to CodemodeBackend
(@cloudflare/computer/backends/codemode), changes its default id to
"codemode", and reshapes the tool sets' exec option to
{ backends, output, metadata }.

- Import CodemodeBackend from @cloudflare/computer/backends/codemode.
- Every CodemodeBackend uses the default "codemode" id instead of
  "js" or "javascript", and backend references follow.
- Rename ws:git and ws:tools to codemode:git and codemode:tools in
  backend modules, isolate imports, tool descriptions and docs.
- The pi and opencode harness examples pass exec: { backends } instead
  of the deprecated shell option.
- Add a Think changeset for the new peer range.
Point every @cloudflare/computer dependency at the pkg.pr.new preview
of cloudflare/computer#305 through a root pnpm override, until 0.10.0
is published.
@changeset-bot

changeset-bot Bot commented Nov 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e54e610

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@cloudflare/think Minor
@cloudflare/agent-think Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant