Skip to content

think: drop @cloudflare/shell - #2555

Closed
mattzcarey wants to merge 1 commit into
think-computer-toolsfrom
think-drop-shell
Closed

mattzcarey wants to merge 1 commit into
think-computer-toolsfrom
think-drop-shell

Conversation

@mattzcarey

@mattzcarey mattzcarey commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Think no longer depends on @cloudflare/shell. The execute tool's state option and its state.* sandbox namespace are removed. To give sandboxed code the workspace, pass createAITools({ workspace: this.workspace }) as tools.

This is the last Shell import in Think. Codemode is on its way out too, so we're dropping the connector rather than porting it to Computer.

Tests ran: think workers suite.


Devin Review

@agent-think

agent-think Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

✅ agents import sizes: no significant changes (f5e63a97 → 6656bb05, workflow run)

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 4 potential issues.

Devin Review

Comment on lines -227 to -229
if (options.state) {
connectors.push(new StateConnector(options.ctx, options.state));
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔴 Stale workspace reads after approval

After a file changes during an approval pause, tools.read replays its old result instead of reading the file again. ToolSetConnector logs reads, while the removed StateConnector re-executed them. Resumed code can overwrite newer file edits.

Learn more

Codemode stores connector results to replay execution after a human approves a paused call. The removed StateConnector marks filesystem reads as replay: "reexecute", so they observe the current workspace on resume. The replacement workspace tools travel through ToolSetConnector, which does not mark reads this way. On resume, runtime.decide returns the recorded result for a non-ephemeral call. This can feed stale file contents to a resumed write.

Example: A script reads /workspace/notes.txt containing alpha, pauses for approval, then writes an edited copy. Another turn changes the file to alpha\nbeta before approval. The resumed script receives its logged alpha read and writes over beta.

Recommended fix: Preserve replay: "reexecute" for read-only workspace calls in the connector used by createExecuteRuntime. Add a test that changes a file between a pause and approval and checks that the resumed read observes the change.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines -227 to -229
if (options.state) {
connectors.push(new StateConnector(options.ctx, options.state));
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Existing approvals strand paused executions

After upgrading an explicit state runtime, approveExecution cannot resume its pending runs, even when the gated call uses tools.*. resumeCodemode requires every connector recorded at execution start, including the removed state connector.

Learn more

Codemode records the complete connector list when an execution begins, not only the connectors the script called. Before this change, callers supplying the explicit state option recorded state alongside their other connectors. The runtime keeps the same durable name, but the new connector assembly omits state. resumeCodemode rejects a paused execution before approving its action if any recorded connector is missing.

Example: A previous deployment starts async () => await tools.deploy({ target: "prod" }) with both state and tools configured. The run pauses for approval. After deployment removes the state option, approving that run returns a missing-state error instead of deploying, though its script never calls state.

Recommended fix: Define an upgrade path for paused executions recorded with state: retain a compatible connector until they resolve, or explicitly settle/reject those executions and reconcile their transcript outputs during migration. Test an approval across the old/new connector configuration.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines 224 to 229
if (connectors.length === 0) {
throw new Error(
"createExecuteTool has nothing to expose — provide at least one of " +
"`tools`, `state`, `browser`, or `connectors`."
"`tools`, `browser`, or `connectors`."
);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔍 Execution guide retains the removed API

The execution guide still teaches state.* and an explicit state option. Readers following its one-liner example now get a tool with no connectors unless a browser binding exists.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

"@cloudflare/think": minor
---

Think no longer depends on `@cloudflare/shell`. The execute tool's `state` option is removed, along with the `state.*` sandbox namespace it added. To give sandboxed code the workspace, pass the workspace tools: `createExecuteTool(this, { tools: createAITools({ workspace: this.workspace }) })`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔍 Changeset lacks a documentation link

The repository's changeset convention requires a link to relevant documentation. This description gives the migration command but no documentation link.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@pkg-pr-new

pkg-pr-new Bot commented Oct 12, 2026

Copy link
Copy Markdown

Open in StackBlitz

agents

npm i https://pkg.pr.new/agents@2555

@cloudflare/ai-chat

npm i https://pkg.pr.new/@cloudflare/ai-chat@2555

@cloudflare/codemode

npm i https://pkg.pr.new/@cloudflare/codemode@2555

hono-agents

npm i https://pkg.pr.new/hono-agents@2555

@cloudflare/shell

npm i https://pkg.pr.new/@cloudflare/shell@2555

@cloudflare/think

npm i https://pkg.pr.new/@cloudflare/think@2555

@cloudflare/voice

npm i https://pkg.pr.new/@cloudflare/voice@2555

@cloudflare/worker-bundler

npm i https://pkg.pr.new/@cloudflare/worker-bundler@2555

commit: 6656bb0

@mattzcarey

Copy link
Copy Markdown
Member Author

Replaced by a cleaner stack, #2559 to #2565.

@mattzcarey mattzcarey closed this Oct 12, 2026
@mattzcarey
mattzcarey deleted the think-drop-shell branch October 12, 2026 11:49
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