Repository navigation
chore: delete dead and unimportable code, and test that every module imports - #4360
Conversation
…imports Six pieces of code had no caller, and one could not even be imported, yet CLAUDE.md still advertised it as "Shell integration". About 6,700 lines go: - src/gaia/shell/prompt.py: imports modules that never existed, no __init__.py, and prompt_toolkit is not a dependency. - src/gaia/rag/demo.py and rag/app.py (plus the unused rag_main export): they printed and implemented `gaia rag` commands that no CLI entry wires up. - src/gaia/audio/tests/: manual mic scripts that pytest never collects; the audio README now points at the whisper_asr.py streaming check instead. - src/gaia/eval/longthread_quality.py with its test and 220 KB fixture: only its own test used it; thread_fold keeps its dedicated email-agent tests. - hub/agents/email/node/: an orphaned SDK copy pinned to schema 2.2 against the live 2.14. - Agent::resolvePlanParameters in the C++ core: private and never called. tests/unit/test_import_all_modules.py imports every module under src/gaia in a child interpreter. A module may fail only because an optional extra (allowlisted by package name) is missing, so an unimportable file like shell/prompt.py fails CI instead of lingering. Part of amd#4243
Approve with suggestionsThis deletes ~6,700 lines that nothing called and adds a test that imports every module under Nothing blocking. Four small things worth a look: the import sweep also reaches into the OEM staging folder where integrators are told to drop their own agent, so a downstream fork's code gets executed by GAIA's unit test; the setup.py allowlist check matches the extras group name rather than the requirement itself, making it weaker than its error message claims; the sweep's fixed timeout leaves thin headroom on the macOS/Windows lanes you haven't verified (they're non-blocking, so this is a heads-up, not a gate); and two skill docs still advertise the long-thread ground-truth fixture this PR removes. Real-world evidenceN/A — no evidence bundle was produced for this run, and the diff changes no runnable surface: it deletes uncalled code, removes one unreferenced export, and adds a unit test. My verdict rests on static verification, which for a deletion PR is the relevant check. What I confirmed myself: no reference anywhere to 🔍 Technical details🟢 Minor1. Import sweep reaches the OEM agent staging directory (
2. For Checked against the current 3. Sweep timeout headroom on the unverified lanes ( The macOS and Windows smoke jobs run 4. Two skill docs still list the deleted
Notes, not findings
Strengths
|
|
Verified and merging. I re-ran the deletion safety check independently rather than taking the description on trust: merged current Both red checks are stale-base artifacts, not regressions. Two of the earlier review's minor points are still open — worth a follow-up, not a reason to hold this: 🔍 Technical details
|
About 6,700 lines of code had no caller. One file couldn't even be imported, yet CLAUDE.md still listed it as "Shell integration". The dead code kept stale behaviour looking alive, like
rag/demo.pyprintinggaia ragcommands that don't exist, and it cost reviewers time. This PR deletes six of the items from #4243. It also adds a test that imports every module undersrc/gaia, so an unimportable file now fails CI instead of lingering. The test fails on currentmain: it flagsshell/prompt.pyand the three uncollected mic scripts.Left for a maintainer decision:
src/gaia/eval/model_comparison.py: it has no caller, but feat(eval): compare models on one table, and stop pricing cloud runs at zero #3741 merged it yesterday as a library building block, with CLI wiring planned as a follow-up.governance/,talk/app.py(fix(talk): talk demo app ignores flags and its README documents a different app #4333) and the webui AgentManager panel (fix(webui): persist agent settings across desktop app restarts #4330) were excluded.docs/plans/cpp-framework-parity.mdstill calls the C++ plan resolver dead code to resolve. I left it alone because #3812 deletes that file.🔍 Technical details
src/gaia/shell/,rag/demo.py,rag/app.py+rag_mainexport,audio/tests/*.py,eval/longthread_quality.py+ its test and fixture,hub/agents/email/node/,Agent::resolvePlanParameters(+ decl, + now-unused<regex>include).rag_apptests intest_rag_index_status.pywent withrag/app.py. The chat/talk/file-monitor index-status tests stay.thread_foldkeeps its own coverage inhub/agents/email/python/tests/test_thread_fold*.py.mcp,reportlab), not the module. An allowlisted module still fails if it breaks another way, and a second test checks each allowlisted package is an optional extra insetup.py, not a base dependency. Loose.pyfiles outside a package are loaded by path, so broken relative imports fail too..[api]+ the unit job's test deps) flags onlymcpandreportlabtoday, and the sweep takes ~7 s cold. No module does an unguarded platform-only import at top level, so the Windows smoke lane should match. That lane is not verified locally.app.py, notsrc/gaia/rag/app.py.Test plan
pytest tests/unit/test_import_all_modules.py: fails onorigin/main(shell/prompt.py + 3 mic scripts). It also fails with prompt_toolkit installed (broken relative import) and with an__init__.pyadded (gaia.shell.commandsmissing). Passes on this branch in both the full dev venv and a.[api]-only venv.pytest tests/unit/test_rag_index_status.py tests/unit/test_packaging.py tests/unit/test_model_comparison.py tests/unit/email tests/unit/rag tests/test_rag.py: 296 passed, 9 skippedpytest tests/unit(.[api]venv): 14422 passed. The 23 failures (test_cli_smoke,test_uninstall_command,test_lemonade_asr) also fail onorigin/mainin the same env.cmake -S cpp -G Ninja && cmake --buildbuilds clean, andtests_mockpasses 1002/1002Part of #4243