How to Evaluate an Agent's Engineering Reliability in Complex Troubleshooting

    Complex troubleshooting is a stateful decision process, not a sequence of individually cautious answers. This article explains why local correctness can still produce global failure, and how to evaluate agents on goal retention, evidence quality, action cost, recovery, permission boundaries, and verifiable closure. It also outlines an engineering approach using explicit task state, hypothesis ledgers, evidence levels, tool budgets, minimal fixes, and replayable metrics.

    How to Evaluate an Agent’s Engineering Reliability in Complex Troubleshooting

    1. When Every Step Looks Right but the Task Still Fails

    Imagine an agent investigating a leak on an indoor water-supply branch. It first clarifies the wording, then runs a broad search. After detecting higher humidity in one place, it switches to measuring flow speed. When that measurement fails, it suspects external magnetic interference and starts locating the position. When the location result is unstable, it tries to infer the place from ambient sound. The context is then compressed, and the current problem is briefly lost. The user interrupts and asks whether the leak has actually been fixed. Only then does the agent return to the main task. Its final root cause is that water on the supply side overflowed the supply system, and it proposes asking the supplier to stop the water. That request is rejected because the agent lacks permission.

    The irony is that almost every step is phrased carefully. Taken alone, many sentences even sound rigorous. The agent repeatedly says it cannot conclude from the evidence, cannot treat correlation as causation, and cannot widen the conclusion. From the user’s goal, however, the task never converges, cost keeps rising, and the minimum fix and verification that are actually needed never happen. Local correctness is not the same as global effectiveness. That is the point most easily missed when evaluating agents for complex troubleshooting.

    Reliability should not be judged only by whether an agent writes disclaimers, lists possibilities, or sounds like an expert. It should be judged by whether the agent can complete a verifiable loop around the goal inside a constrained environment. More specifically, evaluation needs to cover goal retention, evidence organization, action selection, cost control, recovery from exceptions, permission boundaries, and final verification.


    2. What Makes Complex Troubleshooting Different

    Complex troubleshooting is not simple question answering. It is a stateful decision process, usually with these traits:

    1. The goal is clear, but the path is not. The user wants the leak located and fixed, not an endless explanation of every possible cause.
    2. Evidence is incomplete and noisy. Humidity, flow, location, and sound may all be weak signals and cannot be treated as conclusions by themselves.
    3. Tool calls have a cost. Search, measurement, localization, configuration changes, and command execution consume time, permissions, and system resources.
    4. Safety and permission boundaries exist. Some actions are irreversible, some interfaces require authorization, and some changes require user confirmation.
    5. The task can be interrupted or compressed. User interruptions, context truncation, tool timeouts, and permission failures are common.
    6. The root cause must sit at an actionable level. If the cause is abstracted to “overflow on the supply side” while the system can control only the indoor branch, that is not an executable root cause.

    These traits mean a troubleshooting agent cannot merely “keep analyzing.” It needs a plan, a budget, evidence grading, and stopping conditions.


    3. Six Failures This Behavior Exposes

    1. Goal drift: side clues become the main task

    Early clarification of what “leak” means is reasonable. For example, the agent may need to confirm whether the issue is on the supply side, the drain side, or a joint, whether it is one-time or continuous, and whether it appears as visible water or as a pressure anomaly. Clarification still needs a boundary and must stay tied to the real goal.

    Once the agent moves from humidity detection to flow measurement, then to magnetic interference, then to localization, and finally to ambient sound, it has replaced “find the leak” with “explain every abnormal signal.” Those signals may carry information, but their information gain and cost are not equal. Without ranking them by diagnostic value per unit of cost, goal drift follows.

    2. Ungraded evidence: observations, clues, causation, and verification are mixed together

    “Humidity is high somewhere” is only an observation. “Water droplets keep appearing in the same place” may be a reproducible clue. “The seepage stops after a branch is closed” is closer to causal evidence. “No further seepage is observed after the repair” is verification evidence.

    The agent uses many cautious phrases such as “this cannot be concluded,” but it never layers the evidence or updates the ranking of hypotheses. To avoid a wrong judgment, it keeps collecting weaker signals and never runs the key experiment that would distinguish the main hypotheses.

    3. No tool budget: calls have no ceiling and search does not converge

    Complex troubleshooting needs an explicit budget, such as a maximum number of tool calls, a maximum elapsed time, a maximum change scope, a maximum retry count, and a risk level for each step. Without a budget, the agent easily falls into a loop of “measure one more metric” and “check one more direction.”

    Worse, after a tool fails, it does not distinguish “tool unavailable,” “target does not exist,” “permission denied,” and “hypothesis is false.” A failed measurement may come from environmental interference or from a faulty instrument. Without a baseline test, opening a new physical hypothesis too quickly makes cost expand fast.

    4. Context compression destroys task state

    Context compression is meant to reduce the cost of a long conversation. If it compresses only the chat log and does not preserve the immutable goal, constraints, evidence, hypotheses, decisions, and budget, the agent loses the state that explains why the current step is being taken.

    When the compressed agent continues an edge subproblem, it has saved “what was discussed recently,” not “the current task control plane.” This is a typical failure in long-running work: the summary remains, but the goal is gone; fragments remain, but the basis for decisions is gone.

    5. The root-cause level is not actionable

    “Water on the supply side overflowed outside the supply system” sounds like a root cause, but it may lie outside the current system’s control boundary. An actionable root cause should meet at least three conditions:

    • It is inside the current permission and responsibility boundary, or it can be clearly escalated to a party that has permission.
    • A minimal change or an alternative can reduce the impact.
    • After the fix, there is an observable and verifiable criterion.

    If the supplier cannot be controlled, the agent should propose local isolation, temporary blocking, flow limiting, monitoring, rollback, or an authorization request, rather than treating “make the upstream supplier stop the water” as the only repair path.

    6. A user interruption is not raised to the highest priority

    The user’s question, “Has the leak been fixed?”, is itself a strong signal: the marginal value of the current exploration may already be lower than the cost of continuing to drift. A reliable agent should immediately do three things:

    1. Acknowledge the current drift.
    2. Realign with the user’s goal.
    3. State the best current evidence, the remaining steps, and the expected cost.

    Merely saying “I will reconfirm the root cause” is still not enough. It does not tell the user what is already known, whether the next step is necessary, or how soon a verifiable result can be produced.


    4. Seven Dimensions Beyond “It Sounds Careful”

    1. Goal alignment

    Was the user goal recorded completely? Can it be restored after every interruption, compression, and tool failure? Does the final output answer the original goal directly, rather than only a subquestion that appeared along the way?

    2. Evidence quality

    Does the conclusion mark the evidence level? Does it separate observation, correlation, causation, and verification? Does the agent actively look for tests that can falsify the main hypothesis?

    3. Action efficiency

    How many tool calls, how much time, how much cost, and how many steps are required for the same diagnosis? Are there repeated searches, irrelevant expansions, or retries that change nothing after a failure?

    4. Convergence

    Can the agent stop exploring once the information is sufficient? When information is still insufficient but the budget is exhausted, can it escalate with a confidence level? Does it detect lack of progress?

    5. Recoverability

    After a tool failure, context truncation, insufficient permission, or user interruption, does it keep the task state and revise the plan, instead of continuing along the old trajectory?

    6. Safety and permission boundaries

    Before high-risk actions such as modification, stopping a service, deletion, restart, or an out-of-scope query, does it ask for confirmation? Does it prefer read-only, reversible, minimum-impact operations?

    7. Verification loop

    Is there a defined way to verify the repair? Are the success criteria, observation window, rollback conditions, and follow-up monitoring stated?


    5. An Engineering Improvement Plan

    1. Replace “memory in the chat context” with explicit task state

    The goal, scope, constraints, budget, evidence, hypotheses, and decisions should live in an independent structured state. The chat context is only raw material. A simplified state object looks like this:

    1. state = {
    2. objective: "Locate and minimally repair the leak on the indoor water-supply branch",
    3. scope: ["indoor branch", "operable valves", "do not modify upstream facilities"],
    4. constraints: ["do not interrupt the user's normal water use", "do not perform destructive actions without confirmation"],
    5. budget: {tool_calls: 8, elapsed_minutes: 45, max_retries: 2},
    6. evidence: [
    7. {level: "E0", content: "Humidity increase detected at a location", reproducible: false},
    8. {level: "E1", content: "Seepage rate decreased after branch A was closed", reproducible: true}
    9. ],
    10. hypotheses: [],
    11. decisions: [],
    12. no_progress_steps: 0
    13. }

    The key point is this: logs may be compressed, but the goal, constraints, and decision record must not be compressed away.

    2. Keep a hypothesis ledger instead of opening new topics indefinitely

    Each hypothesis should at least include a description, current evidence, expected information gain, test cost, risk, falsification condition, and status. Rank hypotheses by information gain divided by cost, not by whichever clue appeared most recently.

    1. hypothesis = {
    2. name: "Aging joint on the branch is causing seepage",
    3. support: ["Humidity near the joint keeps rising", "Seepage decreased after the branch was closed"],
    4. against: [],
    5. test: "Hold low pressure for 10 minutes and inspect the joint",
    6. expected_value: "high",
    7. cost: "low",
    8. risk: "read_only",
    9. status: "active"
    10. }

    If one hypothesis needs many peripheral measurements while another needs only one low-cost isolation test, choose the latter first. Rigor is not the same as expense. Good rigor is usually strong evidence at low cost.

    3. Define evidence levels and decision thresholds

    A practical grading scheme is:

    • E0, raw observation: humidity, logs, alerts, and user descriptions;
    • E1, reproducible signal: the same condition produces the signal more than once;
    • E2, strong association or intervention evidence: the phenomenon moves when a controlled variable is changed;
    • E3, repair verification: after the change, continued observation meets the success criteria.

    Decision thresholds should be bound to risk. A low-risk local repair may proceed after E2. A high-risk or irreversible action must receive human confirmation before it can be treated as verified at E3. This avoids both “a clue is enough for a conclusion” and “never act.”

    4. Give tool calls a budget, a hierarchy, and a no-progress check

    At a minimum, use these controls:

    • A maximum number of tool calls and a maximum elapsed time for one task;
    • A retry limit, with every retry required to change the strategy or parameters;
    • A rollback, hypothesis change, or human request when evidence is not updated for several consecutive steps;
    • A preference for read-only operations; write operations must be minimal, reversible, and recorded;
    • Explicit authorization and a pre-action check for high-risk operations.

    The control flow can be expressed as:

    1. for step in 1..max_steps:
    2. if objective_verified(state): close(state); break
    3. if budget_exhausted(state): escalate_with_evidence(state); break
    4. candidates = enumerate_next_tests(state)
    5. action = choose_action(
    6. candidates,
    7. maximize = expected_information_gain,
    8. minimize = cost + risk_penalty
    9. )
    10. result = run_tool_safely(action)
    11. state = update_evidence(state, result)
    12. if no_progress(state, last_k_steps):
    13. ask_user_or_change_scope(state)
    14. if user_interrupt_received(state):
    15. state.objective = user_top_priority

    5. Close the loop with a minimal fix plus verification

    Repair is part of the task, not an appendix to diagnosis. A minimal fix should:

    • Change only the smallest scope related to the root cause;
    • Have a rollback plan;
    • Have an observable success criterion;
    • Have an explicit observation window;
    • Record the escalation path if it fails.

    In the leak scenario, the agent can first isolate the controlled branch and record pressure and seepage changes, then decide whether to replace the joint. If permission is insufficient, it should output a plan such as “local isolation can be done now; stopping upstream water requires authorization,” rather than stalling because the other party refused to stop the water.

    6. Report to humans progressively, not only at the end

    The agent should report proactively when budget consumption crosses a threshold, when several steps make no progress, before a medium- or high-risk action, before and after context compression, and when the user goal may have changed. A report should contain four items:

    1. The current goal;
    2. Evidence already verified;
    3. The largest remaining uncertainty;
    4. The next plan and its expected cost.

    That has more engineering value than repeatedly saying “this cannot be concluded.”


    6. How to Quantify Evaluation: A Suggested Metric Set

    Evaluation should be based on structured logs and replayable scenarios, not only on whether the final answer “sounds like an expert.” Useful metrics include:

    • Task success: first-attempt completion, completion after human intervention, and completion after escalation;
    • Root-cause accuracy: whether the cause lands at an actionable level rather than a generic explanation;
    • Cost: average tool calls, elapsed time, context consumption, and retry rate, with both the median and high percentiles;
    • Convergence: steps to the first actionable conclusion, share of no-progress steps, and repeated-action rate;
    • Recovery: goal retention after tool failure, insufficient permission, context compression, and user interruption;
    • Safety: out-of-scope actions, unconfirmed high-risk actions, and rollback success rate;
    • Verification: post-repair verification coverage, regression failure rate, and recurrence rate;
    • Collaboration: number of human corrections, user wait time, and a score for how explainable the conclusion is.

    The scenario set should deliberately include distractors and traps, such as weakly related alerts, tool timeouts, insufficient permissions, a mid-task change of user goal, context compression, and competition among similar hypotheses. Replay the same scenarios across versions, and compare the total cost and reliability of completing the task, not the length of the answer.


    7. Revisiting the Troubleshooting Trace: What Was Sound and What Must Change

    Behavior Locally reasonable? Global problem Improvement
    Clarify what “leak” means first Reasonable Clarification lasts too long and is not tied to acceptance criteria First fix the scope, operable boundary, and success criteria
    Do not infer “there is no pipe” from one failed search Reasonable No timeout, alternative search, or failure classification Record the tool-failure type and switch to a directed check
    Treat high humidity only as a direction Reasonable Later tests are not ranked by information gain Replace peripheral diagnosis with a low-cost isolation test
    Flow does not equal a leak Reasonable No leak criterion is defined, so doubt can continue indefinitely Define thresholds, an observation window, and criteria
    A failed speed measurement leads to external interference Expanded too early A low-base-rate hypothesis consumes a large budget First use a baseline test to rule out the tool itself
    Keep analyzing location after localization fails Drifts from the goal An infrastructure problem is pulled into the main task Mark it as a side issue and do not block the main task
    Continue an edge issue after context compression Not reasonable Task state is lost Store the goal, decisions, and budget independently
    Return to the root cause after the user interrupts Partly reasonable Progress and plan are not reported immediately First state the current situation, evidence, and next step
    Attribute the cause to upstream supply overflow Explanation is too coarse Outside the controllable boundary Output a controllable fix, an authorization request, and temporary mitigation
    Stop because permission is insufficient Reasonable for safety No alternative is offered Escalate the request and apply the minimum local mitigation

    8. A Practical Rollout Path

    First, do not rush to make the agent “think longer.” Add observability: record the goal, tool calls, evidence, hypotheses, decisions, and budget consumption so the run can be replayed afterward.

    Second, add hard constraints: a maximum tool-call count, a maximum elapsed time, no-progress detection, permission gates, and rollback. Without these constraints, a longer reasoning chain only amplifies cost.

    Third, build a scenario evaluation set. Turn real failures, distracting alerts, tool failures, insufficient permissions, and context compression into replay cases, and compare success rates and cost percentiles on a regular schedule.

    Fourth, improve the policy: choose tests by information gain over cost, decide whether human confirmation is required by risk, decide whether a repair is allowed by evidence level, and decide whether the loop is closed by the verification result.


    9. Conclusion

    A reliable agent for complex troubleshooting should not look like “every sentence leaves room for doubt.” It should look like this: the goal stays online, evidence gets stronger step by step, action cost stays controlled, the conclusion can be carried out, and the repair can be verified.

    Excessive caution is not automatically rigor. If caution does not become better test selection, clearer evidence grading, and a faster actionable loop, it becomes a linguistic safety pose that hides uncontrolled planning and missing engineering constraints. The desired behavior is the same as that of an experienced technician: define the problem and its boundaries, choose low-cost checks with high discriminating power, record the evidence, escalate permissions when necessary, apply the minimal fix, and use an observable result to prove that the problem is actually closed.

    In the end, the point of evaluating an agent is not how well it can explain uncertainty. It is whether, under real constraints, it can turn uncertainty into a verifiable action.