Task configuration:
{"task_id": "06", "task_name": "gitCommit", "description": "\u5728vscode\u7684\u5de5\u4f5c\u533a\u5c06\u6240\u6709\u7684\u4fee\u6539", "application_info": {"name": "vscode", "executable_path": "/usr/share/code/code", "args": ["--no-sandbox", "--user-data-dir=/root/vscode_user_data_dir/"]}, "task_parameters": {"commit_message": "fix bugs"}, "instruction_template": "\u5728vscode\u5f53\u524d\u6253\u5f00\u7684\u5de5\u4f5c\u533a\u4e2d\u63d0\u4ea4\u6240\u6709\u672a\u63d0\u4ea4\u7684\u4fee\u6539, \u5e76\u4e14commit\u7684\u4fe1\u606f\u662f ${commit_message}", "evaluation_setup": {"scripts": [{"role": "hook", "path": "hooker.js"}, {"role": "handler", "path": "handler.py"}], "timeout": 120, "evaluator_type": "IpcInjector", "evaluate_on_completion": true}, "total_key_steps": 2, "preconditions": {"vscode_running": true}, "events": {"evaluate_on_completion": {"description": "\u5728\u4efb\u52a1\u7ed3\u675f\u65f6\u5224\u65ad\u662f\u5426\u6240\u6709\u7684\u4fee\u6539\u5df2\u7ecf\u63d0\u4ea4", "is_key_step": true, "key_step_index": 1, "key_step_name": "\u5728\u4efb\u52a1\u7ed3\u675f\u65f6\u68c0\u67e5\u4efb\u52a1\u662f\u5426\u5b8c\u6210"}}, "mcp_servers": [{"command": "mcp-proxy", "args": ["http://127.0.0.1:6010/sse"]}], "context_data": [{"from": "tests/context_data/vscode/user_data", "to": "/root/vscode_user_data_dir"}, {"from": "tests/context_data/vscode/extensions", "to": "/root/.vscode/"}, {"from": "tests/context_data/vscode/C-Plus-Plus", "to": "/root/C-Plus-Plus"}]}

Hook script:
/**
 * 检查当前工作区是否有未提交的Git修改并获取最近的commit message
 * @returns {Promise<{hasChanges: boolean, lastCommitMessage: string | null}>}
 */
async function checkGitStatus() {
    try {
        // 获取当前工作区文件夹
        const workspaceFolders = vscode.workspace.workspaceFolders;
        if (!workspaceFolders || workspaceFolders.length === 0) {
            return { hasChanges: false, lastCommitMessage: null };
        }

        // 获取第一个工作区文件夹路径
        const workspacePath = workspaceFolders[0].uri.fsPath;

        // 使用VS Code内置的Git扩展API
        const gitExtension = vscode.extensions.getExtension('vscode.git')?.exports;
        if (!gitExtension) {
            return { hasChanges: false, lastCommitMessage: null };
        }

        const api = gitExtension.getAPI(1);
        const repository = api.getRepository(vscode.Uri.file(workspacePath));

        if (!repository) {
            return { hasChanges: false, lastCommitMessage: null };
        }

        // 检查是否有未提交的修改
        const hasChanges = repository.state.workingTreeChanges.length > 0 || 
                          repository.state.indexChanges.length > 0;

        // 获取最近的commit message
        let lastCommitMessage = null;
        const log = await repository.log({ maxEntries: 1 });
        if (log.length > 0) {
            lastCommitMessage = log[0].message;
        }

        return { hasChanges, lastCommitMessage };

    } catch (error) {
        socket.emit("send", {
            'event_type': "error",
            'message': `在查看git仓库时出现了错误: ${error.message}`
        });
        return { hasChanges: false, lastCommitMessage: null };
    }
}

// Listen for 'evaluate' event
socket.on('evaluate', async () => {
    const { hasChanges, lastCommitMessage } = await checkGitStatus();
    const message1 = hasChanges ? `工作区仍有未提交的修改` : `工作区所有修改已提交`;
    const message2 = `最近的commit信息是:\n`+lastCommitMessage;
    // vscode.window.showInformationMessage(message);
    socket.emit("send", {
        'event_type': "evaluate_on_completion",
        'message': message1+`\n`+message2,
        'has_changes': hasChanges,
        'last_message': lastCommitMessage
    });
});

Evaluation handler:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from typing import Dict, Any, Optional, Callable, List

def message_handler(message: Dict[str, Any], logger, task_parameter: Dict[str, Any]) -> Optional[List[Dict[str, Any]]]:    
    event_type = message.get('event_type')
    logger.info(message.get('message'))
    if event_type == "evaluate_on_completion":
        has_changes = message.get('has_changes')
        last_message = message.get('last_message')
        expected_message = task_parameter.get("commit_message", "fix bugs")
        if not has_changes and expected_message == last_message:
            return [
                {"status": "key_step", "index": 1},
                {"status": "success", "reason": f"任务成功完成"}
            ]
        else:
            return [{"status": "error", "type": "evaluate_on_completion", "message": "任务没有完成"}]
    return None