## TL;DR
Take the epoch from the training log or not at all: the agent reported an early stopping epoch that appears in no log, so extract the stop epoch from the recorded metric history, and where the history is absent, report the stop as unrecorded. Early stopping leaves a precise trace: the last logged epoch and the best epoch in the metric history. An epoch that matches neither is an invention, however reasonable it sounds.

```text
agent hallucinating early stopping epoch not in logs caused report failure error
```

## Use this when
- The check or run fails with this symptom: an agent hallucinates an early stopping epoch not in the logs and the report fails.
- You are working on an agent workflow reporting training outcomes including early stopping behaviour and the failure repeats on the same data or configuration.
- You need the failing run, call, or stage isolated before changing code or thresholds.

## Not for this skill when
- A run whose logs were rotated away, where the epoch is honestly unrecoverable and must be reported as such.
- The error text names a different tool, stage, or root cause. Match the verbatim error first and use that skill.

## Steps
1. Read the run metric history and note the last epoch and the best scoring epoch. Verify: the two candidate epochs are established from data
2. Compare the agent reported epoch with both. Verify: the reported value matches neither, confirming the invention
3. Correct the report with the logged best epoch and the stop epoch, labelled distinctly. Verify: the report now cites log derived values
4. Change the workflow so epoch fields are extracted by code from the history. Verify: reported epochs always come from records
5. Where a run has no history, output unrecorded for the epoch. Verify: the gap is explicit in the report

## Variant phrasings
### agent hallucinating early stopping epoch not in logs report
The shorter phrasing focused on the named failure.
### invented early stopping epoch agent error
The symptom phrasing a searcher tries next.
### early stopping epoch from metric history fix
The variant naming the failing stage or tool directly.

Compatibility: Training metric histories in experiment trackers, agent reporting workflows

## Why it happens
Early stopping epochs feel inferable from patience settings and run length, and an agent asked for the number will produce the plausible one. Patience counts from the best epoch, restores and logging gaps shift the arithmetic, so the inferred number is routinely wrong in a way readers cannot detect without the history.

## Edge cases / pitfalls
- Best epoch and stop epoch are different numbers; reports that use one word for both create this error even with honest data.
- A run that hit a step limit did not early stop, whatever its curve looks like; check the termination reason.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_t6ehMEthTFx_9tBLhfIzew
