The best way to control Claude Code, Codex and more from any computer or phone
fix(server): provider instances named constructor, toString or valueOf can be added (#35492)
Co-authored-by: ixmxvii-hash <235766220+ixmxvii-hash@users.noreply.github.com> Co-authored-by: Julius Marminge <julius0216@outlook.com>
Logan committed
Nov 12, 2026 at 13:26 UTC
c846833a6baa1cfab8e83a7d74d183ca92ad6ba6
2 files changed
+12
-1
apps/server/src/serverSettings.test.ts
+11
@@ -539,6 +539,17 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("server settings"
539
(yield* serverSettings.getSettings).providerInstances[instanceId]?.displayName ?? "",
540
),
541
);
542
+
543
+ // An inherited Object.prototype member is not an instance that already exists.
544
+ for (const name of ["constructor", "toString", "valueOf"]) {
545
+ const prototypeNamedId = ProviderInstanceId.make(name);
546
+ const created = yield* serverSettings.updateProviderInstance({
547
+ operation: "create",
548
+ instanceId: prototypeNamedId,
549
+ instance: { driver: ProviderDriverKind.make("codex") },
550
+ });
551
+ assert.isTrue(Object.hasOwn(created.providerInstances, prototypeNamedId));
552
+ }
553
}).pipe(Effect.provide(layerServerSettings())),
554
);
555
apps/server/src/serverSettings.ts
+1
-1
@@ -237,7 +237,7 @@ function ensureProviderInstanceMutationAllowed(
237
): Effect.Effect<void, ServerSettingsError> {
238
if (
239
mutation.operation === "create" &&
240
- settings.providerInstances[mutation.instanceId] !== undefined
240
+ Object.hasOwn(settings.providerInstances, mutation.instanceId)
241
) {
242
return Effect.fail(
243
new ServerSettingsError({