Skip to content

fix(platform-cloudflare): reject over-budget accept tags with an actionable error - #316

Closed
prisis wants to merge 2 commits into
alphafrom
advisor/299-socket-tag-budget
Closed

prisis wants to merge 2 commits into
alphafrom
advisor/299-socket-tag-budget

Conversation

@prisis

@prisis prisis commented Aug 2, 2026

Copy link
Copy Markdown
Member

Branched before #288/#289 landed, so it needs a rebase onto current alpha before merge.

Commits

  • fix(platform-cloudflare): reject over-budget accept tags with an actionable error
  • docs(platform): state the reserved socket-tag budget on SocketHost.accept

Files this branch still changes relative to alpha

api-snapshots/errors.api.md
packages/errors/src/catalog.ts
packages/platform-cloudflare/__tests__/cloudflare-host.tag-budget.test.ts
packages/platform-cloudflare/package.json
packages/platform-cloudflare/src/cloudflare-host.ts
packages/platform/src/conformance/suite.ts
packages/platform/src/socket-host.ts

prisis added 2 commits August 1, 2026 19:48
…onable error

`SocketHost.accept` prepends a synthesized identity tag to every
caller-supplied tag list before calling `state.acceptWebSocket`, but
the contract states no tag-count or length budget. A caller who reads
the contract and passes Cloudflare's full tag allowance got a runtime
throw from `acceptWebSocket` naming a tag it never supplied — the
provider limit leaking through a contract whose purpose is to hide it.

Cloudflare's documented cap is 10 tags per socket, 256 characters each
(developers.cloudflare.com/durable-objects/api/state/, checked
2026-08-01). With one slot reserved for the host's own identity tag,
the adapter now validates the caller's tag count and each tag's length
*before* calling `acceptWebSocket`, throwing a `SOCKET_TAG_BUDGET_EXCEEDED`
`LunoraError` that names the counts and the reservation, instead of
letting the provider throw an opaque error blaming the combined list.

Adds `@lunora/errors` as a dependency of `@lunora/platform-cloudflare`
(previously absent) for the coded, catalog-registered error.
…cept

`SocketHost.accept`'s docstring and the module-header tag-tier
discussion said nothing about a tag-count or length budget, even
though Cloudflare's `acceptWebSocket` enforces one (10 tags / 256
characters) and the adapter reserves one slot for its own identity
tag. Documents the reserved-slot model in provider-neutral terms: a
portable caller should assume at most 9 usable tags of at most 256
characters, with Cloudflare named as the motivating example.

Also adds a conformance-suite leg asserting the portable floor of nine
caller tags resolves correctly via `getSockets(tag)` on every host. On
the Cloudflare host this lands exactly at the provider's 10-tag cap
(9 + 1 reserved), so it is a regression fence — it fails the moment a
second reserved slot is added without updating the documented budget,
not a reproduction of the bug the sibling fix commit addresses.
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@prisis, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 58 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d5d3dd55-2b6e-4351-adb7-5ee9723173d7

📥 Commits

Reviewing files that changed from the base of the PR and between 6a4dd72 and 81d9b40.

⛔ Files ignored due to path filters (2)
  • api-snapshots/errors.api.md is excluded by none and included by none
  • packages/platform-cloudflare/__tests__/cloudflare-host.tag-budget.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
📒 Files selected for processing (5)
  • packages/errors/src/catalog.ts
  • packages/platform-cloudflare/package.json
  • packages/platform-cloudflare/src/cloudflare-host.ts
  • packages/platform/src/conformance/suite.ts
  • packages/platform/src/socket-host.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@netlify

netlify Bot commented Aug 2, 2026 •

Copy link
Copy Markdown

❌ Deploy Preview for lunorash failed.

Name Link
🔨 Latest commit 81d9b40
🔍 Latest deploy log https://app.netlify.com/projects/lunorash/deploys/6a6f0b943e584500084d29d7

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Thank you for confirming the Contributor License Agreement! 🙏

@prisis

prisis commented Aug 2, 2026

Copy link
Copy Markdown
Member Author

Closing: this PR was opened in error by an automated run, outside the scope of its task.

No work is lost — the branch is retained on origin and this PR can be reopened at any time.

Context: this branch predates the merges of #288 and #289, so much of its content is already on alpha, and it would need a rebase before being reviewable. Reopening deliberately, after a rebase, is preferable to leaving it open in this state.

@prisis prisis closed this Aug 2, 2026
@prisis
prisis deleted the advisor/299-socket-tag-budget branch August 2, 2026 09:47
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using our GitHub Discussions tab for questions.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Sep 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant