Repository navigation
fix(agent-hooks): run pyright and dump_openapi with --no-sync in an engine-linked app - #253
Merged
Merged
Conversation
…ngine-linked app
A plain `uv run` syncs the venv to uv.lock first. In an app that `make engine-link` points at a
local interp-engine checkout, that sync puts the pinned engine release back, so the stop hooks
removed the link and then checked the app against the pinned engine.
Both hooks now add --no-sync when the app has an `.engine-linked` marker, as `uv_run` in the
Makefile does. The flag is a plain string, not a bash array: bash 3.2 treats an empty
"${a[@]}" under `set -u` as an unbound variable.
Co-authored-by: Cursor <cursoragent@cursor.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.
Problem
The
pyright-stop.shandopenapi-stop.shstop hooks call a plainuv run. Before it runs the command,uv runsyncs the venv touv.lock. In an app thatmake engine-linkpoints at a local interp-engine checkout, that sync removes the link and installs the pinned engine release again.The hook then checks the app against the pinned engine, not the local checkout. Any API that only the local checkout has shows up as pyright errors that are not real.
make engine-statusthen shows the app asstale, and each later stop gives the same errors again.Fix
When the app has an
.engine-linkedmarker, both hooks add--no-sync. The Makefile already does this for the-devtargets (uv_run). The follow-up message from the pyright hook also mentions--no-sync, so an agent that runs pyright again does not unlink the engine.The flag is a plain string, not a bash array. Bash 3.2 treats an empty
"${a[@]}"underset -uas an unbound variable.Risk
.engine-linkedmarker, the command does not change. Onlymake engine-linkwrites that marker, and it is gitignored.Testing
bash -npasses on both scripts.set -u, the new form givesuv run pyrightwithout the marker anduv run --no-sync pyrightwith it. The old array form fails withunbound variable.pyright-stop.shby hand with a stop-hook input, on an engine-linked app. Afterwardmake engine-statusstill showed the app aslocal. Before the fix, the same run removed the link.