Skip to content

v0.4.0 — Path A first break (P0.9 dependency split + P0.10 friendly error)

Choose a tag to compare

@jin-bo jin-bo released this 01 May 09:41
· 125 commits to main since this release

The single break release of the Path A P0 plan
(see docs/design/path-a-roadmap.md §3.2). The break is a packaging
change only — no public Python API is renamed, removed, or signature-
changed. The "no-change" upgrade line is pip install 'agentao[full]',
which reproduces the 0.3.x bundled closure exactly (CI-enforced against
a 122-package baseline).

Breaking changes

  • P0.9 dependency splitpip install agentao now installs only
    the core (7 packages) needed to construct an Agentao() instance and
    call chat() against an OpenAI-compatible endpoint. CLI, web fetch,
    and Chinese tokenization become opt-in extras.

    0.3.x direct dep 0.4.0 location
    openai / httpx / pydantic / pyyaml / mcp / python-dotenv / filelock core
    rich / prompt-toolkit / readchar / pygments [cli]
    beautifulsoup4 [web]
    jieba [i18n]

    Migration matrix:

    You are… Install line
    Embedding host (Python from agentao import Agentao) pip install agentao
    CLI user (agentao console script) pip install 'agentao[cli]'
    Want zero behaviour change pip install 'agentao[full]'

    Closure equivalence is enforced by tests/test_dependency_split.py
    against tests/data/full_extras_baseline.txt (122 packages frozen
    on 2026-05-01). See docs/migration/0.3.x-to-0.4.0.md for the full
    guide.

Added

  • P0.10 friendly missing-dep error — running the agentao CLI in
    a core-only install (no [cli] extra) now exits 2 with a one-line
    actionable message instead of crashing with an opaque
    ModuleNotFoundError: rich:

    agentao CLI requires extra packages (missing: rich).
      pip install 'agentao[cli]'   # CLI surface only
      pip install 'agentao[full]'  # 0.3.x-equivalent closure
    See docs/migration/0.3.x-to-0.4.0.md for details.
    

    Implementation: agentao/cli/__init__.py defines entrypoint()
    inline (no module-level imports of rich / prompt_toolkit / readchar /
    pygments) so the module load itself stays free of CLI deps; every
    [cli] dep is preflighted via importlib.util.find_spec so a
    partial install (rich present, prompt_toolkit missing) still hits
    the friendly path instead of leaking a "Fatal error" from
    entrypoints.run_init_wizard's broad except Exception. All other
    public names in agentao.cli lazy-load via PEP 562 __getattr__.
    Slow-marked tests in tests/test_cli_missing_dep_message.py cover
    the friendly-message path, the post-[cli] boot path, the
    no-trace-leak invariant, and the partial-install regression.

  • docs/migration/0.3.x-to-0.4.0.md — full migration guide with
    install matrix, dependency map, common project-shape recipes, and
    a [full] fallback for any path the migration may have missed.

Changed

  • Web tools omitted from the registry without [web]
    WebFetchTool and WebSearchTool register only when
    beautifulsoup4 is importable. In a core install the model never
    sees web_fetch / web_search in its tool schema (vs. the previous
    behaviour of registering them and failing at execute time with an
    opaque ImportError). Mirrors the existing bg_store is not None
    pattern that already conditionally registers the background-agent
    tools.

  • Memory recall degrades gracefully without [i18n]
    MemoryRetriever.tokenize() skips the jieba code path entirely
    when the query has no CJK characters (cheap regex check). On a
    CJK-bearing query in a [i18n]-less install, _cjk_segment()
    returns an empty set with a one-time warning pointing at
    pip install 'agentao[i18n]' instead of silently failing.

  • CI test environment installs [cli,web,i18n] — the existing
    unit-test surface imports from agentao.cli import AgentaoCLI,
    the web-fetch tool, and the jieba memory path. The default Test
    matrix job now installs those three extras so the suite still
    resolves in the core-split world. The core-only contract is
    independently validated by the smoke job and
    tests/test_dependency_split.py.

  • Shared test helper tests/support/wheel.pyREPO_ROOT,
    find_wheel(), require_wheel(), and make_venv() centralized
    out of the venv-creation pattern that was duplicated across
    test_clean_install_smoke.py, test_dependency_split.py, and
    test_cli_missing_dep_message.py.