Skip to content

fix(runtime): recover lost CDP ports, finish failed review jobs and share catalog P95 - #169

Merged
lanyue-llk merged 9 commits into
mainfrom
fix/runtime-code-items
Nov 3, 2026
Merged

lanyue-llk merged 9 commits into
mainfrom
fix/runtime-code-items

Conversation

@lanyue-llk

@lanyue-llk lanyue-llk commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

What, why and how of this PR

Issues

Closes #165

Follow-up: #170 tracks the remaining native CDP ownership gap described below.

Summary

I checked each of the five items against current code. The table gives the result for each part.

Item Result Why
_catalog_percentile Fixed Nothing frozen depends on it. The value is only rendered into index.html: it is not in the catalog manifest, catalog_release.py and validate_catalog_acceptance_report do not check it, and no golden route covers it. The report now calls lexbench_webfetch.metrics.percentile.
native_cdp_browser port race Fixed, with a limit See below.
DockerBackend.find_free_port Removed Nothing calls it, here or in the pinned webarena_verified package. The upstream ContainerBackend protocol still declares it, but DockerBackend does not inherit from that protocol, the protocol is not runtime_checkable, and this repository runs no static type check, so only static conformance is affected. If an upstream bump starts calling it, the call fails with AttributeError. The unrelated run.find_free_port in lexbench/resource_matrix.py is a different function.
id(request) in har.py Not a bug, left in place _playwright_request_objects keeps every registered request for the recorder's lifetime, so an id cannot be reused. Playwright caches the API wrapper on its implementation object, so response.request and the event's request are the same object. If capture fails, the request is not registered, the error is already in recorder.errors, and HAR assembly only walks registered keys.
locals().get("readiness_retries", 0) Fixed The variable is now initialized before the try, with the same value on every path.
service._submit in webarena_replay.py Left in place There is no public alternative. service comes from upstream BrowserTool._get_service(), and PlaywrightReplayTool implements the same private shape. Renaming it here would break the upstream tool.
web_search/review.py job loop Fixed Not hash-bound: the frozen prompts are unchanged, and _successful and _public_execution accept only completed jobs, whose state is unchanged. See below.

Native CDP port

The servers take a numeric port and bind it themselves, so a reservation cannot be held across the launch. The fix detects a lost port and recovers:

  • A server that exits with an "address in use" log is restarted on a new port, up to three attempts. Any other exit raises its log on the first attempt, as before.
  • An open port no longer counts as proof. If the server has exited by the time the CDP connection returns, the connection is discarded and the server is restarted.
  • If the server has not exited yet, the connection cannot be told apart and the caller receives it. If the server has exited when the caller finishes, the call now fails with an error naming the exit code and log, and a caller's own error is kept. The attempt is lost, not restarted, because the caller's work has already run.
  • If the handshake fails, the server gets up to one second to exit before the error is raised, so a rejection by another listener still reaches the restart path. A server that stays running raises the handshake error without a restart. A server that exits with no "address in use" log also raises the handshake error, so the attempt keeps that message. This adds up to one second to that failure path only.
  • A server that exits silently before any handshake raises an error naming its exit code, instead of an empty message.
  • The log is read with os.pread, because the child shares the file offset. A Moli diagnostic log keeps the output of every attempt.

