Skip to content

install reports success (exit 0) on failed index build; swallows cocoindex exception #351

Description

@HumanBean17

Summary

java-codebase-rag install returns exit 0 and reports success even when the indexing step (cocoindex/graph build) fails. The cocoindex exception is swallowed instead of propagated, and no progress footer is rendered to stderr. Two installer tests are currently red on master because of this.

Evidence (confirmed)

  • tests/test_installer.py::TestPR4IndexProgress::test_install_emits_indexing_progress_on_stderr fails — install emits empty stderr (no [vectors] progress line).
  • tests/test_installer.py::TestPR4IndexProgress::test_install_indexing_exception_renders_failed_footer fails — pytest.raises(RuntimeError, match="boom from cocoindex")DID NOT RAISE. The test monkeypatches pipeline.run_cocoindex_update to raise, runs run_install, and expects propagation; it does not propagate.
  • Root cause: java_codebase_rag/installer.py:1566-1575run_install calls run_init_if_needed(...) but discards its return value and unconditionally return 0. run_init_if_needed returns False on cocoindex/graph failure (installer.py:915-936).
  • installer.py:1528-1543 — partial-failure classifier only treats MCP .json deploy failures as critical; skill/agent deploy failures are downgraded, and the YAML is written + init runs regardless.
  • Full suite (serial run): 848 passed, 14 skipped, 2 failed. (Note: pytest must be run serially here — -n auto produces unrelated false errors in test_java_codebase_rag_cli.py.)

Impact

In CI/automation a broken or empty index reports a successful install; operators believe it succeeded. Idempotent re-runs can mask it (run_init_if_needed may then skip). The most important install step fails silently.

Suggested fix

Capture init_ok = run_init_if_needed(...) and return 0 if init_ok else 1; let the cocoindex exception propagate (or render the failure footer) so the test contract holds. Treat skill/agent deploy failures as critical for the affected host. Likely introduced by the PR-4 index-progress work (commits #326 / #330).

Repro

.venv/bin/python -m pytest "tests/test_installer.py::TestPR4IndexProgress" -v (serial).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions