AochenShen99 66b9e7f212
feat: emit structured runtime metadata (follow-up#3887) (#3906)
* feat: emit structured runtime metadata

* fix: avoid subagent import cycle in replay gateway

* fix: preserve legacy subtask result parsing

* refactor: tighten runtime metadata contracts

* fix(middleware): keep recovery hint on task exception wrapper content

The structured-metadata stamp overwrote the wrapper text with the bare
task-failure message, dropping the model-facing 'Continue with available
context, or choose an alternative tool.' guidance that every other tool
exception keeps. Append the shared hint after the formatted message.

* fix(subagents): require lowercase hex for result_sha256 reader

Length-only validation accepted any 64-char string; a faulty serializer
or relaying wrapper could store a non-digest value in the delegation
ledger. Enforce the producer's hexdigest shape with a fullmatch.

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-07-04 11:27:19 +08:00

38 lines
1.2 KiB
Python

from .features import Next, Prev, RuntimeFeatures
__all__ = [
"create_deerflow_agent",
"RuntimeFeatures",
"Next",
"Prev",
"make_lead_agent",
"SandboxState",
"ThreadState",
]
def __getattr__(name: str):
if name == "create_deerflow_agent":
from .factory import create_deerflow_agent
globals()[name] = create_deerflow_agent
return create_deerflow_agent
if name == "make_lead_agent":
from .lead_agent import make_lead_agent
from .lead_agent.prompt import prime_enabled_skills_cache
# LangGraph resolves deerflow.agents:make_lead_agent when registering
# the graph. Prime at that explicit entrypoint instead of at package
# import time so lightweight submodules can be imported without pulling
# in the whole tool/subagent graph.
prime_enabled_skills_cache()
globals()[name] = make_lead_agent
return make_lead_agent
if name in {"SandboxState", "ThreadState"}:
from .thread_state import SandboxState, ThreadState
exports = {"SandboxState": SandboxState, "ThreadState": ThreadState}
globals().update(exports)
return exports[name]
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")