Skip to content

fix: don't flag codex/hermes runs as empty_run on unparseable token stats#13

Open
Wanli-Lee wants to merge 1 commit into
mainfrom
fix/empty-run-false-positive
Open

fix: don't flag codex/hermes runs as empty_run on unparseable token stats#13
Wanli-Lee wants to merge 1 commit into
mainfrom
fix/empty-run-false-positive

Conversation

@Wanli-Lee

Copy link
Copy Markdown
Contributor

Summary

_classify_agent_status (added in #10) labeled a run empty_run whenever aggregate_chat_jsonl reported n_calls=0 / output=0. But that aggregator only understands openclaw's message.usage records — on codex/hermes (different chat.jsonl schema) it returns zero counts even for a full multi-MB transcript. This mislabeled real, high-scoring codex runs as empty_run.

Concrete false positive: a codex task that scored 0.984 had chat.jsonl of 4.9 MB but n_calls=0, so it was tagged agent_empty_run: clean exit but no model output. ~80/92 codex tasks in a live run were affected.

Fix

Guard the empty_run verdict with the chat.jsonl file size: a transcript ≥ NONEMPTY_CHAT_BYTES (4 KB) proves the agent ran, so we never call it empty on the strength of an uncountable token stat alone. Genuine empty/failed runs leave a tiny or absent chat.jsonl and are still caught.

Scores were never affected — only the agent_status / error labels. This just stops the labels from being noise on codex/hermes.

Test plan

  • pytest tests/ — 73 passed (added test_classify_not_empty_when_chat_is_large regression; existing empty_run tests now pass explicit chat_bytes)
  • End-to-end check against the real misclassified codex chat.jsonl (4.9 MB, n_calls=0) → now classifies as ok, not empty_run

🤖 Generated with Claude Code

…tats

_classify_agent_status called a run "empty_run" whenever aggregate_chat_jsonl
reported n_calls=0 / output=0. But aggregate_chat_jsonl only understands
openclaw's message.usage records — on codex/hermes (different chat.jsonl
schema) it returns zero counts even for a full multi-MB transcript. This
mislabeled real, high-scoring codex runs (e.g. a task that scored 0.984) as
empty_run, polluting the agent_status / error fields with false positives.

Guard the empty_run verdict with the chat.jsonl size: a transcript at or above
NONEMPTY_CHAT_BYTES (4 KB) proves the agent ran, so we never call it empty on
the strength of an uncountable token stat alone. Genuine empty/failed runs
leave a tiny or absent chat.jsonl and are still caught.

Only the agent_status / error labels were affected — scores were never touched.

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant