Task configuration:
{"task_id": "02", "task_name": "stop_recording", "description": "Stop recording in obs-studio", "application_info": {"name": "obs-studio", "executable_path": "/workspace/PC-Canary/apps/obs-studio/build_ubuntu/rundir/Debug/bin/obs", "args": []}, "instruction_template": "Please stop recording in obs-studio", "evaluation_setup": {"scripts": [{"role": "hook", "path": "hooker.js"}, {"role": "handler", "path": "handler.py"}], "timeout": 180}, "preconditions": {"obs_studio_running": true, "obs_studio_recording": true}, "total_key_steps": 1, "events": {"obs_output_stop_called": {"description": "Intercepted stop recording function call", "is_key_step": false}, "obs_output_force_stop_called": {"description": "Intercepted force stop recording function call", "is_key_step": false}, "obs_output_stop_returned": {"description": "Successfully stopped recording", "is_key_step": true, "key_step_index": 1, "key_step_name": "Stop recording"}, "obs_output_force_stop_returned": {"description": "Successfully force stopped recording", "is_key_step": false, "key_step_index": 1, "key_step_name": "Force stop recording"}, "error": "Error event"}, "mcp_servers": [{"command": "node", "args": ["/home/agent/obs-mcp/build/index.js"]}]}

Hook script:
// OBS recording update monitoring hook script
// Used to monitor OBS recording update operations

(function () {
    // Script settings
    const FUNCTION_obs_output_stop = "obs_output_stop";
    const FUNCTION_obs_output_force_stop = "obs_output_force_stop";

    // Send events to the evaluation system
    function sendEvent(eventType, data = {}) {
        const payload = {
            event: eventType,
            ...data,
            timestamp: new Date().getTime()
        };
        send(payload);
    }

    // Get function address
    function getFunctionAddress(functionName) {
        const funcAddr = DebugSymbol.getFunctionByName(functionName);
        if (!funcAddr) {
            sendEvent("error", {
                error_type: "function_not_found",
                message: `Cannot find function ${functionName}`
            });
            return null;
        }

        sendEvent("function_found", {
            address: funcAddr.toString(),
            message: `Found the actual address of function ${functionName}`
        });
        return funcAddr;
    }

    // Initialize recording update hooks
    function initStopRecordingHook() {

        const obsOutputStopFuncAddr = getFunctionAddress(FUNCTION_obs_output_stop);
        if (!obsOutputStopFuncAddr) {
            return;
        }

        const obsOutputFroceStopFuncAddr = getFunctionAddress(FUNCTION_obs_output_force_stop);
        if (!obsOutputFroceStopFuncAddr) {
            return;
        }

        Interceptor.attach(obsOutputStopFuncAddr, {
            onEnter: function(args) {
                sendEvent("obs_output_stop_called", {
                    message: "Intercepted the function call to stop recording"
                });
            },

            onLeave: function(retval) {
                sendEvent("obs_output_stop_returned", {
                    message: "Stop recording function returned"
                });
            }
        });

        Interceptor.attach(obsOutputFroceStopFuncAddr, {
            onEnter: function(args) {
                sendEvent("obs_output_force_stop_called", {
                    message: "Intercepted the function call to force stop recording"
                });
            },

            onLeave: function(retval) {
                sendEvent("obs_output_force_stop_returned", {
                    message: "Force stop recording function returned"
                });
            }
        });
    }

    // Initialize hooks
    function initHook() {
        sendEvent("script_initialized", {
            message: "OBS stop recording monitoring script has started"
        });

        // Initialize each hook
        initStopRecordingHook();
        sendEvent("hook_installed", {
            message: "Stop recording monitoring hook installed, waiting for operation..."
        });
    }

    // Start script
    initHook();
})();

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

from typing import Dict, Any, Optional, List


def message_handler(
    message: Dict[str, Any], logger, task_parameter: Dict[str, Any]
) -> Optional[List[Dict[str, Any]]]:
    payload = message.get("payload")
    if not payload or not isinstance(payload, dict):
        logger.error(message)
        return None

    event_type = payload["event"]
    if (
        event_type == "obs_output_force_stop_returned"
        or event_type == "obs_output_stop_returned"
    ):
        return [
            {"status": "key_step", "index": 1},
            {"status": "success", "reason": "stop recording success"},
        ]

    return None