Fix temporal worker imports and streaming tutorial for CI#291
Merged
danielmillerp merged 3 commits intomainfrom Mar 24, 2026
Merged
Fix temporal worker imports and streaming tutorial for CI#291danielmillerp merged 3 commits intomainfrom
danielmillerp merged 3 commits intomainfrom
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- worker.py: Remove private _JSONTypeConverterUnhandled import (removed in newer temporalio) and lazy-import OpenAIAgentsPlugin to avoid opentelemetry.sdk dependency at import time. Fixes all 10 temporal tutorial tests. - 020_streaming/acp.py: Fix TextContent import path and add missing return after error yield. - 030_langgraph/graph.py: Change model from gpt-5 (invalid) to gpt-4o-mini, remove unsupported reasoning parameter. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
777ae44 to
d881da8
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
d881da8 to
1dd4ef9
Compare
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
_JSONTypeConverterUnhandledusage and lazy-importOpenAIAgentsPluginto avoid pulling inopentelemetry.sdkfor non-Temporal agentsTextContentimport path and fix import sorting for ruffTest plan
🤖 Generated with Claude Code
Greptile Summary
This PR fixes two categories of known tutorial test failures — all ten temporal agent tests and the
020_streamingsync test — and updates the CI failure-logging step for better diagnostics. The temporal fixes are clean and well-reasoned. The streaming fix correctly addresses both the wrongTextContentimport module and the missingreturnthat would have caused execution to fall through after the "no API key" early-exit yield.Key changes:
worker.py: Removes the now-deleted private_JSONTypeConverterUnhandledtype from import and type annotation; movesOpenAIAgentsPluginimport insideget_temporal_clientto make it lazy and avoid pulling inopentelemetry.sdkat module load time for non-temporal agents.020_streaming/acp.py: CorrectsTextContentimport (task_message_content→text_content) and adds the missingreturnafter the error yield, preventing fall-through into the normal message handling path./tmp/agentex-*.log(whererun_agent_test.shactually writes) and appends Docker compose logs for the agentex service.030_langgraphas a third fix (invalidgpt-5model + unsupportedreasoningparameter ongpt-4o-mini), but no changes to030_langgraph/project/graph.pyare included in the diff. That test will continue to fail.Confidence Score: 4/5
Important Files Changed
_JSONTypeConverterUnhandledtype from the import list and theto_typed_valuereturn annotation, and moves theOpenAIAgentsPluginimport insideget_temporal_clientto make it lazy. Both changes are correct and targeted.TextContentwas imported from the wrong module (task_message_content→text_content), and the early-return path after the "no API key" yield was missing areturn, allowing execution to fall through into the normal handler logic./tmp/agentex-*.logand Docker compose logs. Thecd ../../scale-agentex/agentexassumes a sibling-repo layout but fails gracefully via `Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Temporal Worker Start] --> B{plugins empty?} B -- No --> C[_validate_plugins] B -- Yes --> D[Lazy import OpenAIAgentsPlugin] C --> D D --> E{has_openai_plugin?} E -- Yes --> F[Connect without custom data_converter] E -- No --> G[Connect with DateTimePayloadConverter] F --> H[Client.connect] G --> H subgraph 020_streaming fix I[handle_message_send] --> J{OPENAI_API_KEY set?} J -- No --> K[yield StreamTaskMessageFull error msg] K --> L[return ← NEW] J -- Yes --> M[Stream agent response] endComments Outside Diff (1)
examples/tutorials/00_sync/030_langgraph/project/graph.py, line 23-50 (link)030_langgraph fix missing from this PR
The PR description lists fixing the
030_langgraphtutorial as one of its goals — "Usedgpt-5(invalid model) withreasoningparameter (unsupported ongpt-4o-mini)" — butgraph.pyis unchanged in this diff.MODEL_NAMEis still"gpt-5"and theChatOpenAIconstructor still passesreasoning={"effort": "high", "summary": "auto"}on line 49, which is the exact configuration the description identifies as causing the test failure.If this file wasn't intentionally left out, the fix (updating
MODEL_NAMEand removing thereasoningkwarg) needs to be included before this PR can deliver on its stated goal of passing all three categories of tutorial test failures.Prompt To Fix All With AI
Reviews (7): Last reviewed commit: "Fix import sorting lint and revert langg..." | Re-trigger Greptile