Repository navigation
fix: price-check limit sizes only the sample; serialise reads on the shared tab - #5
Merged
Merged
Conversation
…shared tab - ebay_price_check / amazon_price_check: `limit` truncated the listings before summarize() and results_found, so limit=1 reported one result and a one-row median. Statistics, results_found and the history record now cover the full set; `limit` only sizes the returned sample (default 8). - Concurrent tool calls (sync tools run on worker threads) interleaved navigate -> wait -> read on the one labelled tab and read each other's pages. The read sequence now holds a per-session threading.Lock. - A read still hijacked after the one retry is now an error instead of being priced; the probe and session-status keep reporting it themselves. - The same-search check compares filters too (sold/complete, condition, price band; sort when both pages state one), not just the keywords. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
QA panel review — PASS
code-review-structural · head dddfb1560c2a · formal
No findings were raised, so there was nothing to verify. The panel (all five finders plus the structural engine) reviewed the diff and found no defects. No disagreements, no coverage gaps, no prior requests to disposition.
No findings — the review came back clean.
findings JSON (machine-readable)
[]
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.
Summary
E1 —
limitshrank the statistics.ebay_price_checkandamazon_price_checkdidlistings = listings[:cap]beforesummarize()/results_found/_record(), solimit=1reportedresults_found: 1and a one-row median, contradicting "statistics cover every result found". Now the stats,results_foundand the price-history record cover the full set (still bounded bymax_results, asebay_price_and_profitalready was);limitonly sizes the returnedsample(default 8). Documented in both docstrings.E2 — concurrent calls read each other's pages. All tools share one
Browser/ labelled tab, and the host runs sync tools on worker threads, so parallelebay_price_checkcalls interleaved navigate → wait → read and reported another query's comps._read_pagenow holds a per-sessionthreading.Lockfor the whole navigate/settle/retry sequence.EbayError(the docstring promised "a second hijack is reported"; the code returned the foreign data).ebay_page_probeandebay_session_statuspassstrict=Falseand keep reporting it their own way._hijackedcompares the search's filters too —LH_Sold/LH_Complete,LH_ItemCondition,_udlo/_udhi(Amazon:low-price/high-price) — not just the keywords. Sort (_sop/s) is judged only when both pages state one, so an implicit default sort is not a false hijack.One existing fixture used a landed URL without the request's filters (
?_nkw=xanswering a sold search); it now lands on the realsearch_url(..., sold=True).Tests
ruff check . && ruff format --check .clean;pytest -q→ 189 passed (172 before + 17 new). The 12 new behavioural tests fail against the oldtools.py:No version bump / release.
🤖 Generated with Claude Code