Skip to content

fix(batch_runner, hardware_check): guard split() indexing against malformed input#23018

Closed
KhanCold wants to merge 2 commits into
NousResearch:mainfrom
KhanCold:fix/batch-hardware-guard
Closed

fix(batch_runner, hardware_check): guard split() indexing against malformed input#23018
KhanCold wants to merge 2 commits into
NousResearch:mainfrom
KhanCold:fix/batch-hardware-guard

Conversation

@KhanCold

Copy link
Copy Markdown

Summary

Prevents IndexError when split() results have fewer elements than expected.

Changes

  • batch_runner.py: guard batch_file.stem.split('')[1] when filename lacks ''
  • hardware_check.py: guard line.split()[1] when /proc/meminfo line is malformed

Test Plan

python3 -m unittest tests.test_batch_runner_split_guard tests.test_hardware_check_meminfo_guard -v
# 2 passed

@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent loop, run_agent.py, prompt builder P3 Low — cosmetic, nice to have labels May 10, 2026
…formed input

- batch_runner.py: guard batch_file.stem.split('_')[1] when filename lacks '_'
- hardware_check.py: guard line.split()[1] when /proc/meminfo line is malformed

Both prevent IndexError on unexpected input shapes.
@KhanCold KhanCold force-pushed the fix/batch-hardware-guard branch from d378987 to 044f3d6 Compare May 10, 2026 12:07
…formed input

- batch_runner.py: guard batch_file.stem.split('_')[1] when filename lacks '_'
- hardware_check.py: guard line.split()[1] when /proc/meminfo line is malformed

Both prevent IndexError on unexpected input shapes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants