Repository navigation
fix(cli): write pyproject.toml once when scaffolding a new agent - #373
vldcmp-uipath wants to merge 1 commit into
Conversation
49640b1 to
2f2465a
Compare
The agent framework, Google ADK, LlamaIndex and OpenAI Agents scaffolds called `generate_pyproject` twice per run: once before generating the project files and again after. The second call overwrote the first with identical content, so the bug was invisible, but it left the generation order inconsistent between packages and would silently discard anything written to pyproject.toml in between. Each scaffold now generates the script and its config first, then writes pyproject.toml once, matching the other integrations. A regression test per package counts the calls. The agent framework failure test needed a working directory of its own: with the redundant first call gone, the file generation that precedes the failure now writes into the current directory, which was the source tree. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2f2465a to
2912791
Compare
|
Closing: UiPath/uipath-python#1886 fixes #1543 entirely in the base CLI, so no integration in this repo needs a change — Recording what this PR had found, in case someone picks it up later: |
|



Problem
Four scaffolds called
generate_pyprojecttwice peruipath newrun — once before generating the project files, once after:The second call rewrote the first with identical content, so nothing was visibly wrong, but the generation order differed from the other integrations for no reason, and anything written to
pyproject.tomlbetween the two calls would be silently discarded.Changes
uipath-agent-framework,uipath-google-adk,uipath-llamaindexanduipath-openai-agentsnow generate the script and config first, then writepyproject.tomlonce — the orderuipath-claude-sdkanduipath-pydantic-aialready used. Those two packages are unaffected and not touched.uipath-agent-framework's failure test now runs in its own working directory. The middleware scaffolds into the cwd, and with the redundant first call gone, the generation that precedes the induced failure writes real files — which landed in the source tree.uipath-llamaindexhad no test for its scaffolding middleware; it gets one covering the files written and the project name.uipath-agent-framework0.1.1,uipath-google-adk0.1.1,uipath-llamaindex0.6.2,uipath-openai-agents0.1.2.No dependency or middleware-contract changes, so this is independent of UiPath/uipath-python#1886 and can merge on its own.
Testing
Full suites pass in every touched package (166 / 125 / 166 / 68), with
mypy --config-file pyproject.toml .,ruff checkandruff format --checkclean in each.🤖 Generated with Claude Code