fix(cli): only claim uipath new scaffolds for langchain agents - #1069
Draft
vldcmp-uipath wants to merge 3 commits into
Draft
fix(cli): only claim uipath new scaffolds for langchain agents#1069vldcmp-uipath wants to merge 3 commits into
vldcmp-uipath wants to merge 3 commits into
Conversation
langgraph_new_middleware intercepted `uipath new` unconditionally, making the base function scaffold unreachable whenever uipath-langchain was installed (UiPath/uipath-python#1543). Gate it on the project_type and agent_framework values forwarded by uipath >= 2.14.13 and pass through anything that is not an agent scaffold for the langchain framework. Bump version to 0.17.2 and raise the uipath floor to 2.14.13, which ships the shared ProjectType/AgentFramework enums. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Temporary, to validate and publish a dev build of this PR before uipath 2.14.13 ships: pin uipath==2.14.13.dev1018867574 (built from UiPath/uipath-python#1886) and source it from the testpypi index. Restore the ">=2.14.13, <2.15.0" range and drop the source before merging. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
main released up to 0.17.4 while this branch bumped 0.17.1 -> 0.17.2; resolve to 0.17.5 and regenerate uv.lock on top of main's, keeping the temporary testpypi dev pin for uipath. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
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.



Important
Draft until UiPath/uipath-python#1886 is approved and
uipath2.14.13 is published. The middleware importsuipath._cli.models.project_types/uipath._cli.models.agent_frameworks, which only exist from 2.14.13. For dev-build validation and TestPyPI publishing, this PR temporarily pinsuipath==2.14.13.dev1018867574(the dev build of #1886) sourced from thetestpypiindex, withuv.lockresolved against it. Before marking ready for review: restore"uipath>=2.14.13, <2.15.0", drop the[tool.uv.sources]testpypi entry foruipath, and runuv lock.Problem
langgraph_new_middlewarereturnsshould_continue=Falseunconditionally, so installinguipath-langchainhijacksuipath newprocess-wide and the base function scaffold becomes unreachable (UiPath/uipath-python#1543). This also breaks theuip function new -l pypath, which delegates touipath newand expects a function project.Changes
project_type/agent_framework(forwarded byuipath newsince 2.14.13) and only claims the command for--type agentwith thelangchainframework; everything else passes through to the base scaffold or another framework's integration.ProjectType.AGENT/AgentFramework.LANGCHAIN) preserve current behaviour when an olderuipathCLI calls with just the project name.!=rather than identity so callers passing plain strings gate correctly (the enums subclassstr).uipathfloor raised to 2.14.13.Behaviour with uipath >= 2.14.13
uipath new my-fnuipath new my-agent --type agentuipath new x --type agent --agent-framework pydantic-aiTesting
tests/cli/test_new.py(5 new cases incl. plain-string gating and old-CLI default), mypy and ruff clean, run against the local editableuipath2.14.13.🤖 Generated with Claude Code