Skip to content

[BUG]: Agent-transcript text scan overrides the exception-type filter, misreporting verifier failures as agent runtime failures #82

Closed

Description

@jifeij

What happened?

Summary

_agent_runtime_failure_reason() returns the result of a whole-transcript text scan before it reaches the check that decides whether the trial's exception is actually an agent-runtime exception. Once a trial records any exception, the agent's own response text is searched for "Unauthorized", "401", "404 Not Found", "model not found", "NotFoundError", … and the first match anywhere in it is returned as the failure reason.

A skill whose subject matter is authentication, HTTP error handling, or SDK usage will make the agent write those words as part of a correct answer. The trial is then dropped with Missing scored attempts for cases: … and the run is marked invalid.

Where

skillevaluator/tier3/harbor/collector.py

exception_type, exception_reason = _trial_exception_details(trial_dir)
agent_reason = _agent_log_runtime_failure_reason(
    trial_dir, include_text_logs=bool(exception_reason)
)
if agent_reason:
    return agent_reason          # <-- returns here

if exception_type in _UNCONDITIONAL_AGENT_RUNTIME_EXCEPTION_TYPES:
    return exception_reason

# Do not classify verifier/healthcheck/task exceptions as agent runtime failures.
if (exception_type in _AGENT_RUNTIME_EXCEPTION_TYPES and ...):
    return exception_reason

The early return means a verifier or task exception is promoted to an agent runtime failure whenever the transcript happens to contain a pattern — which is exactly what the comment three lines below says must not happen.

include_text_logs is bool(exception_reason), and the scan it enables is unguarded:

if include_text_logs:
    reason = _text_contains_agent_runtime_failure(text)   # whole transcript

The two neighbouring paths are guarded and look like the intended design: _trajectory_agent_runtime_failure_reason() requires tokenless, and the JSON-line branch in the same function only matches lines whose type == "error". Only the whole-transcript fallback matches free text.

Why this is worse than a wrong label

The bias has a direction. The with-skill arm produces the more detailed, more domain-specific answer, so it is systematically more likely to mention Unauthorized, 404 Not Found, or an SDK's exception class names. The scan therefore drops with-skill trials preferentially and pushes measured Skill Lift downward — the one direction a paired-evaluation harness must not bias.

Reproduction steps

Two independent cases, both ordinary correct agent behaviour, on a 4-case skill with --n-attempts 1:

  1. A skill documenting credential setup. Asked to walk through secret -> create provider -> verify -> delete, the agent explains that a failing verify returns Unauthorized and that the token is likely malformed. Reported as:

    Agent runtime failed in <trial>: Unauthorized` , `599 Endpoint unreachable`).
    Fix the secret or endpoint and re-run the verify step.
    ...
    Missing scored attempts for cases: <case>; Scored attempt coverage is 11/12
    

    The quoted text is the agent's own Markdown troubleshooting table, truncated at 600 characters — not an API response.

  2. A skill working with a Python SDK. The agent enumerates the module's symbols. Reported as:

    Agent runtime failed in <trial>: AuthenticationError'
     'BadRequestError'
     'BaseModel'
     'Client'
     'ConflictError'
     'DEFAULT_CONNECTION_LIMITS'
     ...
    

    AuthenticationError is a class name in the listing, matched by the
    NotFoundError-style entries in _AGENT_RUNTIME_FAILURE_PATTERNS.

In a sweep of 56 skills, 1 of 12 failures was case 2 and a separate local run reproduced case 1 three times out of three.

SkillEvaluator version or commit

009aa30

Environment

  • --env-mode local, agent claude-code
  • SKILL_EVAL_LLM_PROVIDER=anthropic against an Anthropic-compatible proxy
  • Grader and agent both claude-opus-class models

Before submitting

Activity

  1. added
    bug
    on Aug 26, 2026
  2. rioyu123 commented on Aug 26, 2026

    @rioyu123
    Contributor

    I reproduced this on current main. I’m working on a focused fix that keeps structured agent-error evidence and tokenless trajectory detection intact, but only enables the unstructured whole-transcript fallback for exception types that are actually classified as agent-runtime failures. I’ll add regression coverage for a verifier exception whose otherwise-correct agent transcript mentions an authentication error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions