Files
hermes-agent/agent
kshitijk4poor 52cf39c908 refactor(auth): reuse _CLEAR_STATUS and the merge's None short-circuit in the reset path
Behaviour-preserving cleanup of the salvaged fix:

- reset_statuses goes back to replace(e, **_CLEAR_STATUS, ...) instead of
  re-spelling the six status fields; every other clear site uses the
  constant, so a seventh field would otherwise drift here. The
  count/new_entries/cleared_ids trio collapses to the original stale-list
  shape, and entry.failure_reason is read through the dataclass's
  __getattr__ like the rest of the module.
- Both bypass sites (write_credential_pool, _update_root_pool_rows) pass
  disk_entry=None to _merge_disk_cooldown_state for a cleared id instead of
  adding a parallel branch; the helper already returns the entry unchanged
  for a missing disk row.
- The cleared-id set in _update_root_pool_rows is built once, not per disk
  row (an Iterable argument would also have been drained on the first row).
- persist_pool_entries passes status_cleared_ids plainly; the kwargs splat
  existed only for one test fake, which now accepts the kwarg.
- Docstrings trimmed to the WHY.

Same 116 targeted tests green; reverting the two source files to main still
fails the two regression tests and passes the guard test.
2026-09-05 17:43:45 +05:30
..