test(browser): require Agent Task browser-process termination evidence - #142
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| with stat_path.open("r", encoding="utf-8", errors="strict") as stat_file: | ||
| stat_text = stat_file.read(MAX_PROC_STAT_CHARACTERS + 1) |
There was a problem hiding this comment.
📝 Info: Strict UTF-8 decode of stat can raise on PID reuse
_read_linux_proc_stat_process_identity reads the stat file with errors="strict". If the polled PID is reused during the wait by a process whose comm holds non-UTF-8 bytes, the decode raises and escapes _wait_for_linux_process_identity_exit instead of counting as termination. The reuse window is short and the browser is ASCII-named, so this is not treated as a bug.
Was this helpful? React with 👍 or 👎 to provide feedback.
| if not _wait_for_linux_process_identity_exit( | ||
| browser_process_id, | ||
| browser_process_start_time_ticks, | ||
| ): | ||
| raise RuntimeError("Agent Task browser process did not terminate") |
There was a problem hiding this comment.
📝 Info: Fixed 5s termination wait is a flakiness watch-point
_wait_for_linux_process_identity_exit allows 5s for the browser root to exit after session DELETE and driver shutdown. Under heavy CI load or slow headless shutdown, a still-live root at the deadline fails an otherwise-passing trial and the aggregate gate. Generous after graceful deletion, but worth watching for flakiness.
Was this helpful? React with 👍 or 👎 to provide feedback.
Partial implementation of #28, dependency-realigned on the current PR #141 head
bc9b265f31f2c4c7ddb700e865ec1f7b3daa6b01.Buyer/reliability boundary
The controlled pinned-Chromium Agent Task must prove that the Chrome root process actually terminates after session/driver shutdown. Temporary-profile deletion alone is not sufficient because a surviving browser process can retain resources or task state.
Implemented contract
The runner:
/proc/<pid>/statstart-time identity;browser_process_terminated: trueonly after the exact identity has ended.TDD provenance
Exact test-only RED head
146f742b140b54577b1e349be9c4a815fd6691d9established the missing PID/start-time/process-exit contract before production support existed. Subsequent commits implemented and hardened the boundary.Stack repair
The prior branch head was still rooted at obsolete PR #141 head
42af52f77336112c4fbe1da5c5283899f6bd288e. GitHub's clean synthetic merge of that child with live #141 produced tree642f8ed67ff1bb791504d21b9f1460e967c52243; this branch was then advanced non-destructively with merge commit6c01e5370b0001c58f89cd772cbaf62e197db9f5, preserving the child delta while incorporating live #141.Fresh ancestry now reports live #141 as the merge base with the branch ahead-only; no predecessor CI/review evidence is transferred.
Exact-current proof
On unchanged exact head
6c01e5370b0001c58f89cd772cbaf62e197db9f5against exact live basebc9b265f31f2c4c7ddb700e865ec1f7b3daa6b01:32606849757: success;97113009399: checkout, Python repository contracts, formatting, workspace/all-target check, full tests, strict Clippy, and rustdoc success;97113009621: exact production function/line/region/branch measurement and enforcement success;32606849733: success;No prerequisite result, predecessor result, synthetic merge result, status, comment, or model output is treated as approval.
Stack / authority
This PR remains Draft while #141 and its prerequisite stack remain active. PR #143 is a descendant and is being revalidated independently on its own fresh head. No merge, approval, workflow, secret, ruleset, tag, release, or publication mutation is included.
Truth boundary
This lane proves termination of the exact Chrome root identity for the controlled Linux Agent Task path. Descendant-process-set teardown, broader process ownership, cross-platform supervision, authenticated browser provenance, and OS-wide orphan absence remain separate boundaries.