Skip to content

Conversation

@whoiskatrin
Copy link
Contributor

This is really just a band-aid. The brand should flow through the inheritance chain automatically. I think there is something in how partyserver emits its types or how our bundler generates declarations. We should really investigate in partyserver, but this is it unblock the user

@changeset-bot
Copy link

changeset-bot bot commented Jan 4, 2026

🦋 Changeset detected

Latest commit: 5651ea7

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

This PR includes changesets to release 1 package
Name Type
agents 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

@claude
Copy link

claude bot commented Jan 4, 2026

Claude Code Review

Status: Approved with notes

This PR adds an explicit __DURABLE_OBJECT_BRAND property declaration to the Agent class as a workaround for TypeScript type inheritance issues with partyserver.

Assessment: The change is sound. The implementation correctly:

  • Uses declare readonly to avoid runtime overhead
  • Marks it as @internal
  • Documents the purpose clearly
  • Uses bracket notation for the brand property name

Notes:

  • As the PR author acknowledges, this is a band-aid fix. The root cause should be investigated in partyserver's type emission or the bundler's declaration generation.
  • No tests needed - this is purely a type-level fix
  • The changeset is properly included

No substantive issues found.

@claude
Copy link

claude bot commented Jan 4, 2026

Claude Code Review

Critical Issue:

The code references Rpc.__DURABLE_OBJECT_BRAND without importing Rpc (packages/agents/src/index.ts:306).

Rpc is a global type from @cloudflare/workers-types, but TypeScript requires explicit imports when using namespaced types in computed property names. Add this import:

import { Rpc } from "cloudflare:workers";

Or use a type-only import:

import type { Rpc } from "cloudflare:workers";

Additional Notes:

The PR description acknowledges this is a band-aid and the root cause should be investigated in partyserver. That's fine for unblocking users, but ensure a follow-up issue is created to track the proper fix.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 4, 2026

Open in StackBlitz

npm i https://pkg.pr.new/cloudflare/agents@766

commit: 5651ea7

@whoiskatrin whoiskatrin closed this Jan 7, 2026
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