Skip to content

computer: Wake the workspace host by name, not only by id (#243) - #244

Open
aron-cf wants to merge 1 commit into
mainfrom
fix/proxy-wake-by-name
Open

aron-cf wants to merge 1 commit into
mainfrom
fix/proxy-wake-by-name

Conversation

@aron-cf

@aron-cf aron-cf commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

WorkspaceProxy and WorkspaceServiceProxy resolved their host Durable Object with ns.get(ns.idFromString(id)). A container or Dynamic Worker outlives the object, so after an eviction or a deploy the proxy is often the first caller, and an instance woken through idFromString() has no ctx.id.name for its whole lifetime. agents' Lifecycle then refuses to start with "could not determine its Durable Object name".

WorkspaceRef, WorkspaceProxyProps and WorkspaceServiceProxyProps take an optional name. The proxies address the object with idFromName(name) when that yields the same id, and fall back to idFromString(id) otherwise, so id stays the authority on which object is meant. The container hosts and WorkerShellBackend fill the name in from ctx.id.name when the reference points at the object they run in, so the common same-object setup is fixed without code changes.

Fixes #243


Devin Review

WorkspaceProxy and WorkspaceServiceProxy resolved their host Durable
Object with ns.get(ns.idFromString(id)). A container or Dynamic Worker
outlives the object, so after an eviction or a deploy the proxy is
often the first caller, and an instance woken through idFromString()
has no ctx.id.name for its whole lifetime. agents' Lifecycle then
refuses to start with "could not determine its Durable Object name".

WorkspaceRef, WorkspaceProxyProps and WorkspaceServiceProxyProps take
an optional name. The proxies address the object with idFromName(name)
when that yields the same id, and fall back to idFromString(id)
otherwise, so id stays the authority on which object is meant. The
container hosts and WorkerShellBackend fill the name in from
ctx.id.name when the reference points at the object they run in, so
the common same-object setup is fixed without code changes.

Fixes #243
@changeset-bot

changeset-bot Bot commented Oct 15, 2026

Copy link
Copy Markdown

馃 Changeset detected

Latest commit: ccc6f98

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

This PR includes changesets to release 4 packages
Name Type
@cloudflare/computer Patch
@cloudflare/dofs Patch
@cloudflare/computer-rpc Patch
@cloudflare/computerd 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

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

Devin Review

// the proxy resolves env[binding].get(id).getWorkspace()
// on the host side.
HOST: ctx.exports.WorkspaceServiceProxy({ props: workspace }),
HOST: ctx.exports.WorkspaceServiceProxy({ props: withHostName(workspace, ctx) }),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

馃攳 Automatic name propagation remains untested end-to-end

The tests cover inferred names and name-aware routing separately. No workerd test confirms a backend passes its inferred name to a proxy, leaving the wake fix's wiring unverified.

Devin Review


Was this helpful? React with 馃憤 or 馃憥 to provide feedback.

@pkg-pr-new

pkg-pr-new Bot commented Oct 15, 2026

Copy link
Copy Markdown

Open in StackBlitz

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

commit: ccc6f98

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.

WorkspaceProxy wakes Durable Objects via idFromString(), clearing ctx.id.name for Agents/Lifecycle

1 participant