Skip to content

test(browser): require Agent Task browser-process termination evidence - #142

Open
seonghobae wants to merge 5 commits into
test/mv3-failure-profile-cleanup-evidencefrom
test/agent-task-browser-process-termination-evidence
Open

test(browser): require Agent Task browser-process termination evidence#142
seonghobae wants to merge 5 commits into
test/mv3-failure-profile-cleanup-evidencefrom
test/agent-task-browser-process-termination-evidence

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

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:

  • binds the ChromeDriver-reported positive browser PID to its exact Linux /proc/<pid>/stat start-time identity;
  • parses command text containing spaces or closing-parenthesis characters without confusing fixed proc-stat suffix fields;
  • applies bounded process-exit waiting;
  • treats PID absence or reuse with a different start time as termination of the original identity;
  • fails closed when the same PID/start-time identity remains live at the deadline; and
  • emits browser_process_terminated: true only after the exact identity has ended.

TDD provenance

Exact test-only RED head 146f742b140b54577b1e349be9c4a815fd6691d9 established 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 tree 642f8ed67ff1bb791504d21b9f1460e967c52243; this branch was then advanced non-destructively with merge commit 6c01e5370b0001c58f89cd772cbaf62e197db9f5, 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 6c01e5370b0001c58f89cd772cbaf62e197db9f5 against exact live base bc9b265f31f2c4c7ddb700e865ec1f7b3daa6b01:

  • CI run 32606849757: success;
  • Rust contracts job 97113009399: checkout, Python repository contracts, formatting, workspace/all-target check, full tests, strict Clippy, and rustdoc success;
  • Production coverage job 97113009621: exact production function/line/region/branch measurement and enforcement success;
  • Manifest V3 Compatibility run 32606849733: success;
  • current formal reviews: none;
  • current inline review threads: none;
  • GitHub reports the Draft mergeable against its exact live prerequisite.

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.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d9d75a9e-20db-4d7c-99f1-0fe0a988d39b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@seonghobae
seonghobae marked this pull request as ready for review August 26, 2026 22:05

@devin-ai-integration devin-ai-integration 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.

Devin Review found 2 potential issues.

Open in Devin Review

Comment on lines +457 to +458
with stat_path.open("r", encoding="utf-8", errors="strict") as stat_file:
stat_text = stat_file.read(MAX_PROC_STAT_CHARACTERS + 1)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📝 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.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +1159 to +1163
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")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📝 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.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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.

1 participant