Repository navigation
Remove hook-call monitors independently of undo order - #814
rupayon123 wants to merge 3 commits into
Conversation
|
I updated the lifetime test to call both monitors before checking that their callbacks are released, and simplified undo around the active-token invariant. The full 260 tests, 68 focused tests and all pinned hooks pass. Every changed line and branch is covered locally; hosted coverage for this commit still needs to run. The benchmark failure also occurs on unchanged base with the job's pytest 9.2.0 and pytest-benchmark 5.3.0 versions: the fixture accesses the removed |
|
🤖 Written by Claude Opus 5.5 via Claude Code for the pluggy maintainers; I prompted it, it did the work, I read it. Thanks, the undo-order bug in Generated by Claude Code |
Undoing an earlier hook-call monitor currently removes later monitors, and later undo calls can restore callbacks that were already removed. Keep a persistent execution chain so each undo removes only its own monitor, repeated undo stays harmless, and in-flight calls retain their original before/after pairing.
The lifetime regression invokes active callbacks before checking their release. Undo traversal now expresses the internal invariant that every active token remains in the chain; directly replacing the private
_inner_hookexecwhile monitors are active fails that assertion. Existing public tracing/monitoring lifecycles, custom original executors, nested calls and result/exception handling remain covered. Includes the numbered changelog fragment.Validation on macOS arm64:
_caller.pybranch remains uncovered locally.Function._nodeid. Local reproduction uses Python 3.10.17; the hosted job uses 3.10.22 on Linux. No benchmark, dependency, coverage threshold or configuration was changed.Hosted checks for the latest repair still need verification. No cross-thread registration/undo guarantee is added.