@devries-cameron20 / t3code Mirror · read-only / commits / a05a3cd584
Fork 0

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 21, 19:45 UTC

fix(shared): voice cleanup falls back after removing an instance named like an Object key (#35489)

Julius Marminge committed Nov 12, 2026 at 11:25 UTC a05a3cd584cb8b0c4849cf555589b9f2a420a085
2 files changed +20 -1
packages/shared/src/serverSettings.test.ts
+17
@@ -377,6 +377,23 @@ describe("serverSettings helpers", () => {
377 expect(settings.sourceControlWriterModelSelection).toBe(sourceControlWriterModelSelection);
378 });
379
380 + it("falls back from a removed instance whose id matches an inherited object key", () => {
381 + for (const id of ["constructor", "toString", "valueOf"]) {
382 + const speechPostProcessingModelSelection = createModelSelection(
383 + ProviderInstanceId.make(id),
384 + "gpt-5.4-mini",
385 + );
386 + const settings = { ...DEFAULT_SERVER_SETTINGS, speechPostProcessingModelSelection };
387 +
388 + expect(isModelSelectionProviderEnabled(settings, speechPostProcessingModelSelection)).toBe(
389 + false,
390 + );
391 + expect(resolveSpeechPostProcessingModelSelection(settings)).toBe(
392 + settings.textGenerationModelSelection,
393 + );
394 + }
395 + });
396 +
397 it("falls back from a writer provider that cannot generate application text", () => {
398 const instanceId = ProviderInstanceId.make("acp_writer");
399 const sourceControlWriterModelSelection = createModelSelection(instanceId, "default");
packages/shared/src/serverSettings.ts
+3 -1
@@ -51,7 +51,9 @@ export function isModelSelectionProviderEnabled(
51 ): boolean {
52 const generator = textGeneratorForSelection(settings, selection.instanceId);
53 if (generator !== undefined) return generator.enabled;
54 - const instanceConfig = settings.providerInstances[selection.instanceId];
54 + const instanceConfig = Object.hasOwn(settings.providerInstances, selection.instanceId)
55 + ? settings.providerInstances[selection.instanceId]
56 + : undefined;
57 if (instanceConfig !== undefined) {
58 return resolveProviderInstanceEnabled(instanceConfig);
59 }