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

This commit is contained in:
Julius Marminge authored and GitHub committed 2026-09-05 01:20:46 -07:00
1 parent 86f079964b
commit 68aa7aa830
2 files changed
+2 -22

No files matched your search

@@ -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* () {
+2 -2
View File
@@ -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"]),