fix(engine): export observerAllowsEvent for out-of-package realtime adapters - #451
Conversation
|
Warning Review limit reachedNext included review available in 34 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
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. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
No issues found across 3 files
You’re at about 99% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
…dapters The Cloudflare workspace stream fans events out in relaycast-cloud, outside this package, and could not reach the filter the Node adapter applies per observer socket, so it applied none: a channel-scoped observer token received every workspace event, DMs included. Export the filter so both adapters use the one implementation. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
f82ac22 to
617c89e
Compare
Problem
A channel-scoped observer token (
filters.channel_names: [...],include_dms: false) receives every workspace event on hosted Relaycast: DMs and other channels included. Reproduced against production with a probe that mints such a token, subscribes, then sends a DM between two unrelated agents:The same probe against a self-hosted engine built from this repo:
The Node adapter applies
observerAllowsEventper socket (adapters/node/realtime.ts). The Cloudflare workspace stream lives in relaycast-cloud, outside this package. The filter is not exported, so that stream applies none.Change
Export
observerAllowsEventand theObserverTokentype from the package entry, so both adapters use the one implementation. No behaviour change in this repo.The consumer is AgentWorkforce/relaycast-cloud
fix/observer-dm-leak, which needs a release of this.Evidence
packages/engine:npx vitest run src/__tests__/observerEventExport.test.ts→Tests 2 passed (2). The test imports the filter from../index.jsand pins channel-scoped behaviour: own channel in; other channel,dm.receivedandgroup_dm.receivedout.npx tsc --noEmit -p .clean.🤖 Generated with Claude Code
Note
Low Risk
Additive public API export and tests only; existing engine and Node adapter paths are unchanged until an external adapter wires in the filter.
Overview
Exports
observerAllowsEventand theObserverTokentype from@relaycast/engine's public entry so hosted realtime adapters (e.g. the Cloudflare workspace stream in relaycast-cloud) can apply the same per-socket observer filter the Node adapter already uses internally.Adds a changelog note under Unreleased - Patch and a small Vitest suite that imports the filter from the package entry and pins channel-scoped behaviour (allowed channel in, other channels and DMs out; unscoped principals pass everything). No runtime behaviour change inside this repo — it unblocks consumers to fix channel-scoped tokens seeing workspace-wide events.
Reviewed by Cursor Bugbot for commit 617c89e. Bugbot is set up for automated code reviews on this repo. Configure here.