fleet: don't count live running sessions as kept crashes#194
Merged
Conversation
`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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
fleet status/fleet reportreported "6 crashes kept" on the new h5py fleet even though zero sessions had crashed (every session scored0.0%). The 6 were the live, in-flight sessions.Root cause
Both crash-dir enumerators count any directory that holds a
source.py:list_crashes(used byfleet status/fleet finds)iter_crash_dirs(used byfleet 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>) orrmtreeit. 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, so2,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. Excludesession-<N>from both enumerators:fleet/fleetlist_crashes:| grep -vE '/session-[0-9]+$'fusil/python/fleet_report.pyiter_crash_dirs: skip^session-\d+$Plus a
test_live_session_dirs_not_counted_as_crashesregression test.Verified live: both
fleet statusandfleet_reportnow report0 crashes / 0 oomNEWon the clean h5py fleet. Touches only the read-only query commands, so a running fleet is unaffected.test_fleet_reportgreen (12 tests);ruff check/ruff format --checkclean.🤖 Generated with Claude Code