Remaining limits (#170 tracks the ownership gap and has the measurements):

  • The handshake can finish before the server exits, so the caller can run on another process's browser. The exit check turns this into a failed attempt, but it does not prevent it. With real Playwright, real Moli 1.1.17 and a second real Moli on the forced port, the review measured 28 of 30 runs yielding the other server's browser, and 2 of 30 restarting. My repeat on an idle host restarted 30 of 30, because a failed bind exit (median 9.7 ms) and a handshake (median 9.3 ms) are nearly tied, so the order depends on the host.
  • The exit check misses a caller that finishes before the server exits. With the failed bind delayed by 100 ms, a body of a local page plus 50 ms returned silently in 10 of 10 runs. With the body extended by 200 ms, or 500 ms, all 10 failed. Waiting for the exit would add latency to every call, so I left that out.
  • A server that exits for any other reason during the call also fails the call, even if the result was already complete, because the two cases cannot be told apart.
  • A listener that accepts a connection but never answers holds connect_over_cdp until the call deadline, so the restart cannot help. The review measured two processes started and a TimeoutError at 8.01 s with an 8 s budget. The old code also blocked here, and I did not cap the handshake.
  • Proving ownership needs psutil, which is not in the headless-eval extra, and adding it means a lockfile change. Binding the port in the parent would need server support for an inherited socket. I did not check whether the server binaries could support that.

Review job

An unexpected error used to leave status.json at running with no attempt status. An error while saving the first status could also leave the reviewer running until the run ended. Now:

  • A finally block kills and reaps the reviewer through the new ReviewerSessions.kill, then writes a terminal state on every exit path.
  • KeyError and TypeError from a malformed opinion now count as a failed job, matching _successful. Other unexpected errors still propagate after the state is recorded.

Effect on reports

No stored evidence, profile or receipt changes, and already published reports are unchanged. Stored catalog archives still verify, because nothing rebuilds them.

A future rebuild of a catalog report will show a nearest-rank P95 instead of an interpolated one. report_archive_sha256 covers the whole archive, including index.html, so if that value changes the rebuilt report needs a new archive binding in its profile (catalog_contracts.py).

Test plan

Run on head 63648668 with the locked Python 3.11 environment. CI results are posted in the PR comment.

  • ruff check --config 'include=["*.py"]' --select F,TID252 . and ruff check: pass.
  • tests/test_native_cdp_port.py, tests/test_golden_reports.py, tests/test_headless.py, tests/test_headless_runner.py, tests/test_headless_access.py: 109 passed, 1 failed. The failure, test_headless.py::test_converter_shared_and_nonzero_not_converted, is on the known local macOS list. No golden route hash changed.
  • From earlier rounds, on head 40452923, with no changes to these areas since: tests/web_search, tests/test_review_runner.py, tests/trajectory_replay and tests/environments passed. They were not rerun locally on this head, and CI runs the full suite.
  • tests/test_native_cdp_port.py runs a stand-in server binary against real held sockets, and its fake handshake forces each ordering. It covers a free port, a non-CDP listener, a handshake rejected before the server exits, a handshake failure from a running server, a handshake failure followed by a silent or unrelated exit, a silent exit before any handshake, a CDP listener with either exit order, an exit while the browser is in use, a caller error alongside an exit, an unrelated failure after a lost port, bounded attempts, a non-port failure and a missing binary.
  • Real binaries, with real Playwright and a local page. On a free port, Moli 1.1.17 (10 runs) and Lightpanda (5 runs) completed with no false failure. Obscura (5 runs) rejected the local address through its private-network guard during navigation, so the local page never loaded; this check did not exercise its normal path. With a second real Moli on the forced port and the server's start delayed through a wrapper script, the call failed with the new error in 10 of 10 runs per case when the body outlasted the exit.
  • tests/trajectory_replay/test_catalog_report.py builds five tasks whose interpolated P95 (8.80) and nearest-rank P95 (10.00) differ, and asserts the rendered cell.
  • tests/web_search/test_review.py and tests/test_review_runner.py cover a malformed opinion that reaches validate_result, a real reviewer killed after an error before the wait, and the new kill. I added poll to one existing fake process in test_review.py, because the job now calls it.
  • Each new test was checked by breaking the code: a constant P95, removing KeyError and TypeError from the except, dropping the handshake re-raise, removing the exit check, and reading the log from offset 0 each fail the matching test.

@lexmount-ocr lexmount-ocr Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Review complete · 19e31ad

This review found 1 issue(s), including 1 blocking issue(s).

Comment on lines +846 to +849
except Exception:
if process.poll() is None:
raise
return None

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug · medium
P2 — Port-collision recovery is bypassed when the foreign listener rejects CDP before the launched child exits. An existing HTTP listener can return an error while the child is still starting or reporting its bind failure; this poll() then returns None, the exception escapes, and the outer finally terminates the child without inspecting its address-in-use log or trying another port. This is separate from the documented foreign-CDP successful-handshake limitation. Resolve the child's startup outcome within the remaining deadline before deciding whether to propagate the handshake error, and route confirmed bind failures through the retry loop. Add a regression where the handshake fails before child exit: the current test harness explicitly waits for the child in connect(), masking this ordering. This is a localized but functional gap in the recovery promised by this change.

@lexmount-ocr lexmount-ocr Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Re-review complete · 1464767

No findings in this incremental review.

@lanyue-llk lanyue-llk left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent review, round 1

Reviewed head 14647676. No stored evidence, profile or golden route changed. Five findings, none blocking correctness of stored data: three P2 defects, one P2 scope gap and one P3 group.

P2: tests/web_search/test_review.py:634 never reaches the code it claims to test

test_malformed_opinion_error_records_a_terminal_failed_job patches validate_result to raise KeyError/TypeError, but the fake Process writes no result.json. json.loads(result_path.read_bytes()) is evaluated first and raises FileNotFoundError, which the existing OSError branch catches. The recorded state["error"] in all four cases is [Errno 2] No such file or directory: ...attempt-001/result.json.

Mutation check: removing KeyError, TypeError from the except at src/harness/web_search/review.py:799 leaves all 58 tests in the file passing. The PR's claim that a malformed opinion now counts as a failed job is therefore unproven.

Fix: have the fake process write valid JSON to result.json (or write it through the --output-schema result path), and assert state["error"] == str(error).

P2: src/harness/web_fetch/providers/headless.py:849 discards the handshake error when the server exits during the grace period

_connect_native_cdp returns None from the except Exception block, so the Playwright exception is lost. If the server exits within the grace second without an "address in use" line, the caller raises RuntimeError(output) from that attempt's log alone. Before this PR, the handshake error was raised.

Reproduced with a stand-in server that binds its port, exits 1 silently after 0.3 s, and a connect_over_cdp that raises ConnectionError:

RuntimeError '' context: None

The worker stores str(error) as error_message, so this attempt is recorded with an empty message and no handshake detail. A Playwright timeout on this path would also change browser_error_type from timeout to browser_error, though the grace window is very small at the deadline.

Fix: keep the exception and re-raise it when the log does not match _ADDRESS_IN_USE, including the server log in the message if useful. Add a test with a silent server exit. The current tests all use a matching log or a server that stays alive.

P2: src/harness/trajectory_replay/webarena_report.py:2424 has no test for the P95 change

Replacing the rendered value with a constant ({-999.0:.2f}) leaves tests/trajectory_replay/test_catalog_report.py and test_catalog_contracts.py passing (14 passed). The PR discloses that the one-task fixture cannot distinguish the definitions, but nothing protects this change from being reverted, or the argument from being wrong: for example, a fraction expressed as 95 rather than .95.

Fix: add a multi-task build, or a small build with durations where interpolated and nearest-rank P95 differ, and assert the rendered cell.

P2: "Closes #165" leaves a stated limit with no follow-up issue

The PR body states that a run can still connect to another CDP server if that server answers before ours has exited. That is the race #165 names, narrowed but still open, and it matters here because parallel workers each start their own CDP server, so the other listener can be a real CDP endpoint running another call. I found no follow-up issue for it. The PR also says it did not check whether the server binaries could accept an inherited socket.

Fix: open a follow-up for ownership proof (psutil or an inherited socket), link it in the "## Issues" section and keep "Closes #165".

P3: statements that overclaim

  • tests/test_native_cdp_port.py:1 says "restarted, never impersonated", and the comment at :59 says "The real handshake outlives a server that exits on its failed bind". The fake forces that order with self.processes[-1].wait(20), and the real binaries were not run. The PR body's own limit contradicts "never". test_foreign_cdp_server_is_not_used_after_this_server_lost_the_port only proves the forced order. Fix: reword both to describe the case where the server has exited first.
  • The PR body says nothing frozen depends on the catalog P95 because it is not in the manifest. catalog_contracts.py:585-591 also binds report_archive_sha256, and that archive contains index.html. Existing archives still verify against their own bytes, so the conclusion holds for stored evidence, but a rebuilt report needs a new binding. Fix: say so in "Effect on reports".
  • The PR body says removing DockerBackend.find_free_port "would break that interface". ContainerBackend is a plain Protocol, not runtime_checkable, DockerBackend does not inherit from it, and the upstream manager has no caller. Removal would affect static conformance only. Issue #165 says to remove it if nothing calls it. Keeping it for conformance is defensible, but the PR should state the reason at that strength, or remove it.

Verified without findings

  • CI on 14647676: ci and OCR runs succeeded, including "Tests and static checks" and "Installation and packaging".
  • Local: both ruff gates pass. tests/test_native_cdp_port.py, tests/web_search/test_review.py, tests/test_review_runner.py, tests/trajectory_replay/test_catalog_report.py and tests/test_golden_reports.py: 88 passed, no route hash changes.
  • Mutations that are caught: removing the post-handshake poll check, removing the handshake grace path, and removing sessions.kill from the finally.
  • readiness_retries: same value on every path. The old locals().get only ran under except Exception, so a BaseException used to reach line 810 unbound.
  • lexbench_webfetch.metrics.percentile takes a 0..1 fraction, and durations is nonempty because statistics.mean already requires it.
  • id(request): the claim holds. _impl_to_api_mapping.from_maybe_impl caches the wrapper on the implementation object, the recorder retains registered requests, and HAR assembly walks only registered keys.
  • service._submit: no public alternative is used anywhere in the repository, and PlaywrightReplayTool implements the same method.
  • review.py: the completed path writes the same state keys in the same order. _kill_session is a no-op once the process is reaped. _validate_schema is strict, so AttributeError is not a plausible malformed-opinion outcome.
  • Restart loop: every earlier attempt has exited before the next one starts, the log offset handling is correct, and the regex matches AddressInUse and Address already in use.
  • The two tests/test_headless_runner.py failures the PR mentions pass when selected alone on both this head and base a239d1cc, so I found no evidence that the PR caused them.

@lanyue-llk

Copy link
Copy Markdown
Contributor Author

Review round 1 is addressed on head 40452923. No finding is disputed.

Fixed:

  • Malformed opinion test (cb7f46b7): the fake process now writes result.json, so the test reaches validate_result and asserts state["error"] == str(error). Removing KeyError and TypeError from the except now fails it.
  • Lost handshake error (8794c809): a server that exits without an "address in use" log now re-raises the handshake error. A silent exit before any handshake names the exit code instead of raising an empty message. New tests cover a silent exit and an unrelated log. Dropping the re-raise fails them.
  • Catalog P95 test (16aa5670): a five-task build has an interpolated P95 of 8.80 and a nearest-rank P95 of 10.00, and the test asserts the rendered cell. A constant P95 now fails it.
  • Ownership follow-up: Prove native CDP server ownership before using a connection #170 tracks the remaining gap and is linked from the Issues section. Closes #165 stays.
  • Overclaims (526e25f8, 40452923, PR body): the test docstring and comment now describe only the order the fake forces. The PR body states the report_archive_sha256 rebinding under "Effect on reports". I removed DockerBackend.find_free_port (40452923), as Fix the remaining code items from the #94 runtime bug follow-up #165 asks when nothing calls it. The body gives the real effect: only static conformance with the upstream protocol, plus an AttributeError if a future upstream bump starts calling it.

CI: the checks on 40452923 were still pending when this comment was posted, so this comment does not report a CI result.

@lexmount-ocr lexmount-ocr Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Re-review complete · 4045292

No findings in this incremental review.

@lanyue-llk lanyue-llk left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent review, round 2

Head 40452923. CI on this head is green: Tests and static checks, Installation and packaging, Rendered reference and report checks, and Python 3.11 all pass.

The round 1 fixes hold. I found one P2 and two P3 items. All three are in the native CDP port change, and the first comes from running a real server binary, which the PR had not done.

P2: src/harness/web_fetch/providers/headless.py:925: with a real CDP listener, the run almost always stays on the other browser

Problem: the PR body says that if the server has exited when the connection returns, the connection is discarded, "so a run does not continue on another process's browser". It describes the remaining gap as a limit, but with a real server that gap is the usual outcome.

I ran native_cdp_browser with real Playwright and Moli 1.1.17. A second Moli server was already listening, and the first candidate port was forced onto it:

Outcome (30 runs) Count
Handshake finished first, and the context yielded the other server's browser 28
Our server's exit was seen, and it restarted on a new port 2
  • In the 28 runs, our server exited with code 1 about 5 ms after the context was entered, and nothing reported an error.
  • This is not a regression, because the old code had the same hole, and #170 tracks ownership proof.
  • However, test_foreign_cdp_server_is_not_used_after_this_server_lost_the_port passes only because its fake handshake waits for the server to exit. The real order is usually the opposite.
  • Parallel native servers are the most plausible thing to hold a lost port, so the case this path handles is rarely the one that occurs.

Fix:

  1. Correct the PR text: restart is reliable for a non-CDP listener, while a real CDP listener usually wins the race (28 of 30 with Moli). Record the same measurement in #170.
  2. Consider a cheap detection that needs no psutil: on normal exit from the yield, raise if process.poll() is not None. Our server exits within milliseconds of losing the port, so any real page load would end with it dead, and the attempt would fail instead of being silently measured on the wrong browser. The check also fails an attempt whose server really crashed mid-call, which seems correct. If you prefer to defer this, add it to #170 as an option.

P3: src/harness/web_fetch/providers/headless.py:847: a silent listener uses the whole deadline, so the restart cannot help

Problem: connect_over_cdp gets the full remaining deadline. If a listener accepts the connection but never answers, Moli exits at once while the handshake keeps blocking. With an 8 s budget I measured two processes started and TimeoutError: Native CDP server startup exceeded the call deadline at 8.01 s. The old code also blocked here, and the attempt fails with an error rather than being contaminated. The PR body does not mention this path.

Fix: add one line to the PR's limits. No code change is needed unless you want to cap the handshake timeout.

P3: src/harness/web_fetch/providers/headless.py:918: nothing tests that the log check is limited to the current attempt

Problem: changing the os.pread to read from offset 0 leaves all 11 tests in tests/test_native_cdp_port.py passing. With that change, an attempt that fails for an unrelated reason after an earlier lost port would be treated as another lost port.

Fix: add a test where the first attempt loses the port and the second exits with an unrelated log. Assert that it does not retry and that the error is the second attempt's log.

What I verified without finding a defect

  • Round 1 fixes: the new tests fail when the code is broken. I removed the post-connect liveness check, set the attempts to one, removed the exit-code message, removed sessions.kill, and forced the terminal-state branch, and each caused a failure. I did not repeat the round 1 mutations for the P95 cell and the except types; the author reports those.
  • Real binary: Moli on a held port prints Address already in use (os error 48) and exits with code 1, which _ADDRESS_IN_USE matches. A free port and a non-CDP HTTP listener both behave as claimed. Lightpanda and Obscura were not available, so their messages remain unverified.
  • Command and diagnostics: the argument order is unchanged, the attempt's log is read correctly, every process has exited at the end, and a Moli log keeps all attempts.
  • find_free_port: no caller remains in this repository. The pinned upstream only declares it on its own protocol and its own backend. run.find_free_port in resource_matrix.py is unrelated.
  • Catalog P95: percentile is nearest-rank rounded to two decimals and matches the shared definition. Neither the renderer's contracts nor any golden route binds the value, and no profile under evaluation/ carries report_archive_sha256.
  • readiness_retries: it is assigned once in the try and is 0 on every earlier path, so the values match the old code.
  • service._submit: the private shape is the same in PlaywrightReplayTool, and there is no public alternative.
  • har.py: the keeps-the-request-object claim holds, and an unregistered request is reported in recorder.errors.
  • web_search/review.py: _kill_session only acts on a live process, so a normal exit behaves as before. Completed jobs keep their state. review_runner.py is in the implementation_sha256 of review_execution.py, so an unfinished review directory must be restarted, as the existing check demands; stored evidence is not affected.
  • Local checks: ruff passes both configurations. The golden reports, port, review, catalog, headless runner and tests/environments targets ran with 249 passed and no route hash changes.

@lexmount-ocr lexmount-ocr Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Re-review complete · 6364866

No findings in this incremental review.

@lanyue-llk

Copy link
Copy Markdown
Contributor Author

Review round 2 is addressed on head 63648668. No finding is disputed.

Fixed:

  • Wrong browser with no error (0c3d3aa6): the review's measurement was right and the PR text was wrong, so I corrected the text. A call now fails if the server has exited when the caller finishes, with an error naming the exit code and log. A caller's own error is kept. New tests use a CDP listener that answers before the server exits, and an exit during the call. Removing the check fails them. I recorded the measurements in Prove native CDP server ownership before using a connection #170.
  • Handshake blocking until the deadline: added to the PR's limits and to Prove native CDP server ownership before using a connection #170. There is no code change, so the handshake timeout is still the full remaining budget.
  • Port check scope (63648668): a new test has the first attempt lose the port and the second exit with an unrelated log. It asserts two processes and that the error is exactly the second attempt's log. Reading the log from offset 0 fails it.

Limits of the fix, also in the PR body:

  • It fails the attempt but does not prevent the run on the other browser. Only an ownership proof does that, so Prove native CDP server ownership before using a connection #170 stays open.
  • A caller that finishes before the server exits still returns with no error. I forced this with real Moli by delaying the server start 100 ms: a body of a local page plus 50 ms returned silently in 10 of 10 runs, and with 200 ms or 500 ms added, all 10 failed.
  • A server that exits for any other reason during the call now also fails the call, even if the result was already complete.
  • I could not reproduce the 28 of 30 rate. My idle-host repeat restarted 30 of 30, and a failed bind exit and a handshake are nearly tied (medians 9.7 ms and 9.3 ms). Obscura's normal path was not exercised, because its private-network guard rejected the local test page.

CI on 63648668: "Tests and static checks" and "Installation and packaging" pass.

@lanyue-llk lanyue-llk left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent review, round 3

Head 63648668. No defects found. I did not approve or request changes.

What I verified

CI: all checks pass on this head: Tests and static checks, Installation and packaging, Rendered reference and report checks, Python 3.11. main is still the PR's base (a239d1cc).

Local runs (Python 3.11, locked environment):

  • Both ruff gates pass.
  • test_native_cdp_port.py, test_golden_reports.py, test_catalog_report.py, test_catalog_contracts.py, web_search/test_review.py and test_review_runner.py: 108 passed.
  • No golden route hash changed.

Real binaries, using native_cdp_browser with real Playwright and a local page, 5 runs each:

Engine Result
Obscura, with allow_private_network 5 of 5 completed
Lightpanda 5 of 5 completed
Moli 5 of 5 completed

No run failed falsely on the new exit check. The Obscura run covers the normal path that the PR's test plan says it could not exercise, because setting allow_private_network lets it load the local page.

Address-in-use detection: I started each binary with the flags native_cdp_browser passes, on a held port. Each one exited with code 1, and its log matches _ADDRESS_IN_USE. This includes Obscura with --quiet and Lightpanda's address already in use log.

Mutations, each failing a test in the file named:

Change Test file
Remove sessions.kill from the finally web_search/test_review.py
Make ReviewerSessions.kill skip the kill test_review_runner.py, web_search/test_review.py
Remove the exit check after yield test_native_cdp_port.py
Keep a connection after the server has exited test_native_cdp_port.py
Remove the attempt bound test_native_cdp_port.py
Remove the Moli diagnostic log capture test_native_cdp_port.py
Skip stopping the server test_native_cdp_port.py

What I checked by reading the code

  • Exit check reaches the result: a return inside the with in headless_worker.fetch still runs the exit check. The RuntimeError reaches the except Exception there and becomes ok=False with error_type=browser_error.
  • Multi-attempt Moli log: the extra bind-failure line is harmless to main_document_url_from_fetch_log, which only matches specific DEBUG lines.
  • Catalog P95:
    • percentile is nearest rank, and rounding to 2 places does not change the .2f output.
    • _catalog_percentile has no remaining references.
    • catalog_release.py and catalog_contracts.py do not read P95.
    • No file under evaluation/ contains a report_archive_sha256 binding.
  • DockerBackend.find_free_port: no caller remains. The pinned package only defines its own copy and declares the method on its protocol.
  • readiness_retries: it has one assignment in the try, and the initial value matches the old fallback.
  • id(request): the recorder stores each registered request in _playwright_request_objects for its lifetime, as the PR says.
  • Review job: finally keeps a completed state and only overwrites a state that is not completed. The default failure message is asserted for an unexpected error.
  • Issues section: every #165 item has a result in the PR, and #170 holds the measurements and the remaining ownership gap, so Closes #165 is accurate.
  • Public repository rules: no attribution lines in commits, and no local paths or usernames in the diff.

Limits of this review

I did not run the full suite locally. CI is the gate for that. I also did not repeat the round 2 measurements for a second real CDP server on the forced port.

lanyue-llk added a commit that referenced this pull request Nov 3, 2026
…hare catalog P95

Restart a native CDP server on a new port when it reports that another process took the chosen port, and stop trusting an answer on that port once the server has exited.

Record a terminal state and reap the reviewer on every web search review job exit path, and treat KeyError and TypeError from a malformed opinion as a failed job.

Use the shared nearest-rank percentile for the catalog report P95, and replace locals().get with an initialized variable in the replay runner.
…shake first

A foreign listener can fail the handshake while the server is still reporting its failed bind. Give the server a short grace to exit before raising, so that case reaches the restart path.
…out a port conflict

A server that exited during the grace period discarded the handshake error, so a silent exit raised an empty RuntimeError. Re-raise the handshake error unless the attempt log reports a lost port, and name the exit code when a server exits silently before any handshake.
Nothing calls it, here or in the pinned webarena_verified package. The upstream ContainerBackend protocol still declares it, but that protocol is not runtime-checked and this repository runs no static type check.
@lanyue-llk
lanyue-llk force-pushed the fix/runtime-code-items branch from 6364866 to 439c302 Compare November 3, 2026 16:10

@lexmount-ocr lexmount-ocr Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Review complete · 439c302

No findings in this review.

@lanyue-llk
lanyue-llk merged commit 6f801e0 into main Nov 3, 2026
7 checks passed
@lanyue-llk
lanyue-llk deleted the fix/runtime-code-items branch November 3, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix the remaining code items from the #94 runtime bug follow-up

1 participant