@devries-cameron20 / t3code-1 / commits / cedcc31096
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(server): OTLP export settings survive a saved token streaming mode (#29786)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Alex Southwell committed Nov 3, 2026 at 23:26 UTC cedcc3109659f5d8fdbdddaeb916c6dedd72921a
2 files changed +17 -3
packages/shared/src/serverSettings.test.ts
+9
@@ -271,6 +271,15 @@ describe("serverSettings helpers", () => {
271 otlpMetricsUrl: "http://localhost:4318/v1/metrics",
272 otlpLogsUrl: "http://localhost:4318/v1/logs",
273 });
274 + // The server still loads a file holding the retired token streaming mode.
275 + expect(
276 + parsePersistedServerObservabilitySettings(
277 + JSON.stringify({
278 + responseStreamingMode: "token",
279 + observability: { otlpTracesUrl: "http://localhost:4318/v1/traces" },
280 + }),
281 + ).otlpTracesUrl,
282 + ).toBe("http://localhost:4318/v1/traces");
283 });
284
285 it("falls back cleanly when persisted settings are invalid", () => {
packages/shared/src/serverSettings.ts
+8 -3
@@ -35,8 +35,13 @@ import {
35 resolveBackgroundActivitySettings,
36 } from "./backgroundActivitySettings.ts";
37
38 -const ServerSettingsJson = fromLenientJson(ServerSettings);
39 -const decodeServerSettingsJson = Schema.decodeUnknownOption(ServerSettingsJson);
38 +// Only observability: a value the server migrates on load elsewhere in the file must not drop it.
39 +const ServerObservabilitySettingsJson = fromLenientJson(
40 + Schema.Struct({ observability: ServerSettings.fields.observability }),
41 +);
42 +const decodeServerObservabilitySettingsJson = Schema.decodeUnknownOption(
43 + ServerObservabilitySettingsJson,
44 +);
45
46 export function isModelSelectionProviderEnabled(
47 settings: ServerSettings,
@@ -181,7 +186,7 @@ function extractPersistedServerObservabilitySettings(input: {
186 export function parsePersistedServerObservabilitySettings(
187 raw: string,
188 ): PersistedServerObservabilitySettings {
184 - const decoded = decodeServerSettingsJson(raw);
189 + const decoded = decodeServerObservabilitySettingsJson(raw);
190 if (Option.isSome(decoded)) {
191 return extractPersistedServerObservabilitySettings(decoded.value);
192 }