File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -253,6 +253,15 @@ describe("serverSettings helpers", () => {
253253 otlpMetricsUrl : "http://localhost:4318/v1/metrics" ,
254254 otlpLogsUrl : "http://localhost:4318/v1/logs" ,
255255 } ) ;
256+ // The server still loads a file holding the retired token streaming mode.
257+ expect (
258+ parsePersistedServerObservabilitySettings (
259+ JSON . stringify ( {
260+ responseStreamingMode : "token" ,
261+ observability : { otlpTracesUrl : "http://localhost:4318/v1/traces" } ,
262+ } ) ,
263+ ) . otlpTracesUrl ,
264+ ) . toBe ( "http://localhost:4318/v1/traces" ) ;
256265 } ) ;
257266
258267 it ( "falls back cleanly when persisted settings are invalid" , ( ) => {
Original file line number Diff line number Diff line change @@ -34,8 +34,13 @@ import {
3434 resolveBackgroundActivitySettings ,
3535} from "./backgroundActivitySettings.ts" ;
3636
37- const ServerSettingsJson = fromLenientJson ( ServerSettings ) ;
38- const decodeServerSettingsJson = Schema . decodeUnknownOption ( ServerSettingsJson ) ;
37+ // Only observability: a value the server migrates on load elsewhere in the file must not drop it.
38+ const ServerObservabilitySettingsJson = fromLenientJson (
39+ Schema . Struct ( { observability : ServerSettings . fields . observability } ) ,
40+ ) ;
41+ const decodeServerObservabilitySettingsJson = Schema . decodeUnknownOption (
42+ ServerObservabilitySettingsJson ,
43+ ) ;
3944
4045export function isModelSelectionProviderEnabled (
4146 settings : ServerSettings ,
@@ -180,7 +185,7 @@ function extractPersistedServerObservabilitySettings(input: {
180185export function parsePersistedServerObservabilitySettings (
181186 raw : string ,
182187) : PersistedServerObservabilitySettings {
183- const decoded = decodeServerSettingsJson ( raw ) ;
188+ const decoded = decodeServerObservabilitySettingsJson ( raw ) ;
184189 if ( Option . isSome ( decoded ) ) {
185190 return extractPersistedServerObservabilitySettings ( decoded . value ) ;
186191 }
You can’t perform that action at this time.
0 commit comments