fix(growth,hands,kernel,desktop): Phase 1 用户可感知修复 — 6 项断链修复
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled

Phase 1 修复内容:
1. Hand 执行前端字段映射 — instance_id → runId,修复 Hand 状态追踪
2. Heartbeat 痛点感知 — PAIN_POINTS_CACHE + VikingStorage 持久化 + 未解决痛点检查
3. Browser Hand 委托消息 — pending_execution → delegated_to_frontend + 中文摘要
4. 跨会话记忆检索增强 — 扩展 IdentityRecall 模式 26→43 + 弱身份信号检测 + 低结果 fallback
5. Twitter Hand 凭据持久化 — SetCredentials action + 文件持久化 + 启动恢复
6. Browser 测试修复 — 适配新的 delegated_to_frontend 响应格式

验证: cargo check  | cargo test 912 PASS  | tsc --noEmit 
This commit is contained in:
iven
2026-04-21 10:18:25 +08:00
parent 2f5e9f1755
commit 9a2611d122
10 changed files with 435 additions and 165 deletions

View File

@@ -380,10 +380,14 @@ export function installApiMethods(ClientClass: { prototype: GatewayClient }): vo
proto.triggerHand = async function (this: GatewayClient, name: string, params?: Record<string, unknown>): Promise<{ runId: string; status: string }> {
try {
const result = await this.restPost<{
instance_id: string;
status: string;
success: boolean;
run_id?: string;
output?: { status?: string };
}>(`/api/hands/${name}/activate`, params || {});
return { runId: result.instance_id, status: result.status };
return {
runId: result.run_id || '',
status: result.output?.status || (result.success ? 'completed' : 'failed'),
};
} catch (err) {
logger.error(`Hand trigger failed for ${name}`, { error: err });
throw err;

View File

@@ -91,19 +91,21 @@ export function installHandMethods(ClientClass: { prototype: KernelClient }): vo
* Trigger/execute a hand
*/
proto.triggerHand = async function (this: KernelClient, name: string, params?: Record<string, unknown>, autonomyLevel?: string): Promise<{ runId: string; status: string }> {
const result = await invoke<{ instance_id: string; status: string }>('hand_execute', {
const result = await invoke<{ success: boolean; runId?: string; output?: { status?: string }; error?: string }>('hand_execute', {
id: name,
input: params || {},
...(autonomyLevel ? { autonomyLevel } : {}),
});
const runId = result.runId || '';
const status = result.output?.status || (result.success ? 'completed' : 'failed');
// P2-25: Audit hand execution
try {
const { logSecurityEvent } = await import('./security-audit');
logSecurityEvent('hand_executed', `Hand "${name}" executed (runId: ${result.instance_id}, status: ${result.status})`, {
handId: name, runId: result.instance_id, status: result.status, autonomyLevel,
logSecurityEvent('hand_executed', `Hand "${name}" executed (runId: ${runId}, status: ${status})`, {
handId: name, runId, status, autonomyLevel,
});
} catch { /* audit failure is non-blocking */ }
return { runId: result.instance_id, status: result.status };
return { runId, status };
};
/**