fix(autonomy): hand_trigger 从 null 映射改为 handAutoTrigger 字段

根因: autonomy-manager.ts:268 将 hand_trigger 硬编码为 null,
导致任何自主权级别都无法自动触发 Hand。
新增 handAutoTrigger 字段,autonomous 级别默认 true。
UI 增加对应开关。
This commit is contained in:
iven
2026-04-11 12:32:19 +08:00
parent 33c1bd3866
commit be01127098
2 changed files with 14 additions and 1 deletions

View File

@@ -381,6 +381,15 @@ export function AutonomyConfig({ className = '', onConfigChange }: AutonomyConfi
})
}
/>
<ActionToggle
label="自动触发 Hand 能力"
enabled={config.allowedActions.handAutoTrigger}
onChange={(enabled) =>
updateConfig({
allowedActions: { ...config.allowedActions, handAutoTrigger: enabled },
})
}
/>
</div>
</div>

View File

@@ -48,6 +48,7 @@ export interface AutonomyConfig {
selfModification: boolean;
autoCompaction: boolean;
autoReflection: boolean;
handAutoTrigger: boolean;
};
approvalThreshold: {
importanceMax: number; // Auto-approve if importance <= this (default: 5)
@@ -112,6 +113,7 @@ export const DEFAULT_AUTONOMY_CONFIGS: Record<AutonomyLevel, AutonomyConfig> = {
selfModification: false,
autoCompaction: false,
autoReflection: false,
handAutoTrigger: false,
},
approvalThreshold: {
importanceMax: 0,
@@ -129,6 +131,7 @@ export const DEFAULT_AUTONOMY_CONFIGS: Record<AutonomyLevel, AutonomyConfig> = {
selfModification: false,
autoCompaction: true,
autoReflection: true,
handAutoTrigger: false,
},
approvalThreshold: {
importanceMax: 5,
@@ -146,6 +149,7 @@ export const DEFAULT_AUTONOMY_CONFIGS: Record<AutonomyLevel, AutonomyConfig> = {
selfModification: false, // Always require approval for self-modification
autoCompaction: true,
autoReflection: true,
handAutoTrigger: true,
},
approvalThreshold: {
importanceMax: 7,
@@ -265,7 +269,7 @@ export class AutonomyManager {
skill_uninstall: 'skillAutoInstall',
config_change: null,
workflow_trigger: 'autoCompaction',
hand_trigger: null,
hand_trigger: 'handAutoTrigger',
llm_call: 'autoReflection',
reflection_run: 'autoReflection',
compaction_run: 'autoCompaction',