Why the Same Model Scores Differently Across Agent Runtime Environments

    Agent evaluation results reflect not only model capability but also how well the model works with its external runtime framework. This article explains what the runtime framework includes, why the same model can be sensitive to tool exposure, system prompts, agent loops, context handling, and protocol details, and how to design controlled comparisons, regression tests, and metric reporting that separate model behavior from environment effects.

    1. Background

    The same large model can score very differently when it executes the same batch of tasks in different runtime environments. This is especially visible in agent scenarios. In tool-calling evaluations, developers have observed that changing only the number of tools, the system prompt, or the wording at the beginning of a conversation can cause noticeable fluctuations in completion rates. This suggests that evaluation results reflect not only the model’s own capability but also how well the model works with its external runtime environment.

    This article refers to this external environment as the runtime framework. It includes the system prompt, tool definitions (tool schemas), the agent loop, context management policies, and plugin, skill description, and external protocol integration components. Before teams select models, evaluate performance, or move into engineering deployment, they need to understand the relationship between the runtime framework and the model. Otherwise, changing the runtime framework can change the conclusion.

    2. What the Runtime Framework Includes

    2.1 Tool Exposure

    The number of tools and their descriptions are the first layer of input the model receives. The more tools there are, the longer the tool definitions become in each request, and the model must decide which tool to call from a larger candidate set. A smaller tool set can reduce decision difficulty, but it also narrows the range of capabilities available to the model.

    The wording of tool descriptions also affects results. Parameter names, field descriptions, examples, and error-message style determine how deeply the model understands what a tool is for. When descriptions are vague, the model is more likely to choose the wrong tool or fill in parameters incorrectly.

    2.2 System Prompts and Working Conventions

    The system prompt defines the role, behavioral guidelines, output format, and task flow. Together with tool definitions, it tells the model what to do in the current context. Once the combination of the two changes, the model’s judgment of task boundaries can also change.

    2.3 Agent Loop and Reasoning Content Round-Trip

    The agent loop determines when the model stops, when it calls tools again, and how tool results are written back into the conversation. For models that support reasoning, multi-turn tool calling often requires the previous turn’s reasoning content to be passed back in full. If this content is trimmed or dropped, the request may fail directly, and the quality of subsequent decisions may also decline.

    2.4 Context Management

    In long tasks, historical tool outputs can quickly fill the context window. Compression, summarization, and truncation policies change what information the model actually sees. There are three main risks:

    • Truncation causes tool results to be lost, so the model cannot see key output and must continue from memory.
    • The model cannot see earlier call records and therefore calls the same tool repeatedly.
    • Summaries lose details, leading the model to make incorrect judgments without the system reporting an error.

    A practical recommendation is to retain the original tool results both before and after summarization. Raw records can be stored externally and retrieved when needed. Even when two frameworks use exactly the same tools, different context policies can still produce different results.

    3. Why the Same Model Is Sensitive to the Runtime Environment

    3.1 Consistency Between Training Distribution and Inference Distribution

    The trajectories the model encounters during post-training determine which types of input formats it is most familiar with. If training heavily uses trajectories produced by a certain type of runtime environment, then at inference time the closer the environment is to those trajectories, the easier it is for the model to enter a familiar working mode. When the input distribution deviates from the training distribution, the model may be unable to select appropriate strategies consistently.

    This explanation is inferred from observed phenomena. Public information is insufficient to confirm the exact composition of training data, so this article does not treat it as a settled conclusion. The engineering takeaway is that evaluation results are related to how well the evaluation setup matches the training distribution and should not be viewed simply as an inherent capability of the model.

    3.2 Anchoring Effect of Early Trajectories (Hypothesis to Be Verified)

    One experimental design discussed in the community is worth considering: expose only a small number of tools in the first turn, and after the model completes its first tool call, put the full tool set back into the context. If performance does not decline as the number of tools increases, then what affects behavior may be the shape of the early trajectory rather than the number of tools itself.

    This phenomenon is currently a hypothesis to be verified. As far as I know, publicly available reproduction samples are still limited, and results may not be consistent across different models and task types. When citing it, it should be treated as a direction worth testing, not as a confirmed rule.

    This hypothesis also reminds evaluators to separate variables. Tool count, initial setup, and expansion timing are three independent factors. Testing them together makes conclusions easy to distort.

    3.3 Hard Constraints from Protocol Details

    Some interfaces impose strict protocol requirements on multi-turn tool calling. For example, reasoning content must be passed back in full, and tool-call identifiers must correspond one-to-one with tool results. These requirements are easy to overlook in implementation.

    When protocol requirements are violated, common symptoms include:

    • The request returns an error directly, indicating missing reasoning content or an invalid message format.
    • The ID of a tool result does not match the call record, causing subsequent requests to be rejected.

    Protocol errors are usually all-or-nothing. The model does not gradually become worse; instead, an error suddenly appears in a certain turn. Before troubleshooting, teams should first measure the protocol error rate and record it separately from task scores to avoid mistaking interface problems for model capability problems.

    4. How to Design Reliable Comparative Evaluations

    4.1 How to Control Variables

    The core of evaluation is controlling variables. Differences in the same model across different runtime frameworks are interpretable only when other conditions are fixed. The following table lists variables that should be recorded separately and their corresponding observation metrics:

    Variable Description Observation Metric
    Tool count The set of tools visible in the first turn Task completion rate, average number of tool calls
    System prompt Prompt version identifier Output format compliance rate, number of task-boundary errors
    Expansion timing Whether the tool set expands after the first call Change in completion rate, first-call accuracy
    Context policy Keep, summarize, or truncate Repeated-call rate, number of key-information loss events
    Tool descriptions Version of parameter descriptions and examples Wrong-tool selection rate, parameter error rate

    Each experiment should change only one variable in the table while keeping the others fixed.

    4.2 Runtime Framework Configuration and Experiment Matrix

    It is advisable to define the runtime framework as a configurable object so that the conditions of each experiment can be recorded and reproduced. The following code can run directly, with a placeholder model implementation. When connecting a real model, replace DummyModel and run_agent.

    1. import random
    2. import statistics
    3. from dataclasses import dataclass
    4. from typing import Callable
    5. ALL_TOOLS = ("shell", "read", "write", "search", "http_get")
    6. @dataclass(frozen=True)
    7. class RunProfile:
    8. name: str
    9. exposed_tools: tuple[str, ...] # Tools visible in the first turn
    10. system_prompt_id: str # System prompt version identifier
    11. expand_tools_after_first_call: bool # Whether to expand the tool set after the first tool call
    12. context_policy: str # Context management policy
    13. seed: int = 0 # Base random seed
    14. @dataclass(frozen=True)
    15. class Task:
    16. task_id: str
    17. prompt: str
    18. checker: Callable[[str], bool] # Checks whether the model output is correct
    19. PROFILES = [
    20. RunProfile("minimal", ("shell", "read"), "prompt_v1", False, "keep_all"),
    21. RunProfile("full", ALL_TOOLS, "prompt_v1", False, "keep_all"),
    22. RunProfile("anchored", ("shell", "read"), "prompt_v1", True, "keep_all"),
    23. ]
    24. class DummyModel:
    25. """Placeholder model used only to verify that the script runs."""
    26. def __init__(self, seed: int = 0, success_rate: float = 0.6):
    27. self.rng = random.Random(seed)
    28. self.success_rate = success_rate
    29. def act(self, prompt: str, profile: RunProfile) -> str:
    30. return "ok" if self.rng.random() < self.success_rate else "fail"
    31. def run_agent(model, task: Task, profile: RunProfile) -> str:
    32. # A real implementation should assemble the system prompt and tool schemas here,
    33. # run the agent loop according to profile, and return the final output.
    34. return model.act(task.prompt, profile)
    35. def evaluate(model, tasks: list[Task], profile: RunProfile) -> float:
    36. passed = sum(task.checker(run_agent(model, task, profile)) for task in tasks)
    37. return passed / len(tasks)
    38. def run_suite(model_factory, tasks: list[Task], profiles, repeats: int = 5) -> dict:
    39. results = {}
    40. for profile in profiles:
    41. rates = []
    42. for i in range(repeats):
    43. model = model_factory(seed=profile.seed + i)
    44. rates.append(evaluate(model, tasks, profile))
    45. results[profile.name] = {
    46. "mean": statistics.mean(rates),
    47. "stdev": statistics.stdev(rates) if repeats > 1 else 0.0,
    48. "min": min(rates),
    49. }
    50. return results
    51. if __name__ == "__main__":
    52. tasks = [
    53. Task("t1", "List the files in the current directory", lambda out: out == "ok"),
    54. Task("t2", "Read the first paragraph of README", lambda out: out == "ok"),
    55. Task("t3", "Find files containing TODO", lambda out: out == "ok"),
    56. ]
    57. stats = run_suite(DummyModel, tasks, PROFILES, repeats=5)
    58. for name, s in stats.items():
    59. print(f"{name}: mean={s['mean']:.2f} stdev={s['stdev']:.2f} min={s['min']:.2f}")

    This code has three important points.

    First, each configuration is repeated multiple times, and the mean, standard deviation, and minimum are reported together. Agent task results are affected by sampling randomness, tool-call order, and server-side fluctuations, so a single score may deviate from the true level. Five repeats is an empirical value for roughly estimating the range of fluctuation, not a statistical guarantee. If the standard deviation is close to the gap between two configurations, it is not possible to determine which configuration is better.

    Second, random seeds and sampling parameters must be recorded explicitly. Setting temperature to 0 does not guarantee completely identical output; some servers still have nondeterminism. Tools should be exposed in declaration order, and the seed and parameters actually used at runtime should be written to logs.

    Third, failed samples should be saved with full trajectories. Looking only at pass rates makes it impossible to tell whether a failure occurred in tool selection, parameter filling, or the protocol layer.

    4.3 Metric Definitions

    • Pass rate: number of passed tasks divided by total number of tasks.
    • Mean and standard deviation: calculated from multiple runs of the same configuration, used to determine whether a difference exceeds the range of fluctuation.
    • Minimum: reflects the worst case and is more useful as a reference for production stability.
    • Protocol error rate: the proportion of requests rejected or with invalid formats, which should be recorded separately from pass rate.

    The task set should cover combinations of different difficulty levels and different tools. When sampling, retain all task categories rather than selecting only easy-to-pass tasks.

    4.4 Why Single Scores Are Not Enough

    A single score contains accidental factors. Suppose two configurations score 0.72 and 0.68 in a single run. The former looks better. But if both have a standard deviation of around 0.05, they may well have no practical difference. Only by running multiple times and comparing distributions can teams avoid mistaking luck for capability.

    5. How to Do Regression Testing

    Any change to the model version, system prompt, or tool description should trigger a regression test. The following items are recommended:

    • Fix the RunProfile and include it in version control, leaving a record for every change.
    • Record the system prompt version identifier and the hash of the tool schema.
    • Archive failed samples, saving the complete tool calls, tool returns, and reasoning content.
    • Set regression thresholds. For example, a team might agree to alert when the mean drops by more than 3 percentage points and exceeds the historical standard deviation range. Thresholds need to be determined by the team based on the volatility of its own tasks and should not be copied directly.
    • The protocol error rate should remain at zero or at its historical level. Otherwise, troubleshoot interface problems first.
    • Roll out gradually on a small percentage of tasks or a small amount of traffic before switching fully.
    • Before launch, review the comparison between the old and new profiles to confirm that changes come from the intended variables.

    6. Common Evaluation Mistakes

    • Drawing conclusions after only one run.
    • Changing multiple variables at the same time, making attribution impossible.
    • Using a task set with only simple tasks, resulting in inflated scores.
    • Treating protocol errors as insufficient capability, or treating insufficient capability as a protocol problem.
    • Ignoring context truncation and mistakenly believing that the model forgot information.
    • Failing to record the versions on which evaluation code depends, making reproduction impossible after changing environments.

    7. Conclusion

    The runtime framework can significantly affect agent performance, so model evaluation results must be reported together with the runtime framework. Controlling variables, repeating runs, saving trajectories, and establishing regression tests are basic practices for making evaluation results a credible basis for decisions. Hypotheses that still need verification, such as the anchoring effect of early trajectories, should be tested separately and should not be written directly into model-selection criteria.