What changed
Root cause fixed: import synapse_forge resolved to the package directory (synapse_forge/__init__.py) rather than the standalone synapse_forge.py file. The __init__.py was a 9-line stub that added the parent to sys.path and nothing else — leaving plan, compose, dispatch, run, call_llm, and all registry helpers absent from the imported module.
Changes
synapse_forge/__init__.py (rewritten — +281 LOC)
- Loads
synapse_forge.pyas_forge_coreviaimportlib.util - Re-exports all public names into the package namespace
- Defines thin wrappers for
dispatch,call_llm_with_fallback, andrunin the package's own__dict__sopatch("synapse_forge.call_llm")intercepts correctly in tests (mock patching works by replacing the name in the target module's dict; wrappers defined here resolvecall_llmthrough this module's globals at call time) - Exposes
detect_providersfromsynapse_forge/detect.py
synapse_forge.py (+3 LOC changed)
plan_idnow usestime.time_ns()instead ofint(time.time() * 1000)— guarantees uniqueness across rapid same-millisecond calls- Version string bumped to
3.2.3in docstring,main()parser, andstatusoutput
Test results
| Before | After |
|---|---|
| 14/51 passing | 51/51 passing |
Backwards compatibility
- CLI invocation (
python synapse_forge.py run "...",synapse-cor run "...") unchanged - Adapter imports (
from synapse_forge.adapters.gemini import Adapter) unchanged install.sh/bootstrap.shflow unchanged