Skip to content
Open
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-model-capability.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
---

`GET /api/v1/capabilities` reports `auto.enabled`: model routing is on for the tenant and the user has a model in every routing cluster. The new-chat model picker offers Auto, which is only selectable when that capability is enabled. Core adds `canRouteEveryCategory`.
16 changes: 16 additions & 0 deletions .github/fern/openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,18 @@
},
"type": "object"
},
"AutoCapability": {
"properties": {
"enabled": {
"description": "Whether Auto mode can be selected: the user has at least one model in every routing cluster.",
"type": "boolean"
}
},
"required": [
"enabled"
],
"type": "object"
},
"AvailableMCPServer": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -479,6 +491,9 @@
},
"CapabilitiesData": {
"properties": {
"auto": {
"$ref": "#/components/schemas/AutoCapability"
},
"memory": {
"$ref": "#/components/schemas/MemoryCapability"
},
Expand All @@ -503,6 +518,7 @@
"skill",
"settings",
"web_search",
"auto",
"session_sharing"
],
"type": "object"
Expand Down
16 changes: 16 additions & 0 deletions docs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,18 @@
},
"type": "object"
},
"AutoCapability": {
"properties": {
"enabled": {
"description": "Whether Auto mode can be selected: the user has at least one model in every routing cluster.",
"type": "boolean"
}
},
"required": [
"enabled"
],
"type": "object"
},
"AvailableMCPServer": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -479,6 +491,9 @@
},
"CapabilitiesData": {
"properties": {
"auto": {
"$ref": "#/components/schemas/AutoCapability"
},
"memory": {
"$ref": "#/components/schemas/MemoryCapability"
},
Expand All @@ -503,6 +518,7 @@
"skill",
"settings",
"web_search",
"auto",
"session_sharing"
],
"type": "object"
Expand Down
5 changes: 5 additions & 0 deletions packages/assistant-ui-runtime/src/server/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,11 @@ export interface AgentBuilderCapabilitiesResponse {
webSearch?: { enabled: boolean; reason?: string };
/** 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.
*/
auto?: { enabled: boolean };

@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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why optional

/** Finest supported sharing scope; `subject` allows invite-by-user as well as tenant-wide sharing. */
sessionSharing: { granularity: 'tenant' | 'subject' };
};
Expand Down
1 change: 1 addition & 0 deletions packages/trueforge-core/src/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export { OpenAIDecisionModel } from './decision/OpenAIDecisionModel';
export { DEFAULT_ROUTING_QUESTION, type RoutingCategory, type RoutingQuestion } from './modelRouting/question';
export {
AUTO_MODEL,
canRouteEveryCategory,
createModelRouter,
selectModel,
type ModelRouterDeps,
Expand Down
7 changes: 7 additions & 0 deletions packages/trueforge-core/src/core/modelRouting/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ function isRoutingCategory(category: string): category is RoutingCategory {
return Object.hasOwn(ROUTING_CLUSTERS, category);
}

/** True when every routing category has a model the user can be routed to. */
export function canRouteEveryCategory(models: readonly RoutableModel[]): boolean {
return Object.keys(ROUTING_CLUSTERS)
.filter(isRoutingCategory)
.every(category => selectModel({ category, models }) !== undefined);
}
Comment thread
cursor[bot] marked this conversation as resolved.
Resolved

export interface ModelRouterDeps {
/** The decision model that categorises the task, e.g. Jev; called on every route. */
classifier: () => Promise<DecisionModel>;
Expand Down
6 changes: 6 additions & 0 deletions packages/trueforge-sdk/src/api/types/AutoCapability.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 AutoCapability {
/** Whether Auto mode can be selected: the user has at least one model in every routing cluster. */
enabled: boolean;
}
1 change: 1 addition & 0 deletions packages/trueforge-sdk/src/api/types/CapabilitiesData.ts
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 CapabilitiesData {
auto: TrueForge.AutoCapability;
memory?: TrueForge.MemoryCapability;
sandbox: TrueForge.SandboxCapability;
sessionSharing: TrueForge.SessionSharingCapability;
Expand Down
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 @@ -12,6 +12,7 @@ export * from "./ApprovalAllow.js";
export * from "./ApprovalDecision.js";
export * from "./ApprovalDeny.js";
export * from "./AskUserQuestionsConfig.js";
export * from "./AutoCapability.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
@@ -0,0 +1,16 @@
// 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 AutoCapability: core.serialization.ObjectSchema<serializers.AutoCapability.Raw, TrueForge.AutoCapability> =
core.serialization.object({
enabled: core.serialization.boolean(),
});

export declare namespace AutoCapability {
export interface Raw {
enabled: boolean;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import type * as TrueForge from "../../api/index.js";
import * as core from "../../core/index.js";
import type * as serializers from "../index.js";
import { AutoCapability } from "./AutoCapability.js";
import { MemoryCapability } from "./MemoryCapability.js";
import { SandboxCapability } from "./SandboxCapability.js";
import { SessionSharingCapability } from "./SessionSharingCapability.js";
Expand All @@ -14,6 +15,7 @@ export const CapabilitiesData: core.serialization.ObjectSchema<
serializers.CapabilitiesData.Raw,
TrueForge.CapabilitiesData
> = core.serialization.object({
auto: AutoCapability,
memory: MemoryCapability.optional(),
sandbox: SandboxCapability,
sessionSharing: core.serialization.property("session_sharing", SessionSharingCapability),
Expand All @@ -24,6 +26,7 @@ export const CapabilitiesData: core.serialization.ObjectSchema<

export declare namespace CapabilitiesData {
export interface Raw {
auto: AutoCapability.Raw;
memory?: MemoryCapability.Raw | null;
sandbox: SandboxCapability.Raw;
session_sharing: SessionSharingCapability.Raw;
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 @@ -12,6 +12,7 @@ export * from "./ApprovalAllow.js";
export * from "./ApprovalDecision.js";
export * from "./ApprovalDeny.js";
export * from "./AskUserQuestionsConfig.js";
export * from "./AutoCapability.js";
export * from "./AvailableMcpServer.js";
export * from "./AvailableModel.js";
export * from "./AvailableModelProvider.js";
Expand Down
4 changes: 4 additions & 0 deletions packages/trueforge-sdk/tests/wire/server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ describe("ServerClient", () => {

const rawResponseBody = {
data: {
auto: { enabled: true },
memory: { enabled: true, reason: "reason" },
sandbox: { enabled: true, environments: { enabled: true } },
session_sharing: { granularity: "tenant" },
Expand Down Expand Up @@ -38,6 +39,9 @@ describe("ServerClient", () => {
const response = await client.server.getCapabilities();
expect(response).toEqual({
data: {
auto: {
enabled: true,
},
memory: {
enabled: true,
reason: "reason",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ export function AgentModelEditorContent({
query=""
onQueryChange={onQueryChange}
listboxId={listboxId}
autoOption={undefined}
reasoning={undefined}
showHeading={false}
showSearch={false}
onSelect={model => onChange({ ...spec, model: modelForSelection(spec, model) })}
Expand Down Expand Up @@ -209,6 +211,8 @@ export function AgentModelEditorContent({
query={query}
onQueryChange={onQueryChange}
listboxId={listboxId}
autoOption={undefined}
reasoning={undefined}
showHeading={false}
showSearch={false}
onSelect={model => onChange({ ...spec, model: modelForSelection(spec, model) })}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { auiButtonClass } from '../lib/buttonClasses.js';
import { useCompactLayout } from '../lib/CompactLayoutContext.js';
import { useIsMobile } from '../lib/useIsMobile.js';
import { Tooltip } from '../primitives/Tooltip.js';
import { DraftReasoningEffortSelector } from './DraftReasoningEffortSelector.js';

export function DraftComposerLeftSection({ disabled, isRunning, onAttach }: ComposerLeftSectionProps) {
const shell = useOptionalShellMode();
Expand Down Expand Up @@ -83,7 +82,6 @@ export function DraftComposerRightSection({ disabled, isRunning }: ComposerRight
return (
<div className="flex min-w-0 items-center gap-1">
{!isBuilder ? <DraftModelSelector disabled={disabled} isRunning={isRunning} /> : null}
<DraftReasoningEffortSelector disabled={disabled} isRunning={isRunning} />
</div>
);
}
Expand Down
Loading
Loading