piker/ai/prompt-io/opencode/20260813T225940Z_b691422b_p...

1.4 KiB
Raw Blame History

The user asked to continue the piker broadcast-consumer audit after committing the cached feed ownership fix. The next isolated item was Deribits cached price feed, which wrapped one retained LinkedTaskChannel in competing broadcaster roots for cache hits.

git diff HEAD~1..HEAD -- piker/brokers/deribit/api.py

Changed maybe_open_price_feed() so both the first cache owner and every cache hit enter LinkedTaskChannel.subscribe() and receive a lexical child from the channels single retained broadcaster root.

git diff HEAD~1..HEAD -- tests/test_deribit_broadcast.py

Added a concurrent ownership regression using real Tractor broadcast state. It proves a miss owner and cache-hit caller receive the same quote, closing the hit child leaves the owner live, and both children clean up independently while the channel root remains registered.

Verification output:

.                                                                        [100%]
1 passed in 0.01s

The new test passes through a source-isolated Deribit import. Test Ruff, Python compilation and whitespace checks pass. Full package import and full-file Deribit Ruff remain blocked by pre-existing Qt, msgspec model, and legacy Deribit lint errors unrelated to this patch.