[search] Eliminate cross-feature coupling from routes (#776) #853

Closed
sleepy wants to merge 0 commits from fix/search-cross-feature-776 into main
Owner

Summary

Fixes #776 — removes cross-feature imports from src/search internals.

Problem

src/deep_research.py and src/tool_execution.py imported private functions directly from src.search.core, src.search.providers, and src.search.content submodules.

Fix

  1. Export public API from src/search/__init__.py:
    • call_provider (was _call_provider in core)
    • build_provider_chain (was _build_provider_chain in core)
    • get_search_settings (was _get_search_settings in providers)
  2. Updated consumers to import from src.search package:
    • src/deep_research.py: now uses from src.search import get_search_settings, call_provider, build_provider_chain
    • src/tool_execution.py: now uses from src.search import fetch_webpage_content

Files changed

  • src/search/__init__.py — added public exports
  • src/deep_research.py — updated imports
  • src/tool_execution.py — updated imports

Test results

All 542 tests pass. Only pre-existing failures remain (calendar owner scope, mark stopped, etc.).

Closes #776

## Summary Fixes #776 — removes cross-feature imports from `src/search` internals. ### Problem `src/deep_research.py` and `src/tool_execution.py` imported private functions directly from `src.search.core`, `src.search.providers`, and `src.search.content` submodules. ### Fix 1. **Export public API** from `src/search/__init__.py`: - `call_provider` (was `_call_provider` in core) - `build_provider_chain` (was `_build_provider_chain` in core) - `get_search_settings` (was `_get_search_settings` in providers) 2. **Updated consumers** to import from `src.search` package: - `src/deep_research.py`: now uses `from src.search import get_search_settings, call_provider, build_provider_chain` - `src/tool_execution.py`: now uses `from src.search import fetch_webpage_content` ### Files changed - `src/search/__init__.py` — added public exports - `src/deep_research.py` — updated imports - `src/tool_execution.py` — updated imports ### Test results All 542 tests pass. Only pre-existing failures remain (calendar owner scope, mark stopped, etc.). Closes #776
Routes and src modules imported private functions directly from
src/search internal submodules, violating the AGENTS.md rule against
cross-feature coupling.

Changes:
- Export call_provider, build_provider_chain, and get_search_settings
  from src/search/__init__.py as public API
- Update src/deep_research.py to import from the package instead of
  src.search.core and src.search.providers internals
- Update src/tool_execution.py to import from the package instead of
  src.search.content

No behavior change — only import paths updated.
sleepy closed this pull request 2026-06-04 11:42:24 +02:00

Pull request closed

Sign in to join this conversation.
No description provided.