Merge pull request #2233 from tamasPetki/pr/container-config-model-effort
feat(container-config): add per-group model + effort overrides
This commit is contained in:
@@ -16,6 +16,8 @@ export interface RunnerConfig {
|
|||||||
agentGroupId: string;
|
agentGroupId: string;
|
||||||
maxMessagesPerPrompt: number;
|
maxMessagesPerPrompt: number;
|
||||||
mcpServers: Record<string, { command: string; args: string[]; env: Record<string, string> }>;
|
mcpServers: Record<string, { command: string; args: string[]; env: Record<string, string> }>;
|
||||||
|
model?: string;
|
||||||
|
effort?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const DEFAULT_MAX_MESSAGES = 10;
|
const DEFAULT_MAX_MESSAGES = 10;
|
||||||
@@ -43,6 +45,8 @@ export function loadConfig(): RunnerConfig {
|
|||||||
agentGroupId: (raw.agentGroupId as string) || '',
|
agentGroupId: (raw.agentGroupId as string) || '',
|
||||||
maxMessagesPerPrompt: (raw.maxMessagesPerPrompt as number) || DEFAULT_MAX_MESSAGES,
|
maxMessagesPerPrompt: (raw.maxMessagesPerPrompt as number) || DEFAULT_MAX_MESSAGES,
|
||||||
mcpServers: (raw.mcpServers as RunnerConfig['mcpServers']) || {},
|
mcpServers: (raw.mcpServers as RunnerConfig['mcpServers']) || {},
|
||||||
|
model: (raw.model as string) || undefined,
|
||||||
|
effort: (raw.effort as string) || undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
return _config;
|
return _config;
|
||||||
|
|||||||
@@ -91,6 +91,8 @@ async function main(): Promise<void> {
|
|||||||
mcpServers,
|
mcpServers,
|
||||||
env: { ...process.env },
|
env: { ...process.env },
|
||||||
additionalDirectories: additionalDirectories.length > 0 ? additionalDirectories : undefined,
|
additionalDirectories: additionalDirectories.length > 0 ? additionalDirectories : undefined,
|
||||||
|
model: config.model,
|
||||||
|
effort: config.effort,
|
||||||
});
|
});
|
||||||
|
|
||||||
await runPollLoop({
|
await runPollLoop({
|
||||||
|
|||||||
@@ -257,11 +257,15 @@ export class ClaudeProvider implements AgentProvider {
|
|||||||
private mcpServers: Record<string, McpServerConfig>;
|
private mcpServers: Record<string, McpServerConfig>;
|
||||||
private env: Record<string, string | undefined>;
|
private env: Record<string, string | undefined>;
|
||||||
private additionalDirectories?: string[];
|
private additionalDirectories?: string[];
|
||||||
|
private model?: string;
|
||||||
|
private effort?: string;
|
||||||
|
|
||||||
constructor(options: ProviderOptions = {}) {
|
constructor(options: ProviderOptions = {}) {
|
||||||
this.assistantName = options.assistantName;
|
this.assistantName = options.assistantName;
|
||||||
this.mcpServers = options.mcpServers ?? {};
|
this.mcpServers = options.mcpServers ?? {};
|
||||||
this.additionalDirectories = options.additionalDirectories;
|
this.additionalDirectories = options.additionalDirectories;
|
||||||
|
this.model = options.model;
|
||||||
|
this.effort = options.effort;
|
||||||
this.env = {
|
this.env = {
|
||||||
...(options.env ?? {}),
|
...(options.env ?? {}),
|
||||||
CLAUDE_CODE_AUTO_COMPACT_WINDOW,
|
CLAUDE_CODE_AUTO_COMPACT_WINDOW,
|
||||||
@@ -293,6 +297,9 @@ export class ClaudeProvider implements AgentProvider {
|
|||||||
],
|
],
|
||||||
disallowedTools: SDK_DISALLOWED_TOOLS,
|
disallowedTools: SDK_DISALLOWED_TOOLS,
|
||||||
env: this.env,
|
env: this.env,
|
||||||
|
model: this.model,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
effort: this.effort as any,
|
||||||
permissionMode: 'bypassPermissions',
|
permissionMode: 'bypassPermissions',
|
||||||
allowDangerouslySkipPermissions: true,
|
allowDangerouslySkipPermissions: true,
|
||||||
settingSources: ['project', 'user'],
|
settingSources: ['project', 'user'],
|
||||||
|
|||||||
@@ -25,6 +25,16 @@ export interface ProviderOptions {
|
|||||||
mcpServers?: Record<string, McpServerConfig>;
|
mcpServers?: Record<string, McpServerConfig>;
|
||||||
env?: Record<string, string | undefined>;
|
env?: Record<string, string | undefined>;
|
||||||
additionalDirectories?: string[];
|
additionalDirectories?: string[];
|
||||||
|
/**
|
||||||
|
* Model alias (`sonnet`, `opus`, `haiku`) or full model ID. Passed through
|
||||||
|
* to the underlying SDK. If omitted, the SDK default is used.
|
||||||
|
*/
|
||||||
|
model?: string;
|
||||||
|
/**
|
||||||
|
* Reasoning effort (`'low' | 'medium' | 'high' | 'xhigh' | 'max'`). Passed
|
||||||
|
* through to the underlying SDK. If omitted, the SDK default is used.
|
||||||
|
*/
|
||||||
|
effort?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface QueryInput {
|
export interface QueryInput {
|
||||||
|
|||||||
Reference in New Issue
Block a user