#7339·hive

[Bounty]: Fix bash 3.2 empty-field collapse in quickstart.sh catalog loader and reader

Author: AndlerRLCreated Jul 30, 2026Updated Sep 9, 2026

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?

  1. macOS-only on the default shell; maintainers running Homebrew bash 5.x see no failure.
  2. Only ollama_local and ollama_cloud have empty optional fields; every other preset populates all seven columns.
  3. No test runs the bash layer end-to-end; the Python model_catalog unit tests pass because they exercise the data, not its consumer.

Acceptance Criteria

  • load_model_catalog_rows no longer collapses empty fields on bash 3.2
  • get_preset_field no longer collapses empty fields on bash 3.2
  • Regression test added to a new tests/test_quickstart_parsing.sh
  • tests/test_quickstart_parsing.sh runs on macos-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 TSV
  • model_catalog.json — catalog source (ollama_local and ollama_cloud shapes)
  • tests/test_quickstart_parsing.sh — new regression test

Resources