Lightweight Task Execution Models: Architecture, Evaluation, and Launch Checklist

    This article explains how to build a runtime for lightweight task execution models, including the four runtime components, a tool-call data format with error codes and retry rules, the metrics and reporting fields for measuring execution ability, and a minimal evaluation script. It also covers why teams should retest on their own business data before relying on any figures.

    Introduction: Execution Ability Determines Whether a Model Can Enter Business Workflows

    When teams selected large language models in the past, they mainly evaluated question answering, reasoning, and writing. Once a model is connected to business systems, the questions change. Can it complete a chain of operations in sequence? Are its tool parameters correct? When something fails, can it decide the next step on its own? Lightweight task execution models target these routine workflows. Their goal is to complete multi-step tasks reliably within a limited number of steps.

    This article does not give scores for specific model versions. It covers architecture requirements, evaluation methods, and deployment steps. All numbers in the article are starting examples. Teams need to retest them on their own business data before using them.

    1. Components of an Agent Runtime

    An execution model needs to be hosted in an Agent Runtime. A runtime typically has four components.

    The action parser converts the structured instructions produced by the model into real calls. It should first validate field types and the tool allowlist. Instructions that fail validation return an error directly and never reach execution.

    The tool executor runs commands, calls interfaces, or reads and writes files inside a sandbox. Every call should have a timeout. The directories and network addresses it can access should be restricted.

    The result normalization layer organizes terminal output, HTTP responses, and exception stack traces into a unified structure. This layer is easy to overlook, but it determines whether the model can work out why a step failed. Raw logs often run to several thousand lines. Putting them directly into the prompt takes up context space and makes it hard for the model to focus on what matters. The normalization layer should keep only the last few lines and the exit code.

    The state store records the input, output, intermediate file paths, and timestamp of each step. Checkpoint recovery and after-the-fact audits both depend on it.

    2. Tool Call Data Formats and Error Codes

    A request example is shown below. Fields can be extended to fit the business:

    1. {
    2. "task_id": "t-20261125-0012",
    3. "step": 3,
    4. "action": {
    5. "tool": "shell",
    6. "arguments": {"command": "python etl.py --date 2026-11-24", "timeout_s": 30}
    7. }
    8. }

    A response should include an explicit status code:

    1. {
    2. "task_id": "t-20261125-0012",
    3. "step": 3,
    4. "status": "error",
    5. "error_code": "TIMEOUT",
    6. "stdout_tail": "...",
    7. "stderr_tail": "...",
    8. "exit_code": null
    9. }

    Each error code maps to a model action. We recommend writing this mapping into the runtime configuration.

    Error code Meaning Recommended action
    OK The call succeeded Proceed to the next step
    NONZERO_EXIT The command returned a non-zero exit code Read stderr_tail, adjust the parameters, and retry at most once
    TIMEOUT The call exceeded timeout_s Check whether the operation is idempotent. If it is, retry once. If not, split the task
    PERMISSION_DENIED Insufficient permissions Stop this path and use an allowed path or request authorization
    NOT_FOUND The file or interface does not exist Check the path and the output of the upstream step. Do not retry blindly
    APPROVAL_REQUIRED The operation requires approval Pause, save a checkpoint, and wait for the approval result. Never bypass approval

    The maximum number of retries for the same step is 2. After the limit is reached, the task is handed over to manual handling.

    3. Measuring Execution Ability

    When selecting a model, look at execution metrics tied to the business rather than only the overall ranking. We recommend recording at least the following four metrics.

    Task completion rate is the share of tasks that reach the goal within the step limit. It shows whether the model can finish the job, so tasks that exceed the step limit do not count as completed.

    Tool call success rate is the number of calls that return OK divided by the total number of calls. Count failures separately by error code. This helps locate whether the problem lies in parameters, permissions, or the environment.

    Human intervention rate should be tracked as two separate figures. The first is the share of tasks where the model actively asks for confirmation. The second is the share where a human interrupts or takes over. These figures mean different things, so combining them makes the numbers hard to interpret.

    Average steps is the number of actions needed to complete one task. Use it to estimate cost and time.

    Every evaluation result must describe how it was measured. Each report should include at least the following fields:

    • Sample source: business log sampling, manually constructed tasks, or public datasets, with the proportion of each.
    • Sample size: number of tasks and number of tool calls.
    • Time window: start and end dates.
    • Model version: full version number and inference parameters.
    • Run settings: step limit, per-call timeout, and total task duration.
    • Failure classification: counts by error code, with the cause of each failure as judged by a human.

    Figures without this information can only serve as references. They should not be used directly for purchasing decisions. Public benchmarks often differ widely from real workflows, so teams should retest on their own business samples.

    Below is a minimal example of an execution-level evaluation script. You can build on it and connect it to business logs:

    1. from collections import Counter
    2. from dataclasses import dataclass
    3. @dataclass
    4. class Step:
    5. error_code: str # OK, NONZERO_EXIT, TIMEOUT, PERMISSION_DENIED, NOT_FOUND, APPROVAL_REQUIRED
    6. asked_confirm: bool # The model actively requests confirmation
    7. human_interrupt: bool # Interrupted or taken over by a human
    8. @dataclass
    9. class Task:
    10. task_id: str
    11. goal_reached: bool
    12. steps: list[Step]
    13. def evaluate(tasks, max_steps, meta):
    14. n = len(tasks)
    15. if n == 0:
    16. raise ValueError("Sample is empty, cannot compute metrics")
    17. done = sum(1 for t in tasks if t.goal_reached and len(t.steps) <= max_steps)
    18. calls = [s for t in tasks for s in t.steps]
    19. ok = sum(1 for s in calls if s.error_code == "OK")
    20. confirm = sum(1 for t in tasks if any(s.asked_confirm for s in t.steps))
    21. interrupt = sum(1 for t in tasks if any(s.human_interrupt for s in t.steps))
    22. failures = Counter(s.error_code for s in calls if s.error_code != "OK")
    23. return {
    24. "meta": meta, # Sample source, time window, model version
    25. "sample_size": n,
    26. "task_completion_rate": done / n,
    27. "tool_success_rate": ok / len(calls) if calls else 0.0,
    28. "model_confirm_rate": confirm / n,
    29. "human_interrupt_rate": interrupt / n,