You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Agent-mode PyPI variant selection uses one representative file, not the installed wheel's tags, so wheels that share .py files all match #2194
In agent mode a release variant of a PyPI package (a record keyed ?artifact_id=<wheel filename>) is matched to the installed distribution by the hash state of ONE file: the lexicographically smallest key with a non-empty beforeHash (representative_file, crates/socket-patch-cli/src/commands/apply.rs:1199, mirrored by select_installed_variants in core). The installed wheel's own WHEELTag: lines are not consulted; they are read only on the hosted path (crates/socket-patch-core/src/hosted/wheel_record.rs:121).
Why this matters
Platform wheels of one release usually share their .py files byte for byte and differ only in the compiled extension. Measured on pillow 12.3.0: all 97 .py files are identical across the manylinux x86_64, manylinux aarch64, musllinux and macOS arm64 wheels. If a patch changes both a .py file and the extension (or only the extension, with a .py file also listed), the representative file is the shared .py, so every variant record "matches" the install. Each matching variant is then applied; for the variants built for another platform the extension's beforeHash does not match. With the default policy that fails closed, so the user gets a failure for a package that has a correct variant; with --force / --allow-patch-conflicts a library built for another platform can be written.
This is from reading the code; I did not reproduce it end to end.
Suggested direction
Select the variant from what the install says it is: the Tag: lines of *.dist-info/WHEEL (and the gem platform, which agent mode already consults) against the variant's artifact_id. Keep the hash probe as a second check, on a file that actually differs between variants when one exists.
Activity