Skip to content

fix: keep browser tools when resuming a task - #2109

Merged
Douglasymlai merged 7 commits into
mainfrom
fix/resume-browser-tools
Oct 27, 2026
Merged

Douglasymlai merged 7 commits into
mainfrom
fix/resume-browser-tools

Conversation

@Douglasymlai

@Douglasymlai Douglasymlai commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Pull Request

Related Issue

N/A — maintainer-directed repair; no linked issue required for this PR.

Description

Problem

Resume sends no new message, so the browser-intent check had nothing to read. A task that had been using the browser could restart without its browser tools, and the agent then asked the user to check the page.

Cause

The decision to reconnect the embedded browser looked only at the newly submitted message. On Resume that message is empty, so no Eigent-owned browser target was sent and the browser tools were left out of the resumed attempt.

Fix

  • On Resume, decide whether to reconnect the browser from the original request plus the run's recorded browser use (browser tool calls or browser tools offered to the model). Hints from another Session are ignored.
  • GET /runs/{id}?include_browser_evidence=true reports used_browser. Only Resume asks for it, so other run-summary readers skip the extra lookup.
  • The lookup is best-effort. It is cancelled after 1.5 s, and Resume continues from the original request if it fails, times out or answers late.
  • If no Eigent-owned browser target is available, resumed agents are told the browser could not be reconnected. They tell the user only if their remaining work needs it, and never claim to have opened a page.
  • The browser-intent rules for new tasks are unchanged.
  • The existing browser ownership and authorization gate is unchanged. History only asks for a reconnect; it never grants browser access.

Testing Evidence (REQUIRED)

  • Focused frontend suites (chat store, browser runtime, failure facts, run-state reconciliation, interrupted-run banner): 350 passed. They cover:

    • original intent and recorded browser use without keywords
    • foreign-Session evidence and unavailable targets
    • a failed lookup
    • a stalled lookup bounded by the timeout, with late success and late rejection ignored
  • Focused backend tests (run controller, run control API, agent model): 87 passed. The run-journal suite gave 328 passed, 1 skipped.

  • Removing the timeout makes the three stalled-lookup tests fail. Removing the recorded-use hint makes the two recorded-use tests fail.

  • Type checking, focused ESLint/Prettier, Ruff and git diff --check passed.

  • Real Electron fixture: the production WebViewManager, intent check and resolver returned an exact owned target for original intent and for recorded browser use; destroying the view returned no targets.

  • A development Electron run with a real model passed Quit → relaunch → Resume on a browser task. Both attempts had the same 62 tools, including the browser tools, and the resumed attempt read a page heading changed while the app was closed. That run was on the build before the final refactor (which moved the browser-use lookup behind the query flag and reworded the unavailable-browser instruction). It was not repeated after the refactor.

  • I have included human-verified testing evidence in this PR.

  • This PR includes frontend/UI changes, and I attached screenshot(s) or screen recording(s).

  • No frontend/UI changes in this PR.

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Contribution Guidelines Acknowledgement

@Douglasymlai
Douglasymlai marked this pull request as ready for review October 25, 2026 17:33
@Douglasymlai Douglasymlai self-assigned this Oct 25, 2026
@Douglasymlai
Douglasymlai merged commit a46f680 into main Oct 27, 2026
10 checks passed
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