🧩 feat: Enable Model Spec Subagents (#13598)
Some checks failed
Docker Dev Branch Images Build / build (Dockerfile, lc-dev, node) (push) Waiting to run
Docker Dev Branch Images Build / build (Dockerfile.multi, lc-dev-api, api-build) (push) Waiting to run
GitNexus Index / index (push) Waiting to run
GitNexus Index / post-index (push) Blocked by required conditions
Docker Dev Images Build / build (Dockerfile, librechat-dev, node) (push) Waiting to run
Docker Dev Images Build / build (Dockerfile.multi, librechat-dev-api, api-build) (push) Waiting to run
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (push) Waiting to run
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Blocked by required conditions
Sync Helm Chart Tags / Ignore non-main push (push) Waiting to run
Sync Helm Chart Tags / Sync chart tags (push) Waiting to run
Publish `@librechat/client` to NPM / pack (push) Has been cancelled
Publish `librechat-data-provider` to NPM / pack (push) Has been cancelled
Publish `@librechat/client` to NPM / publish-npm (push) Has been cancelled
Publish `librechat-data-provider` to NPM / publish-npm (push) Has been cancelled

This commit is contained in:
Danny Avila 2026-06-08 11:43:08 -04:00 committed by GitHub
parent cb6dbc8f60
commit fb87abe773
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 303 additions and 19 deletions

View file

@ -10,11 +10,12 @@ import {
} from './schemas';
import { ComponentTypes, SettingTypes, OptionTypes } from './generate';
import { specsConfigSchema, TSpecsConfig } from './models';
import { REFILL_INTERVAL_UNITS } from './balance';
import { fileConfigSchema } from './file-config';
import { apiBaseUrl } from './api-endpoints';
import { FileSources } from './types/files';
import { MCPServersSchema } from './mcp';
import { REFILL_INTERVAL_UNITS } from './balance';
export { MAX_SUBAGENTS } from './limits';
export const defaultSocialLogins = ['google', 'facebook', 'openid', 'github', 'discord', 'saml'];
@ -2288,9 +2289,6 @@ export enum Constants {
SUBAGENT = 'subagent',
}
/** Maximum number of explicit subagents per parent agent. UI + Zod schema share this. */
export const MAX_SUBAGENTS = 10;
/** Maximum explicit subagent hops allowed from any root agent at runtime. */
export const MAX_SUBAGENT_DEPTH = 5;

View file

@ -0,0 +1,2 @@
/** Maximum number of explicit subagents per parent agent. UI + Zod schema share this. */
export const MAX_SUBAGENTS = 10;

View file

@ -1,4 +1,5 @@
import { z } from 'zod';
import type { AgentSubagentsConfig } from './types/assistants';
import type { TModelSpecPreset } from './schemas';
import {
EModelEndpoint,
@ -7,6 +8,7 @@ import {
AuthType,
authTypeSchema,
} from './schemas';
import { MAX_SUBAGENTS } from './limits';
export type TModelSpec = {
name: string;
@ -41,8 +43,15 @@ export type TModelSpec = {
artifacts?: string | boolean;
mcpServers?: string[];
skills?: boolean | string[];
subagents?: AgentSubagentsConfig;
};
export const modelSpecSubagentsSchema = z.object({
enabled: z.boolean().optional(),
allowSelf: z.boolean().optional(),
agent_ids: z.array(z.string()).max(MAX_SUBAGENTS).optional(),
});
export const tModelSpecSchema = z.object({
name: z.string(),
label: z.string(),
@ -64,6 +73,7 @@ export const tModelSpecSchema = z.object({
artifacts: z.union([z.string(), z.boolean()]).optional(),
mcpServers: z.array(z.string()).optional(),
skills: z.union([z.boolean(), z.array(z.string())]).optional(),
subagents: modelSpecSubagentsSchema.optional(),
});
export const specsConfigSchema = z.object({

View file

@ -10,11 +10,11 @@ import type {
ReasoningResponseKey,
ReasoningParameterFormat,
} from './schemas';
import type { Agent, AgentSubagentsConfig } from './types/assistants';
import type { RefillIntervalUnit } from './balance';
import type { SettingDefinition } from './generate';
import type { TMinimalFeedback } from './feedback';
import type { ContentTypes } from './types/runs';
import type { Agent } from './types/assistants';
export * from './schemas';
@ -107,6 +107,7 @@ export type TEphemeralAgent = {
execute_code?: boolean;
artifacts?: string;
skills?: boolean;
subagents?: AgentSubagentsConfig;
};
export type TPayload = Partial<TMessage> &