fix(examples): fix 9 broken examples + worker-tool registry lookup (companion to #438)#439
Merged
Merged
Conversation
…ix worker-tool registry lookup after re-registration Companion to the verification-report PR (#438) — every fix verified end-to-end against a live conductor-oss 3.32.0-rc.8 server. Agents suite: 91 PASS / 12 ERROR / 3 HUNG before, 96 PASS / 2 ERROR / 2 HUNG after. Example fixes: - greetings_worker.py: duplicate `def greet` shadowed the registered worker and broke spawn pickling on macOS/Windows (workers_e2e, helloworld, task_listener_example) - worker_example.py: hardcoded /Users/viren metrics dir -> tempfile - user_workers.py: import via examples.* package identity crashed spawn children that load the module as user_example.* - kitchen_sink.py: @agent classifier functions must take zero args - 16i/16j: tools defined inside factory functions are not importable by spawn workers (SpawnSafetyError) — hoisted to module level - 94_openai_runner_tools.py: keep the plain function at module level and apply function_tool() at Agent construction so the module global is not rebound to an unpicklable FunctionTool - llm_chat.py: server requires a non-empty user message (two tasks sent system-only lists); also exit non-zero when the workflow ends FAILED instead of reporting success on any terminal state - run_all_examples.py: classify 6 env-dependent examples as SKIP with reasons (dg skill repo; workflow messages API absent in rc.8) SDK fix: - tool.py _try_worker_task: registry identity check failed once ToolRegistry.register_tool_workers re-registered the task name with a spawn-safe ToolWorkerEntry wrapper; lookup now walks __wrapped__ / fn_direct / fn_ref carriers (broke 14_existing_workers.py; 2 regression tests added, tests/unit/ai: 1744 passed) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ling-senpeng13
added a commit
that referenced
this pull request
Jul 18, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
v1r3n
approved these changes
Jul 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pending decision on whether to take these fixes.** Companion to #438 (verification report, docs only); together they replace #437 (closed). Every fix below reproduces on
mainand was verified end-to-end against a live conductor-oss 3.32.0-rc.8 server. Agents suite: 91 PASS / 12 ERROR / 3 HUNG before → 96 PASS / 2 ERROR / 2 HUNG after;tests/unit/ai: 1744 passed.Counts at a glance
22 examples failed or misbehaved during verification (15 agents suite, 7 core suite). Disposition after this PR:
(
kitchen_sink.pyis counted in "still failing": this PR fixes itsTypeErrorbut it then fails server-side.)Example fixes
helloworld/greetings_worker.pydef greetshadowed the registered worker → spawn-pickling failure on macOS/Windows (brokeworkers_e2e,helloworld,task_listener_example)greet_syncworker_example.py/Users/viren/metrics dir →PermissionErroreverywhere elsetempfile.gettempdir()user_example/user_workers.pyexamples.user_example.modelswhile loaded asuser_example.user_workers— spawn children crashedagents/kitchen_sink.py@agentclassifiers declared a requiredpromptarg; decorator invokes them with zero args →TypeErroragents/16i,agents/16jSpawnSafetyError(<locals>not importable by spawn workers)agents/94_openai_runner_tools.py@function_toolrebinds the module global to an unpicklableFunctionToolfunction_tool()applied atAgent(...)constructionagentic_workflows/llm_chat.pyagents/run_all_examples.pySDK fix
_try_worker_taskinconductor/ai/agents/tool.py: onceToolRegistry.register_tool_workersre-registers a@worker_tasktool's task name with a spawn-safeToolWorkerEntrywrapper, the raw identity check failed and a secondget_tool_def()on the same tool raisedTypeError(broke14_existing_workers.py). The lookup now walks__wrapped__/fn_direct/fn_refcarriers. Two regression tests added.Not fixed here — 4 examples (see the report in #438)
Of the 22 failures this verification surfaced, 9 examples are fixed by code changes in this PR, 9 are resolved without code fixes (reclassified or timeout), and 4 remain unfixed — the agents suite still shows 2 ERROR + 2 HUNG after these fixes:
agents/kitchen_sink.pyTypeError, but it then fails server-side:HTTP 500 — Task translation_swarm defined as a sub-workflow has no workflow definition available. Sub-workflow (SWARM strategy) registration on conductor-oss rc.8 needs SDK/server investigation.agents/74_cli_error_output.pyagents/86_coding_agent.pyagents/68_context_condensation.py