feat(hermes): add delegation model override config

This commit is contained in:
晴天
2026-05-26 06:11:25 +08:00
parent 56519808d7
commit c19d6e80d9
6 changed files with 134 additions and 6 deletions

View File

@@ -192,6 +192,8 @@ const EXECUTION_LIMITS_DEFAULTS = {
delegationOrchestratorEnabled: true,
delegationSubagentAutoApprove: false,
delegationInheritMcpToolsets: true,
delegationModel: '',
delegationProvider: '',
}
const IO_SAFETY_DEFAULTS = {
@@ -1548,6 +1550,14 @@ export function render() {
<span class="hm-field-label">${t('engine.hermesExecutionLimitsDelegationMaxSpawnDepth')}</span>
<input id="hm-delegation-max-spawn-depth" class="hm-input" type="number" inputmode="numeric" min="1" max="3" step="1" value="${esc(executionLimitsValues.delegationMaxSpawnDepth)}" ${disabled ? 'disabled' : ''}>
</label>
<label class="hm-field">
<span class="hm-field-label">${t('engine.hermesExecutionLimitsDelegationModel')}</span>
<input id="hm-delegation-model" class="hm-input" value="${esc(executionLimitsValues.delegationModel)}" placeholder="google/gemini-3-flash-preview" ${disabled ? 'disabled' : ''}>
</label>
<label class="hm-field">
<span class="hm-field-label">${t('engine.hermesExecutionLimitsDelegationProvider')}</span>
<input id="hm-delegation-provider" class="hm-input" value="${esc(executionLimitsValues.delegationProvider)}" placeholder="openrouter" ${disabled ? 'disabled' : ''}>
</label>
</div>
<div class="hm-config-check-grid">
<label class="hm-channel-check">
@@ -3402,6 +3412,8 @@ export function render() {
delegationChildTimeoutSeconds: el.querySelector('#hm-delegation-child-timeout-seconds')?.value || '600',
delegationMaxConcurrentChildren: el.querySelector('#hm-delegation-max-concurrent-children')?.value || '3',
delegationMaxSpawnDepth: el.querySelector('#hm-delegation-max-spawn-depth')?.value || '1',
delegationModel: el.querySelector('#hm-delegation-model')?.value || '',
delegationProvider: el.querySelector('#hm-delegation-provider')?.value || '',
delegationOrchestratorEnabled: !!el.querySelector('#hm-delegation-orchestrator-enabled')?.checked,
delegationSubagentAutoApprove: !!el.querySelector('#hm-delegation-subagent-auto-approve')?.checked,
delegationInheritMcpToolsets: !!el.querySelector('#hm-delegation-inherit-mcp-toolsets')?.checked,

View File

@@ -561,10 +561,12 @@ export default {
hermesExecutionLimitsDelegationChildTimeout: _('每个子任务超时(秒)', 'Child timeout (s)', '每個子任務逾時(秒)'),
hermesExecutionLimitsDelegationMaxConcurrent: _('最大并发子任务', 'Max concurrent children', '最大並發子任務'),
hermesExecutionLimitsDelegationMaxSpawnDepth: _('委派深度上限', 'Spawn depth limit', '委派深度上限'),
hermesExecutionLimitsDelegationModel: _('子 Agent 模型覆盖(可选)', 'Child model override (optional)', '子 Agent 模型覆蓋(可選)'),
hermesExecutionLimitsDelegationProvider: _('子 Agent Provider 覆盖(可选)', 'Child provider override (optional)', '子 Agent Provider 覆蓋(可選)'),
hermesExecutionLimitsDelegationOrchestratorEnabled: _('允许中间协调 Agent', 'Allow orchestrator children', '允許中間協調 Agent'),
hermesExecutionLimitsDelegationInheritMcp: _('保留父任务 MCP 工具集', 'Inherit parent MCP toolsets', '保留父任務 MCP 工具集'),
hermesExecutionLimitsDelegationAutoApprove: _('自动批准子任务危险命令', 'Auto-approve child dangerous commands', '自動批准子任務危險命令'),
hermesExecutionLimitsFootnote: _('默认会拒绝子任务危险命令审批,适合交互式和长跑任务。只有在完全信任无人值守环境时才开启自动批准。', 'By default, dangerous-command approvals from child agents are auto-denied, which fits interactive and long-running tasks. Enable auto-approval only in fully trusted unattended environments.', '預設會拒絕子任務危險命令審批,適合互動式和長跑任務。只有在完全信任無人值守環境時才啟用自動批准。'),
hermesExecutionLimitsFootnote: _('子 Agent 模型和 Provider 留空时继承父任务;只在需要降低成本、隔离慢模型或固定子任务路由时填写。默认会拒绝子任务危险命令审批,适合交互式和长跑任务。只有在完全信任无人值守环境时才开启自动批准。', 'Leave child model and provider blank to inherit the parent task. Fill them only to reduce cost, isolate slower models, or pin child-task routing. By default, dangerous-command approvals from child agents are auto-denied, which fits interactive and long-running tasks. Enable auto-approval only in fully trusted unattended environments.', '子 Agent 模型和 Provider 留空時繼承父任務;只在需要降低成本、隔離慢模型或固定子任務路由時填寫。預設會拒絕子任務危險命令審批,適合互動式和長跑任務。只有在完全信任無人值守環境時才啟用自動批准。'),
hermesIoSafetyTitle: _('输入输出保护', 'Input and output safety', '輸入輸出保護'),
hermesIoSafetyDesc: _('限制单次文件读取和工具输出体量,避免大文件或长日志一次性挤爆上下文。', 'Limit single file reads and tool output size so large files or long logs do not flood the context.', '限制單次檔案讀取和工具輸出體量,避免大型檔案或長日誌一次性擠爆上下文。'),
hermesIoSafetyStatusReady: _('结构化配置', 'structured settings', '結構化設定'),