[codex] fix Worker create_agent vendoring#45
Merged
Conversation
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
Fixes the Worker example dependency layout after PR #44 was already merged.
langchaindependency fromexamples/workers/pyproject.tomlsopywrangler synconly resolves Pyodide-compatible dependencies.create_agentstack inscripts/setup_pyodide_deps.sh:langchain==1.0.0,langchain-core==1.1.0,langgraph==1.0.0,langgraph-sdk==0.3.1, andlanggraph-checkpoint==2.1.0.python_modulesduring setup so local runs cannot pass due to leftovers.create_agentintegration tests fail on501instead of skipping whencreate_agentis unavailable.Why
A separate Dependabot security-update job on
mainfailed because the Worker example declared broad directlangchain>=0.3.0,<1.0.0without a lockfile/pinned installed version.The correct Worker fix is not to move
pyproject.tomlto newerlangchain>=1.3.x: that breakspywrangler syncand Pyodide because newer transitive dependencies pull native packages without Pyodide wheels. The Worker example already uses a manual vendoring script for this reason, so this makes that split explicit and keepscreate_agentsupported.Validation
cd libs/langchain-cloudflare/examples/workers && env PATH="$HOME/.nvm/versions/node/v22.17.1/bin:$PATH" uv run pywrangler sync --force- passedcd libs/langchain-cloudflare/examples/workers && env PATH="$HOME/.nvm/versions/node/v22.17.1/bin:$PATH" ./scripts/setup_pyodide_deps.sh- passedcd libs/langchain-cloudflare && set -a && source ../../.env && set +a && env PATH="$HOME/.nvm/versions/node/v22.17.1/bin:$PATH" uv run pytest 'tests/integration_tests/test_worker_integration.py::TestWorkerAgentTools::test_agent_tools[@cf/qwen/qwen3-30b-a3b-fp8]' 'tests/integration_tests/test_worker_integration.py::TestWorkerAgentStructuredOutput::test_agent_structured_output[@cf/qwen/qwen3-30b-a3b-fp8]' 'tests/integration_tests/test_worker_integration.py::TestWorkerAgentStructuredJsonSchema::test_agent_structured_json_schema[@cf/qwen/qwen3-30b-a3b-fp8]' -v -s- 3 passedcd libs/langchain-cloudflare && make lint- passedcd libs/langchain-cloudflare && make test- 110 passed, 2 skippedpre-commit run --all-files- passedNote: representative Llama
agent-toolsand JSON-schema agent paths passed, while the Pydantic structured agent path hit an upstream Workers AI504 Gateway Time-out. The same Pydantic path passed immediately on Qwen.