The best way to control Claude Code, Codex and more from any computer or phone
refactor(relay): import HookInboxObject once, as a namespace (#16307)
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Julius Marminge committed
Oct 5, 2026 at 19:30 UTC
8bd7745f0af918582807326d90e58d59324bb2a6
2 files changed
+10
-13
infra/relay/src/hooks/HookInboxObject.ts
+7
-9
@@ -23,14 +23,6 @@ const RUN_FAILURE_RETRY_MS = 60_000;
23
24
type Call<A> = Effect.Effect<A, never, Alchemy.RuntimeContext>;
25
26
-export interface HookInboxObjectShape {
27
- /** Holds a request for `baseUrl`; false when the inbox is full and nothing was stored. */
28
- readonly hold: (hook: HookInboxStore.HeldHook, baseUrl: string) => Call<boolean>;
29
- /** The environment is back at `baseUrl`: deliver what is waiting now. */
30
- readonly wake: (baseUrl: string) => Call<boolean>;
31
- readonly clear: () => Call<void>;
32
-}
33
-
26
/**
27
* One per managed endpoint, addressed by endpoint key. Holds webhook requests
28
* the environment could not take, in SQLite, and pushes them back through
@@ -38,7 +30,13 @@ export interface HookInboxObjectShape {
30
*/
31
export class HookInboxObject extends Cloudflare.DurableObject<
32
HookInboxObject,
41
- HookInboxObjectShape
33
+ {
34
+ /** Holds a request for `baseUrl`; false when the inbox is full and nothing was stored. */
35
+ readonly hold: (hook: HookInboxStore.HeldHook, baseUrl: string) => Call<boolean>;
36
+ /** The environment is back at `baseUrl`: deliver what is waiting now. */
37
+ readonly wake: (baseUrl: string) => Call<boolean>;
38
+ readonly clear: () => Call<void>;
39
+ }
40
>()("HookInboxObject") {}
41
42
/**
infra/relay/src/worker.ts
+3
-4
@@ -67,8 +67,7 @@ import * as MobileRegistrations from "./agentActivity/MobileRegistrations.ts";
67
import * as HookForwarder from "./hooks/HookForwarder.ts";
68
import * as HeldHooks from "./hooks/HeldHooks.ts";
69
import * as HookInbox from "./hooks/HookInbox.ts";
70
-import { HookInboxObject } from "./hooks/HookInboxObject.ts";
71
-import * as HookInboxObjectLayer from "./hooks/HookInboxObject.ts";
70
+import * as HookInboxObject from "./hooks/HookInboxObject.ts";
71
72
const layerWebcrypto = Layer.succeed(
73
Crypto.Crypto,
@@ -201,7 +200,7 @@ export const layer = Api.make(
200
period: HookForwarder.RELAY_HOOK_ENDPOINT_RATE_LIMIT.periodSeconds,
201
},
202
});
204
- const hookInboxes = yield* HookInboxObject;
203
+ const hookInboxes = yield* HookInboxObject.HookInboxObject;
204
205
//
206
// 3. Runtime layers and app construction
@@ -470,7 +469,7 @@ export const layer = Api.make(
469
Layer.provideMerge(Cloudflare.Tunnel.ReadWriteTunnelBinding),
470
Layer.provideMerge(Cloudflare.DNS.ReadWriteDnsHttp),
471
Layer.provideMerge(Cloudflare.Workers.RateLimitBinding),
473
- Layer.provideMerge(HookInboxObjectLayer.layer),
472
+ Layer.provideMerge(HookInboxObject.layer),
473
// The worker runtime opens its own HTTP span around ours. For webhook
474
// paths it would record the raw URL, token included, and adopt the
475
// sender's traceparent, so only our redacted span covers those.