[Bounty]: Fix bash 3.2 empty-field collapse in quickstart.sh catalog loader and reader
Bounty Size
Medium (30 pts)
Difficulty
Medium
Description
quickstart.sh parses tab-separated rows emitted by a Python helper. Two sites use the bash pattern IFS=$' ' read -r a b c …. On bash 3.2 (macOS system bash) this pattern collapses empty middle fields and shifts subsequent values left. The ollama_local preset has empty model and api_key_env_var columns, so the corrupted row causes apply_preset to write SELECTED_MAX_TOKENS="http://localhost:11434". The config writer's int(...) cast then crashes with ValueError.
The bug crosses the bash boundary twice: catalog → PRESET_ROWS (loader, load_model_catalog_rows) and PRESET_ROWS → named variables (reader, get_preset_field). Both sites must be fixed in the same PR; fixing only one re-introduces the corruption on every read.
Why this has been latent?
- macOS-only on the default shell; maintainers running Homebrew bash 5.x see no failure.
- Only
ollama_localandollama_cloudhave empty optional fields; every other preset populates all seven columns. - No test runs the bash layer end-to-end; the Python
model_catalogunit tests pass because they exercise the data, not its consumer.
Acceptance Criteria
-
load_model_catalog_rowsno longer collapses empty fields on bash 3.2 -
get_preset_fieldno longer collapses empty fields on bash 3.2 - Regression test added to a new
tests/test_quickstart_parsing.sh -
tests/test_quickstart_parsing.shruns onmacos-latest(bash 3.2) in CI - All existing providers still work end-to-end (anthropic, openai, ollama_local, ollama_cloud, etc.)
- No regression in
core/framework/llm/Python unit tests - One PR, two sites, one test file
Relevant Files
quickstart.sh— loader (load_model_catalog_rows) and reader (get_preset_field)core/framework/llm/model_catalog.py— Python helper that emits TSVmodel_catalog.json— catalog source (ollama_localandollama_cloudshapes)tests/test_quickstart_parsing.sh— new regression test
Resources
- #5154 — prior macOS quickstart crash report
- #7073 — prior TSV parsing discussion
- additional-issue-context-for-reviewers.md
Source: aden-hive/hive