mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
feat: add model selection for AI agents (claude, codex, gemini)
Add a new ModelSelector component that allows users to choose specific model variants for different AI agents. This includes: - ModelSelector UI component with agent-specific model options - Model parameter propagation through API, RPC, and spawning layers - Support for auto model selection (default behavior) - Localization strings for English and Chinese - Type definitions for model options per agent
This commit is contained in:
@@ -100,7 +100,7 @@ export class ApiMachineClient {
|
||||
|
||||
setRPCHandlers({ spawnSession, stopSession, requestShutdown }: MachineRpcHandlers): void {
|
||||
this.rpcHandlerManager.registerHandler('spawn-happy-session', async (params: any) => {
|
||||
const { directory, sessionId, machineId, approvedNewDirectoryCreation, agent, yolo, token, sessionType, worktreeName } = params || {}
|
||||
const { directory, sessionId, machineId, approvedNewDirectoryCreation, agent, model, yolo, token, sessionType, worktreeName } = params || {}
|
||||
|
||||
if (!directory) {
|
||||
throw new Error('Directory is required')
|
||||
@@ -112,6 +112,7 @@ export class ApiMachineClient {
|
||||
machineId,
|
||||
approvedNewDirectoryCreation,
|
||||
agent,
|
||||
model,
|
||||
yolo,
|
||||
token,
|
||||
sessionType,
|
||||
|
||||
@@ -4,6 +4,7 @@ export interface SpawnSessionOptions {
|
||||
sessionId?: string
|
||||
approvedNewDirectoryCreation?: boolean
|
||||
agent?: 'claude' | 'codex' | 'gemini'
|
||||
model?: string
|
||||
yolo?: boolean
|
||||
token?: string
|
||||
sessionType?: 'simple' | 'worktree'
|
||||
|
||||
@@ -333,6 +333,9 @@ export async function startRunner(): Promise<void> {
|
||||
'--hapi-starting-mode', 'remote',
|
||||
'--started-by', 'runner'
|
||||
];
|
||||
if (options.model) {
|
||||
args.push('--model', options.model);
|
||||
}
|
||||
if (yolo) {
|
||||
args.push('--yolo');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user