You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make framework workers spawn-safe: GraphWorkerEntry + PassthroughWorkerEntry
Group C (final) of the idea-5 spawn-safety design — the 9 framework
worker closures (6 langgraph graph-structure workers + 3 passthroughs).
- GraphWorkerEntry: picklable wrapper carrying (factory name, FunctionRef
to the user node/router function, plain-data args); the langgraph
make_* factory runs once per worker process inside the entry — its
nested worker never crosses a process boundary. The LLM/subgraph
objects were never captured anyway (only their variable NAMES; the
spawn child rebuilds them by re-importing the node function's module).
- PassthroughWorkerEntry: same deferred-factory pattern for the claude /
langchain / langgraph passthroughs. Claude options travel as a plain-
config dict (ClaudeCodeOptions is never picklable as-is —
debug_stderr defaults to sys.stderr) via new
claude_options_to_plain_config / make_claude_agent_sdk_worker_from_config;
hooks / can_use_tool callables and in-process MCP instances raise
SpawnSafetyError naming the field. Langchain executors / compiled
langgraph graphs hold live clients and locks — the registration probe
(group "framework", now enabled) fails fast with an actionable
message instead of an opaque PicklingError.
- Passthrough registration tests updated to the deferred-factory
contract (invoke the entry, assert the factory call); the claude test
uses a real ClaudeCodeOptions instead of a Mock.
Group D note: check_approval_worker and the _tool_registry dispatch
write are retained (test consumers + upstream-parity tracking), not
deleted.
Tests: GraphWorkerEntry across a real spawn boundary; passthrough
payload pickling + fail-fast; claude config extraction/rejection/
round-trip. tests/unit: 2523 passed, 1 skipped.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments