Skip to content
TypeScript

refactor(server): keep telemetry identity errors private (#10032)

Julius Marminge68aa7aa8305e
diff --git a/apps/server/src/telemetry/Identify.test.ts b/apps/server/src/telemetry/Identify.test.ts
index ab151821789..92d3223267d 100644
--- a/apps/server/src/telemetry/Identify.test.ts
+++ b/apps/server/src/telemetry/Identify.test.ts
@@ -33,26 +33,6 @@ const findIdentityLog = (
errorTag: string,
) => logs.find((log) => log.annotations.source === source && log.annotations.errorTag === errorTag);
-it("preserves exact telemetry identity causes without deriving messages from them", () => {
- const decodeCause = new Error("private nested decode details");
- const decodeError = new Identify.TelemetryIdentityDecodeError({
- source: "codex",
- filePath: "/tmp/auth.json",
- cause: decodeCause,
- });
- const readCause = new Error("private nested read details");
- const readError = new Identify.TelemetryIdentityReadError({
- source: "anonymous",
- filePath: "/tmp/anonymous-id",
- cause: readCause,
- });
-
- assert.strictEqual(decodeError.cause, decodeCause);
- assert.strictEqual(readError.cause, readCause);
- assert.notInclude(decodeError.message, decodeCause.message);
- assert.notInclude(readError.message, readCause.message);
-});
-
it.layer(NodeServices.layer)("telemetry identity", (it) => {
it.effect("uses the persisted anonymous id when provider identities are absent", () =>
Effect.gen(function* () {
diff --git a/apps/server/src/telemetry/Identify.ts b/apps/server/src/telemetry/Identify.ts
index b6c3d0066df..15d3bf13f78 100644
--- a/apps/server/src/telemetry/Identify.ts
+++ b/apps/server/src/telemetry/Identify.ts
@@ -23,7 +23,7 @@ const ClaudeJsonSchema = Schema.Struct({
export const TelemetryIdentitySource = Schema.Literals(["codex", "claude", "anonymous"]);
export type TelemetryIdentitySource = typeof TelemetryIdentitySource.Type;
-export class TelemetryIdentityReadError extends Schema.TaggedErrorClass<TelemetryIdentityReadError>()(
+class TelemetryIdentityReadError extends Schema.TaggedErrorClass<TelemetryIdentityReadError>()(
"TelemetryIdentityReadError",
{
source: TelemetryIdentitySource,
@@ -36,7 +36,7 @@ export class TelemetryIdentityReadError extends Schema.TaggedErrorClass<Telemetr
}
}
-export class TelemetryIdentityDecodeError extends Schema.TaggedErrorClass<TelemetryIdentityDecodeError>()(
+class TelemetryIdentityDecodeError extends Schema.TaggedErrorClass<TelemetryIdentityDecodeError>()(
"TelemetryIdentityDecodeError",
{
source: Schema.Literals(["codex", "claude"]),