feat(browser): retain cleanup evidence for failed Agent Tasks - #139
Draft
seonghobae wants to merge 8 commits into
Draft
feat(browser): retain cleanup evidence for failed Agent Tasks#139seonghobae wants to merge 8 commits into
seonghobae wants to merge 8 commits into
Conversation
|
Important Review skippedDraft detected. 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 |
This was referenced Aug 13, 2026
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.
Partial implementation of #28, stacked on unchanged exact PR #136 head
1deca80bf6a67394e25a2c914b76d490c2aad960.Buyer/reliability gap
The controlled Agent Task runner previously discarded temporary-profile cleanup evidence whenever either the ordinary browser pass or forced-close probe failed. Outer loops retained only trial number, failure state, and exception type, while cleanup/isolation checks filtered to successful trials. A failed or interrupted task could therefore lack credential-free teardown evidence even though #28 requires deterministic failure/recovery and no leaked task profile.
Dependency and writer alignment
This Draft targets unchanged exact #136 head
1deca80bf6a67394e25a2c914b76d490c2aad960and must remain Draft while #136/#132 and their prerequisites remain active. Earlier independent prerequisite movements were incorporated through normal non-destructive two-parent merge commits. Current exact head499a6499112a11094279a1386238e26987d771d5contains the current base as ancestry. No force-push, destructive rebase, base mutation, or predecessor evidence transfer occurred.TDD and RCA sequence
7e1db77e82dae1d43fdf57c20c54337678f3799crequired_run_agent_task_trialto retain bounded cleanup evidence after a controlled browser-pass failure and required an all-trial cleanup gate. CI31655752094, Rust contracts94309699104, failed exactly the two intended Python boundaries: the mockedRuntimeErrorescaped and aggregate cleanup proof did not exist. This is the first valid RED.c6c491ff794323bec5de19d7ece415f89d708d28added bounded ordinary-trial failure evidence and all-trial cleanup gating; merge-alignment head56ed81c52395ff6e61ab9efd76493fea32445af1was exact-green in CI31656517616and MV331656517683._run_agent_task_forced_close_trial. Test headb6583d54d5ccbf2d8028e51035fb5fe20100d6a9added forced-close failure and cleanup-gate requirements. CI31656775065, Rust contracts94312873184, passed repository setup and failed exactly because the forced-close exception still escaped and the dedicated evidence/gate were absent. This is the second valid RED.4b474260e777c84335636b2fbd732a00e48159d4added forced-close failure cleanup evidence and a separate all-trial forced-close cleanup gate; CI31657248055and MV331657248068succeeded.499a6499112a11094279a1386238e26987d771d5adds only the truthful Unreleased changelog entry covering ordinary and forced-close failure cleanup evidence.Implemented contract
Both
_run_agent_task_trialand_run_agent_task_forced_close_trialnow:OSError,ValueError,RuntimeError,json.JSONDecodeError) inside theTemporaryDirectorylifecycle;passed: false, failure type,profile_cleaned: true, and duration when browser work fails but teardown succeeds;profile_cleaned: true; andAggregate evidence now computes cleanup across every ordinary and forced-close trial, emits both cleanup results, and applies distinct fail-closed ordinary and forced-close cleanup gates before repeatability/recovery acceptance. An outer failure without cleanup proof therefore fails closed rather than inventing teardown success.
Exact-head proof
On unchanged exact head
499a6499112a11094279a1386238e26987d771d5against unchanged exact prerequisite1deca80bf6a67394e25a2c914b76d490c2aad960:31657489713: success;94315047896: repository contracts, formatting, locked workspace/all-target check, full tests, strict Clippy, and rustdoc success;94315047798: exact owned production function/line/region/branch enforcement success;31657489637: success;No predecessor-head, prerequisite, synthetic-merge, skipped, cancelled, absent, pending, or stale evidence is promoted as current proof.
Truth boundary
This lane records controlled temporary-profile teardown evidence only. It does not prove process termination, adversarial filesystem erasure, deletion of every browser artifact, operating-system keychain cleanup, renderer-crash attribution, arbitrary-task recovery, browser/adapter authenticity, policy authorization, durable incident evidence, or #28 completion. A production runtime still needs trusted task/process ownership, durable recovery evidence, and separately reviewed cleanup/retention semantics.