Skip to content

fleet: don't count live running sessions as kept crashes#194

Merged
devdanzin merged 1 commit into
mainfrom
fleet-crash-count-exclude-live-sessions
Jul 7, 2026
Merged

fleet: don't count live running sessions as kept crashes#194
devdanzin merged 1 commit into
mainfrom
fleet-crash-count-exclude-live-sessions

Conversation

@devdanzin

Copy link
Copy Markdown
Owner

Problem

fleet status / fleet report reported "6 crashes kept" on the new h5py fleet even though zero sessions had crashed (every session scored 0.0%). The 6 were the live, in-flight sessions.

Root cause

Both crash-dir enumerators count any directory that holds a source.py:

  • shell list_crashes (used by fleet status / fleet finds)
  • Python iter_crash_dirs (used by fleet report)

A currently-running session dir also holds a source.py — it's written at session start, before fusil decides to keep it as a crash (renaming to <module>-<kind>-<label>) or rmtree it. On a fast run with few/no real crashes, the ~1 in-flight session per instance is the whole count (h5py sessions run ~0.6s, so 2,1,1,1,1 = 6; inst-01 showed 2 mid-restart).

Fix

A kept crash dir is always renamed — only live/un-kept sessions keep the bare session-<N> name. Exclude session-<N> from both enumerators:

  • fleet/fleet list_crashes: | grep -vE '/session-[0-9]+$'
  • fusil/python/fleet_report.py iter_crash_dirs: skip ^session-\d+$

Plus a test_live_session_dirs_not_counted_as_crashes regression test.

Verified live: both fleet status and fleet_report now report 0 crashes / 0 oomNEW on the clean h5py fleet. Touches only the read-only query commands, so a running fleet is unaffected. test_fleet_report green (12 tests); ruff check/ruff format --check clean.

🤖 Generated with Claude Code

`fleet status`/`fleet report` reported N "crashes kept" on a run that had
actually crashed 0 times. Both crash-dir enumerators -- the shell
`list_crashes` and the Python `iter_crash_dirs` -- count any directory that
holds a `source.py`. But a *currently-running* session dir also holds a
`source.py` (it's written at session start, before the session is either
kept-as-a-crash or `rmtree`'d), so the ~1 in-flight session per instance was
miscounted as a kept crash. On a fast run with few or no real crashes this is
the entire reported count (e.g. an h5py fleet churning clean sessions at
~0.6s each reported "6 crashes kept" = the 6 live sessions).

A kept crash dir is always *renamed* by `session_rename` to
`<module>-<kind>-<label>`; only live/un-kept sessions keep the `session-<N>`
name. So exclude `session-<N>` dirs from both enumerators. Add a regression
test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@devdanzin devdanzin merged commit 8246677 into main Jul 7, 2026
2 checks passed
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