docs(agents): document current ctx.id.name availability and pin it with a cold-wake test#1928
Open
mattzcarey wants to merge 2 commits into
Open
docs(agents): document current ctx.id.name availability and pin it with a cold-wake test#1928mattzcarey wants to merge 2 commits into
mattzcarey wants to merge 2 commits into
Conversation
…th a cold-wake test
|
agents
@cloudflare/ai-chat
@cloudflare/codemode
create-think
hono-agents
@cloudflare/shell
@cloudflare/think
@cloudflare/voice
@cloudflare/worker-bundler
commit: |
Constructor-time availability is pinned by workerd's and partyserver's own tests, not stated by the changelog; the rpc.test.ts cold-wake seeds are inert under the current runtime (those tests address via idFromName()), so the legacy-fallback pins live upstream in partyserver's suite.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since 2026-03-15, the Workers runtime populates
ctx.id.nameinside a Durable Object addressed viaidFromName()/getByName(), including in alarm handlers (constructor-time availability is pinned by workerd's own tests, workerd#6421). Our docs still described names as effectively unavailable inside the DO (citing workerd#2240, which was closed in April).Changes
docs/agents/agent-class.md: replaces the stale "it's hard / not a perfect solution" caveat onthis.namewith the actual availability matrix: populated foridFromName()/getByName(); stillundefined— per the DO id docs — foridFromString()/newUniqueId()addressing (deliberate design), names over 1,024 bytes, and alarms scheduled before 2026-03-15 or from a nameless context.docs/shell/index.md: corrects the lazy-name-resolution rationale (the name may not be resolvable at field-init time, rather than never being available).packages/agents/src/tests/name-resolution.test.ts(new): pins the new runtime behavior — a cold agent whose first-ever contact is a native RPC call resolvesthis.namepurely fromctx.id.name, with no__ps_nameseeding and nosetName()bootstrap, for bothidFromName()andgetByName()addressing. The existing cold-wake tests inmcp/transports/rpc.test.tsthat seed__ps_nameare deliberately untouched; note that since they address viaidFromName(), their seeds are inert under the current runtime — the legacy fallback paths are pinned upstream in partyserver's own test suite.Deliberately not in this PR
__ps_namefallback machinery — that requires a partyserver major (deprecation started in docs(partyserver): deprecate setName name-bootstrap and x-partykit-room fallback partykit#413).ctx.id.namecap (open design question).Testing
pnpm run checkgreen (exports, format, lint, all 116 TS projects).