Files
deepagents/libs/code/deepagents_code/__init__.py
T
Mason Daugherty c96f822de1 fix(code): refresh status bar model after recovering from failed startup (#3511)
When `dcode` fails to start with a `ModelConfigError` (e.g., missing
`langchain-fireworks`) and the user recovers by running `/model` to
switch providers, the server retry succeeds but the status-bar footer
keeps displaying the original (failed) model. `StatusBar` was only
seeded once in `on_mount`, and the retry path
(`_retry_startup_with_model`) mutates `settings` without pushing into
the widget — only the happy-path `_switch_model` did. Pushing the
refresh into `on_deep_agents_app_server_ready` covers every successful
(re)start uniformly.
2026-05-20 14:55:15 -05:00

37 lines
969 B
Python

"""Deep Agents Code - Interactive AI coding assistant."""
from __future__ import annotations
from typing import TYPE_CHECKING
from deepagents_code._version import __version__
if TYPE_CHECKING:
from collections.abc import Callable
__all__ = [
"__version__",
"cli_main", # noqa: F822 # resolved lazily by __getattr__
]
def __getattr__(name: str) -> Callable[[], None]:
"""Lazy import for `cli_main` to avoid loading `main.py` at package import.
`main.py` pulls in `argparse`, signal handling, and other startup machinery
that isn't needed when submodules like `config` or `widgets` are
imported directly.
Returns:
The requested callable.
Raises:
AttributeError: If *name* is not a lazily-provided attribute.
"""
if name == "cli_main":
from deepagents_code.main import cli_main
return cli_main
msg = f"module {__name__!r} has no attribute {name!r}"
raise AttributeError(msg)