Skip to content

computer: Carry Think methods onto clients - #26

Merged
aron-cf merged 1 commit into
mainfrom
fix/think-remote-compatibility
Jul 30, 2026
Merged

computer: Carry Think methods onto clients#26
aron-cf merged 1 commit into
mainfrom
fix/think-remote-compatibility

Conversation

@cjol

@cjol cjol commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

This PR carries Think's optional filesystem compatibility methods onto clients returned by getWorkspace() when the owning Workspace enables useThink. Local workspaces already received these methods, but local and remote clients dropped that owner-side choice, which forced consumers to duplicate Computer's filesystem translations.

useThink remains a single owner-side opt-in. The workspace exposes its resolved value, the remote stub carries it across RPC, and the shared client factory applies the same compatibility methods to either client path. Clients whose owner leaves the option disabled keep their existing shape.

The public WorkspaceClient.fs surface now uses WorkspaceFilesystem instead of any, and its optional Think methods describe the runtime-dependent client shape. A remote stub is disposed if reading its configuration or constructing the client fails.

The package README and virtual filesystem guide now document that useThink applies to getWorkspace() clients. The next Computer alpha can be used by the Agents SDK without a second filesystem adapter.

Workspace clients returned by getWorkspace() omit the Think compatibility surface even when the owner enables useThink. Remote Think consumers must otherwise duplicate Computer's filesystem translations or avoid the common client API.

Preserve the owner option on Workspace and its remote stub, then install the shared compatibility methods while constructing local and remote clients. Type the common filesystem surface so consumers can use it without an unsafe filesystem cast.

Clients whose owner leaves useThink disabled remain unchanged. Remote stubs are also disposed if client initialization fails.
@pkg-pr-new

pkg-pr-new Bot commented Jul 30, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/cloudflare/computer/@cloudflare/computer@26

commit: 6208b43

@aron-cf aron-cf 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.

Amazing, thanks for fixing this.

@aron-cf
aron-cf merged commit e23c4f1 into main Jul 30, 2026
11 checks passed
@aron-cf
aron-cf deleted the fix/think-remote-compatibility branch July 30, 2026 21:22
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.

2 participants