Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/auto-mode-tenant-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@truefoundry/trueforge-core': patch
'@truefoundry/trueforge': patch
'@truefoundry/trueforge-ui': patch
'@truefoundry/trueforge-assistant-ui-runtime': patch
'@truefoundry/trueforge-sdk': patch
---

Add a tenant switch for Auto mode, on by default, on the Models settings page. Admins reach the page in TrueFoundry mode when model routing is set up for the tenant; provider editing stays with the platform there. Turning it off turns off all model routing for the tenant: Auto leaves the model picker, `auto` specs are rejected, chats that already use Auto fail their next turn with "Auto mode is turned off for this tenant", and subagents run on their parent's model. `GET /api/v1/capabilities` leaves `auto` out when routing isn't set up for the tenant and gives a `reason` when it is unavailable. The configuration manifest adds `auto: { enabled }`.
30 changes: 27 additions & 3 deletions .github/fern/openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,27 @@
"type": "object"
},
"AutoCapability": {
"description": "Present only when model routing is set up for the tenant; absent means Auto mode settings are hidden.",
"properties": {
"enabled": {
"description": "Whether Auto mode can be selected: the user has at least one model in every routing cluster.",
"description": "Whether Auto mode can be selected: the tenant allows it and the user has the models it picks from.",
"type": "boolean"
},
"reason": {
"description": "Present when Auto mode is unavailable. Explains why.",
"type": "string"
}
},
"required": [
"enabled"
],
"type": "object"
},
"AutoConfiguration": {
"additionalProperties": false,
"properties": {
"enabled": {
"description": "Whether this tenant may use Auto mode, which picks a model for each turn and each subagent.",
"type": "boolean"
}
},
Expand Down Expand Up @@ -518,7 +536,6 @@
"skill",
"settings",
"web_search",
"auto",
"session_sharing"
],
"type": "object"
Expand Down Expand Up @@ -1006,6 +1023,9 @@
"ConfigurationManifest": {
"additionalProperties": false,
"properties": {
"auto": {
"$ref": "#/components/schemas/AutoConfiguration"
},
"memory": {
"$ref": "#/components/schemas/MemoryConfiguration"
},
Expand All @@ -1015,13 +1035,17 @@
},
"required": [
"web_search",
"memory"
"memory",
"auto"
],
"type": "object"
},
"ConfigurationManifestPatch": {
"additionalProperties": false,
"properties": {
"auto": {
"$ref": "#/components/schemas/AutoConfiguration"
},
"memory": {
"$ref": "#/components/schemas/MemoryConfiguration"
},
Expand Down
30 changes: 27 additions & 3 deletions docs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,27 @@
"type": "object"
},
"AutoCapability": {
"description": "Present only when model routing is set up for the tenant; absent means Auto mode settings are hidden.",
"properties": {
"enabled": {
"description": "Whether Auto mode can be selected: the user has at least one model in every routing cluster.",
"description": "Whether Auto mode can be selected: the tenant allows it and the user has the models it picks from.",
"type": "boolean"
},
"reason": {
"description": "Present when Auto mode is unavailable. Explains why.",
"type": "string"
}
},
"required": [
"enabled"
],
"type": "object"
},
"AutoConfiguration": {
"additionalProperties": false,
"properties": {
"enabled": {
"description": "Whether this tenant may use Auto mode, which picks a model for each turn and each subagent.",
"type": "boolean"
}
},
Expand Down Expand Up @@ -518,7 +536,6 @@
"skill",
"settings",
"web_search",
"auto",
"session_sharing"
],
"type": "object"
Expand Down Expand Up @@ -1006,6 +1023,9 @@
"ConfigurationManifest": {
"additionalProperties": false,
"properties": {
"auto": {
"$ref": "#/components/schemas/AutoConfiguration"
},
"memory": {
"$ref": "#/components/schemas/MemoryConfiguration"
},
Expand All @@ -1015,13 +1035,17 @@
},
"required": [
"web_search",
"memory"
"memory",
"auto"
],
"type": "object"
},
"ConfigurationManifestPatch": {
"additionalProperties": false,
"properties": {
"auto": {
"$ref": "#/components/schemas/AutoConfiguration"
},
"memory": {
"$ref": "#/components/schemas/MemoryConfiguration"
},
Expand Down
8 changes: 5 additions & 3 deletions packages/assistant-ui-runtime/src/server/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -602,10 +602,10 @@ export interface AgentBuilderCapabilitiesResponse {
/** Absent when the host does not offer memory, which hides memory settings; `reason` explains a locked toggle. */
memory?: { enabled: boolean; reason?: string };
/**
* Whether Auto mode can be selected in the model picker. Enabled when model routing is on and the user has a model
* in every routing cluster; absent means Auto mode cannot be selected.
* Absent when the host does not set up model routing, which hides Auto mode and its settings switch. Enabled when
* the tenant allows Auto mode and the user has the models it picks from; `reason` explains why it is unavailable.
*/
auto?: { enabled: boolean };
auto?: { enabled: boolean; reason?: string };

@datadog-official datadog-official Bot Nov 20, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Low: Code Quality Violation

Prop name 'enabled' is not prefixed with `is` or `has` (...read more)

Enforces a consistent naming pattern for boolean props to ensure that the variable is prefixed with either is or has (or the uppercase equivalent). Any prefix symbol (_, $, etc) is allowed.

Helpful? 👍/👎 View in Datadog  Leave us feedback  Documentation
🚩 Report as false positive. Flags the rule for review to improve detection accuracy.

/** Finest supported sharing scope; `subject` allows invite-by-user as well as tenant-wide sharing. */
sessionSharing: { granularity: 'tenant' | 'subject' };
};
Expand Down Expand Up @@ -1097,12 +1097,14 @@ export interface TenantConfigurationSwitch {
export interface TenantConfiguration {
webSearch: TenantConfigurationSwitch;
memory: TenantConfigurationSwitch;
auto: TenantConfigurationSwitch;
}

export interface UpdateTenantConfigurationRequest {
/** Omit a switch to leave it as stored. */
webSearch?: TenantConfigurationSwitch;
memory?: TenantConfigurationSwitch;
auto?: TenantConfigurationSwitch;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export function App() {
if (first === undefined) {
setBoot({
status: 'ready',
openSettings: capabilities.settings.modelProviders.enabled,
openSettings: capabilities.settings.modelProviders.manageProviders,
defaultAgentSpec: {
model: { name: '' },
config: sandboxConfig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ export class SessionHandle<
}
// If creating a new turn, route on the conversation and the new user input.
if (input.routeModel === undefined) {
throw new AgentHarnessError('auto_model_unavailable', 'Auto model selection needs model routing for this tenant');
throw new AgentHarnessError('auto_model_unavailable', 'Auto mode is turned off for this tenant');
}
const routed = await input.routeModel({
threadId: MAIN_THREAD_ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ describe('auto model selection', () => {
}),
).rejects.toMatchObject({
code: 'auto_model_unavailable',
message: 'Auto model selection needs model routing for this tenant',
message: 'Auto mode is turned off for this tenant',
} satisfies Partial<AgentHarnessError>);
});

Expand Down
7 changes: 6 additions & 1 deletion packages/trueforge-sdk/src/api/types/AutoCapability.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
// This file was auto-generated by Fern from our API Definition.

/**
* Present only when model routing is set up for the tenant; absent means Auto mode settings are hidden.
*/
export interface AutoCapability {
/** Whether Auto mode can be selected: the user has at least one model in every routing cluster. */
/** Whether Auto mode can be selected: the tenant allows it and the user has the models it picks from. */
enabled: boolean;
/** Present when Auto mode is unavailable. Explains why. */
reason?: string;
}
6 changes: 6 additions & 0 deletions packages/trueforge-sdk/src/api/types/AutoConfiguration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// This file was auto-generated by Fern from our API Definition.

export interface AutoConfiguration {
/** Whether this tenant may use Auto mode, which picks a model for each turn and each subagent. */
enabled: boolean;
}
2 changes: 1 addition & 1 deletion packages/trueforge-sdk/src/api/types/CapabilitiesData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import type * as TrueForge from "../index.js";

export interface CapabilitiesData {
auto: TrueForge.AutoCapability;
auto?: TrueForge.AutoCapability;
memory?: TrueForge.MemoryCapability;
sandbox: TrueForge.SandboxCapability;
sessionSharing: TrueForge.SessionSharingCapability;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import type * as TrueForge from "../index.js";

export interface ConfigurationManifest {
auto: TrueForge.AutoConfiguration;
memory: TrueForge.MemoryConfiguration;
webSearch: TrueForge.WebSearchConfiguration;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import type * as TrueForge from "../index.js";

export interface ConfigurationManifestPatch {
auto?: TrueForge.AutoConfiguration;
memory?: TrueForge.MemoryConfiguration;
webSearch?: TrueForge.WebSearchConfiguration;
}
1 change: 1 addition & 0 deletions packages/trueforge-sdk/src/api/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export * from "./ApprovalDecision.js";
export * from "./ApprovalDeny.js";
export * from "./AskUserQuestionsConfig.js";
export * from "./AutoCapability.js";
export * from "./AutoConfiguration.js";
export * from "./AvailableMcpServer.js";
export * from "./AvailableModel.js";
export * from "./AvailableModelProvider.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import type * as serializers from "../index.js";
export const AutoCapability: core.serialization.ObjectSchema<serializers.AutoCapability.Raw, TrueForge.AutoCapability> =
core.serialization.object({
enabled: core.serialization.boolean(),
reason: core.serialization.string().optional(),
});

export declare namespace AutoCapability {
export interface Raw {
enabled: boolean;
reason?: string | null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// This file was auto-generated by Fern from our API Definition.

import type * as TrueForge from "../../api/index.js";
import * as core from "../../core/index.js";
import type * as serializers from "../index.js";

export const AutoConfiguration: core.serialization.ObjectSchema<
serializers.AutoConfiguration.Raw,
TrueForge.AutoConfiguration
> = core.serialization.object({
enabled: core.serialization.boolean(),
});

export declare namespace AutoConfiguration {
export interface Raw {
enabled: boolean;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const CapabilitiesData: core.serialization.ObjectSchema<
serializers.CapabilitiesData.Raw,
TrueForge.CapabilitiesData
> = core.serialization.object({
auto: AutoCapability,
auto: AutoCapability.optional(),
memory: MemoryCapability.optional(),
sandbox: SandboxCapability,
sessionSharing: core.serialization.property("session_sharing", SessionSharingCapability),
Expand All @@ -26,7 +26,7 @@ export const CapabilitiesData: core.serialization.ObjectSchema<

export declare namespace CapabilitiesData {
export interface Raw {
auto: AutoCapability.Raw;
auto?: AutoCapability.Raw | null;
memory?: MemoryCapability.Raw | null;
sandbox: SandboxCapability.Raw;
session_sharing: SessionSharingCapability.Raw;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,22 @@
import type * as TrueForge from "../../api/index.js";
import * as core from "../../core/index.js";
import type * as serializers from "../index.js";
import { AutoConfiguration } from "./AutoConfiguration.js";
import { MemoryConfiguration } from "./MemoryConfiguration.js";
import { WebSearchConfiguration } from "./WebSearchConfiguration.js";

export const ConfigurationManifest: core.serialization.ObjectSchema<
serializers.ConfigurationManifest.Raw,
TrueForge.ConfigurationManifest
> = core.serialization.object({
auto: AutoConfiguration,
memory: MemoryConfiguration,
webSearch: core.serialization.property("web_search", WebSearchConfiguration),
});

export declare namespace ConfigurationManifest {
export interface Raw {
auto: AutoConfiguration.Raw;
memory: MemoryConfiguration.Raw;
web_search: WebSearchConfiguration.Raw;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,22 @@
import type * as TrueForge from "../../api/index.js";
import * as core from "../../core/index.js";
import type * as serializers from "../index.js";
import { AutoConfiguration } from "./AutoConfiguration.js";
import { MemoryConfiguration } from "./MemoryConfiguration.js";
import { WebSearchConfiguration } from "./WebSearchConfiguration.js";

export const ConfigurationManifestPatch: core.serialization.ObjectSchema<
serializers.ConfigurationManifestPatch.Raw,
TrueForge.ConfigurationManifestPatch
> = core.serialization.object({
auto: AutoConfiguration.optional(),
memory: MemoryConfiguration.optional(),
webSearch: core.serialization.property("web_search", WebSearchConfiguration.optional()),
});

export declare namespace ConfigurationManifestPatch {
export interface Raw {
auto?: AutoConfiguration.Raw | null;
memory?: MemoryConfiguration.Raw | null;
web_search?: WebSearchConfiguration.Raw | null;
}
Expand Down
1 change: 1 addition & 0 deletions packages/trueforge-sdk/src/serialization/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export * from "./ApprovalDecision.js";
export * from "./ApprovalDeny.js";
export * from "./AskUserQuestionsConfig.js";
export * from "./AutoCapability.js";
export * from "./AutoConfiguration.js";
export * from "./AvailableMcpServer.js";
export * from "./AvailableModel.js";
export * from "./AvailableModelProvider.js";
Expand Down
3 changes: 2 additions & 1 deletion packages/trueforge-sdk/tests/wire/server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe("ServerClient", () => {

const rawResponseBody = {
data: {
auto: { enabled: true },
auto: { enabled: true, reason: "reason" },
memory: { enabled: true, reason: "reason" },
sandbox: { enabled: true, environments: { enabled: true } },
session_sharing: { granularity: "tenant" },
Expand Down Expand Up @@ -41,6 +41,7 @@ describe("ServerClient", () => {
data: {
auto: {
enabled: true,
reason: "reason",
},
memory: {
enabled: true,
Expand Down
Loading
Loading