[BUG] Doesn't understand the basic of data processing. Anything successfully processed should be backedup and not overwritten specially when you are spending days and days on it as it consumes lot of compute/money and time.
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Doesn't understand the basic of data processing. Anything successfully processed should be backedup and not overwritten specially when you are spending days and days on it as it consumes lot of compute/money and time. This is basic and stand practice. not sure how it is missing this basic.
What Should Happen?
Always backup successfully processed data and process the remaining one unless explicitly asked to process from scratch due to some requirement change.
Error Messages/Logs
This is bad — only 2 cases intact. The generate_one() step wiped
the time directories when it regenerated all 80 cases. Let me
check if generate_case() deletes and recreates the case
directory:
Searched for 1 pattern (ctrl+o to expand)
⏺ Found it — shutil.rmtree(out) on line 854. Every time
generate_case() runs for an existing directory, it deletes
everything including the solver output. That wiped 77 cases.This is bad — only 2 cases intact. The generate_one() step wiped
the time directories when it regenerated all 80 cases. Let me
check if generate_case() deletes and recreates the case
directory:
Searched for 1 pattern (ctrl+o to expand)
⏺ Found it — shutil.rmtree(out) on line 854. Every time
generate_case() runs for an existing directory, it deletes
everything including the solver output. That wiped 77 cases.
Steps to Reproduce
Steps to reproduce:
- Run a long parametric sweep that generates and solves 80
OpenFOAM cases (took ~8 hours)
- One case times out. Sweep reports: completed: 79, timeout: 1
- Assistant suggests re-running python3 openfoam/param_sweep.py
--out_dir openfoam/cases --n_parallel 1 to retry the 1 failed
case
- param_sweep.py calls generate_one() for ALL 80 cases before
running Docker
- generate_one() calls generate_case() which contains
shutil.rmtree(out) — unconditionally deletes the entire case
directory including all solved time directories (0.02/, 0.04/,
..., 0.24/)
- All 79 completed cases lose their OpenFOAM solver output
- Only the 2 cases that Docker re-ran in the new session
survive
Root causes (two separate failures):
- Code bug: generate_case() called shutil.rmtree(out) without
checking if solved output existed — should have been guarded
from day one
- Assistant error: Suggested re-running the full sweep script
instead of the direct Docker command for just case_0003, without
auditing generate_case() for destructive operations first
Expected behavior: Assistant should have given:
docker run --rm -v "/path/to/case_0003:/case"
opencfd/openfoam-default:latest bash -c "cd /case && bash
run.sh"
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
Claude Sonnet 4.6 (model ID: claude-sonnet-4-6)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