The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 24, 22:45 UTC
[codex] Bound relay registration replay diagnostics (#3420)
Co-authored-by: codex <codex@users.noreply.github.com>
Julius Marminge committed
Jun 20, 2026 at 11:13 UTC
4d790f0064ab99287d3ccb17d2f003f5ed8e8d3e
2 files changed
+20
-6
infra/relay/src/agentActivity/MobileRegistrations.test.ts
+12
-2
@@ -7,6 +7,7 @@ import * as NodeCryptoLayer from "@effect/platform-node/NodeCrypto";
7
import { describe, expect, it } from "@effect/vitest";
8
import * as Effect from "effect/Effect";
9
import * as Layer from "effect/Layer";
10
+import * as Logger from "effect/Logger";
11
import * as Redacted from "effect/Redacted";
12
import { FetchHttpClient } from "effect/unstable/http";
13
@@ -232,6 +233,11 @@ describe("MobileRegistrations", () => {
233
});
234
235
it.effect("keeps device registration successful when activity replay fails", () => {
236
+ const messages: unknown[] = [];
237
+ const logger = Logger.make(({ message }) => {
238
+ messages.push(message);
239
+ });
240
+
241
return Effect.gen(function* () {
242
const result = yield* Effect.gen(function* () {
243
const registrations = yield* MobileRegistrations.MobileRegistrations;
@@ -250,7 +256,7 @@ describe("MobileRegistrations", () => {
256
Effect.fail(
257
new AgentActivityRows.AgentActivityRowListPersistenceError({
258
userId: "dev:julius",
253
- cause: "replay failed",
259
+ cause: "sensitive device replay detail",
260
}),
261
),
262
}),
@@ -262,7 +268,11 @@ describe("MobileRegistrations", () => {
268
);
269
270
expect(result).toEqual({ ok: true });
265
- });
271
+ expect(messages).toContainEqual([
272
+ "device registration activity replay failed",
273
+ { errorTag: "AgentActivityRowListPersistenceError" },
274
+ ]);
275
+ }).pipe(Effect.provide(Logger.layer([logger], { mergeWithExisting: false })));
276
});
277
278
it.effect("unregisters the current user's device", () => {
infra/relay/src/agentActivity/MobileRegistrations.ts
+8
-4
@@ -51,8 +51,10 @@ export const make = Effect.gen(function* () {
51
deviceId: input.payload.deviceId,
52
})
53
.pipe(
54
- Effect.tapError((cause) =>
55
- Effect.logWarning("device registration activity replay failed", { cause }),
54
+ Effect.tapError((error) =>
55
+ Effect.logWarning("device registration activity replay failed", {
56
+ errorTag: error._tag,
57
+ }),
58
),
59
Effect.ignore,
60
);
@@ -70,8 +72,10 @@ export const make = Effect.gen(function* () {
72
deviceId: input.payload.deviceId,
73
})
74
.pipe(
73
- Effect.tapError((cause) =>
74
- Effect.logWarning("live activity registration replay failed", { cause }),
75
+ Effect.tapError((error) =>
76
+ Effect.logWarning("live activity registration replay failed", {
77
+ errorTag: error._tag,
78
+ }),
79
),
80
Effect.ignore,
81
);