fix(coder): restore package exports + CLAUDE.md fail-loudly compliance#823
Conversation
Three review-followups from the #818/#819/#820 merge: - src/gaia/coder/__init__.py: restore the CoderAgent/DEFAULT_LOOP/Loop/State/Transition re-exports that #819 added and the #818 rebase accidentally dropped. test_package_imports in test_skeleton.py relies on these. - src/gaia/coder/tools/cli.py: replace the bare except Exception: pass in the stream-reader teardown with a targeted OSError catch + logger.debug. Per CLAUDE.md's fail-loudly rule, silent swallows hide reader-thread bugs; a stream close failing under pipe tear-down is real and worth a debug line. - src/gaia/coder/tools/search.py: stop reaching into the private _TOOL_REGISTRY dict from grep(). Use get_tool_metadata() — the public accessor added in base/tools.py:113 exists precisely for this. Tests: all 73 (5 skeleton + 38 mixins + 30 stores) pass on coder HEAD with the fixes.
SummaryTight, well-scoped cleanup PR (+27/-8 across 3 files) addressing three bot-review findings from the #818/#819/#820 merge chain. Each change is a targeted fix with a clear rationale tied directly to a CLAUDE.md rule, the diff is easy to verify end-to-end, and the pre-existing test suite already covers the affected paths. The single most important thing to note: all three fixes are correct and the commit messages / inline comments teach the why, which is exactly the pattern the repo prefers. Issues FoundNone blocking. One very minor observation, listed below as 🟢. 🟢 Adjacent Not blocking — reasonable people can disagree on whether a narrow, commented catch needs further annotation. Flagging only for consistency with the fix you just landed three lines below. Strengths
VerdictApprove. Fixes are correct, scope-clean, and directly traceable to CLAUDE.md rules. The 🟢 point on the adjacent |
Summary
Three review-followups from the #818 / #819 / #820 merge, flagged by the auto-review bot. All tests (73/73 on
coder) pass with the fixes.What this changes
Critical —
src/gaia/coder/__init__.py: restore theCoderAgent/DEFAULT_LOOP/Loop/State/Transitionre-exports that feat(coder): package skeleton + loop.py with DEFAULT_LOOP #819 added and feat(coder): File/CLI/Search mixins per §15.2 #818's rebase accidentally dropped. Without this,tests/coder/test_skeleton.py::test_package_importsfails oncoderHEAD.Important —
src/gaia/coder/tools/cli.py:135: replace bareexcept Exception: passin the stream-reader teardown with a targetedOSErrorcatch +logger.debug. CLAUDE.md's No Silent Fallbacks rule explicitly forbids this pattern.Important —
src/gaia/coder/tools/search.py:59: stop reaching into the private_TOOL_REGISTRYfromgrep(). Useget_tool_metadata()— the public accessor atsrc/gaia/agents/base/tools.py:113exists for this.Test plan
pytest tests/coder/ -x— 73/73 pass (5 skeleton + 38 mixins + 30 stores)python -c "from gaia.coder import CoderAgent, DEFAULT_LOOP, Loop, State, Transition"— all imports resolve