langgoap.SafeTracerProxy

langgoap.SafeTracerProxy#

class SafeTracerProxy(inner)[source]#

Wrap a PlanningTracer so every hook call is exception-safe.

__getattr__ intercepts attribute access, returning an error-swallowing wrapper for callables and the raw value for everything else (so attributes like reflections keep working transparently).

Usage:

tracer = LangSmithTracer()
safe = SafeTracerProxy(tracer)
safe.on_plan_start(goal, state, "AStar")  # never raises

The proxy is itself a valid PlanningTracer because the Protocol is structural and the proxy responds to every hook name via __getattr__. Hooks the wrapped tracer does not implement resolve to no-ops, so a tracer written against an older protocol never changes execution outcomes.

Idempotent wrapping: SafeTracerProxy(SafeTracerProxy(t)) is indistinguishable from SafeTracerProxy(t) because the proxy flattens itself in __init__().

Parameters:

inner (PlanningTracer)

__init__(inner)[source]#
Parameters:

inner (PlanningTracer)

Return type:

None

Methods

__init__(inner)

Attributes

inner

The wrapped tracer (read-only handle for tests / introspection).