Skip to content

fix(browser): keep background QA usable and restore saved handoffs - #325

Merged
lastobelus merged 8 commits into
lastcode/mainfrom
lastcode/reliable-background-qa
Oct 7, 2026
Merged

lastobelus merged 8 commits into
lastcode/mainfrom
lastcode/reliable-background-qa

Conversation

@lastobelus

@lastobelus lastobelus commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Background browser QA could stall on a hidden-tab capture, disconnect unrelated automation, or require opening the owning thread before its tab existed. Saved QA handoffs also stopped being recoverable after their 24-hour process lease and could lose browser authentication before a person returned.

This keeps browser hosting subscribed outside chat views, acquires bounded native rendering surfaces, measures the applied viewport, and cancels expired work without replaying mutations or evicting unrelated hosts. Retained handoffs now outlive their processes: opening the saved link or panel restores the process and renews opted-in T3 development browser access. Healthy open forms are preserved. QA guidance selects ordinary and authenticated profiles explicitly and prepares manual QA without requesting a review window.

Fixes #287. Named profile selection itself was delivered in #315; this completes its background reliability and evidence-upload workflow.

Validation:

  • Hidden ordinary Electron window: real screenshots at 390×844 CSS pixels, native screencast frame/ACK/stop, file input and file chooser upload, isolated profile cookies, and recovery after an injected capture stall.
  • Integrated web client: live streamed page and reopening an existing handoff without a duplicate tab or reload.
  • Focused server, native, hosting, client, and instruction tests; server/contracts/desktop/web/mobile typechecks; independent implementation review and recheck.
  • Before: a screenshot timeout stranded subsequent evaluation; resize reported 1280×800 when page metrics were 390×844. After: native metrics and pixels agree and the same/other tab remain usable after cancellation. OS-minimized behavior is not claimed by the hidden-window fixture.

Native hidden-window capture (390×844 CSS pixels at 2× device scale):

Native browser fixture with verified mobile viewport

Upstream provenance (adapted, with additional native rendering, cancellation, and epoch fencing fixes):

The guarded merge command also accepts --skip-checkpoint so an explicitly deferred checkpoint is not requested after merging; CI, review, and merge guards remain intact. No package build, installation, or restart is part of this delivery.

Implemented with GPT-6-Astra and GPT-6.1-Sol through the Codex harness; Luna agents audited code/history/guidance, and Astra independently reviewed the implementation.

Keep desktop browser hosting subscribed outside chat views and acquire bounded native rendering surfaces for background operations. Measure the applied viewport, skip unwanted image capture, and revoke timed-out work without disconnecting unrelated tabs. Dispose late recording resources and release capture/control queues after cancellation.

Adapt the pinned upstream cancellation and root-subscription proposals, with local native rendering and recording cleanup extensions. Validate hidden Electron pixels, viewport geometry, uploads, profile isolation, screencast frames, and stalled-command recovery.

Carry-Group: upstream-bugfixes
Carry-Upstream: https://redirect.github.com/pingdotgg/t3code/pull/16941 head=f88dc5fb4c6b91bd5715d3aacf5f931bb1fba6b9
Carry-Upstream: https://redirect.github.com/pingdotgg/t3code/pull/16620 head=1722a7ae9060883d71d3ba06872c54076dec6bf1
Carry-Observation: Adapted imports; native paint readiness, measured viewport, late-resource cleanup, and restart-epoch fencing extend those upstream proposals.
Separate the lifetime of a QA handoff from its running process. Retain the launch recipe and source until explicit stop or thread deletion; put idle processes to sleep and restore them when the saved link or panel is opened. Opted-in development previews mint fresh browser access without persisting credentials in links or history.

Wait for streamed browser control before dispatching recovery, preserve healthy forms, and let newer user navigation win. Keep interrupted startup cleanup reliable even when persistence fails. Prepare manual QA unattended and select authenticated browser profiles explicitly.

Carry-Group: incubator
Carry-Observation: Retained handoff lifecycle, browser authentication bootstrap, and client reopening form one feature across server, contracts, and clients. Process deadlines no longer revoke saved QA recipes.
Use the workspace Vite executable for managed launches, retain clean authenticated handoffs, and separate QA preparation from human acceptance. Keep normal QA in its own profile and bound cross-thread recovery requests.

Carry-Group: tooling
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T22:53:03.216363Z 1aecc82 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 92ef164d66

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/web/src/browserHistoryStore.ts Resolved
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ff334dce6d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 1aecc826d8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lastobelus
lastobelus merged commit 46ef0fb into lastcode/main Oct 7, 2026
17 checks passed
@lastobelus
lastobelus deleted the lastcode/reliable-background-qa branch October 7, 2026 22:58
lastobelus added a commit that referenced this pull request Nov 16, 2026
Background QA carried two queue-deadline designs side by side: upstream's numeric deadline and LastCode's signal-aware overload of `SessionControl.agent`. This goes back to upstream's API and keeps cancellation at the existing native-operation boundary.

## 🔎 Why

- **Overlap:** upstream https://redirect.github.com/pingdotgg/t3code/pull/16941 (merged commit `8f947a313b29c30c1deb9960ea0450482cb6e19f`) is an ancestor of both `origin/main` and the LastCode base `6cd814fceafb68cfd26d475e2a1f038b88f2c534`.
- **Duplicate API:** the original carry `f18ac3cc1fee9fe4aa213415faa0660ba4df993b` (LastCode #325, imported at pinned head `f88dc5fb4c6b91bd5715d3aacf5f931bb1fba6b9`) added signal-aware queue handling. The combined queue retained a `number | AbortSignal` overload alongside upstream's deadline API.

## 🛠 What changed

- **`SessionControl.agent(agentId, run, deadlineMs?)`:** restored to upstream's signature. The number-or-`AbortSignal` overload is gone.
- **`ServerBrowser` call sites:** the 2 signal arguments are removed.
- **Cancellation:** unchanged. The existing `withNativeSurface` abort gate and page/broker cancellation stay.
- **Tests:** in the existing suites.
  - Restored upstream's numeric-deadline regression case.
  - Removed the obsolete signal-only case.
  - Kept the handoff regression.
  - Extended the existing queued recording-stop case to show that expired input is skipped before the numeric deadline, cleanup drains, and fresh input still works.
- **Not touched:** initial-navigation tracking and the recording-stop exception already match upstream. No frontend or contract changes.

## 📌 Still carried beyond upstream

Upstream's deadline only stops expired queued work from *starting*. It doesn't cover hidden painting or work that is already running, so these stay:

- Native rendering leases, unthrottling and measured viewport.
- Root host subscriptions across thread switches, with epoch fencing. Provenance: https://redirect.github.com/pingdotgg/t3code/pull/16620 at pinned head `1722a7ae9060883d71d3ba06872c54076dec6bf1`. This is carried separately and is not part of this overlap.
- Broker request retirement without disconnecting unrelated tabs.
- Stalled CDP/page cancellation and late recording-resource cleanup.

## ✅ Proof

- Changed-file checks: 407 tests passed, scoped format/lint, both unused-code checks, generated GraphQL check, and affected typechecks passed.
- Quick local CI: passed for `6678ee249474e65cab44dff5a8bed1eeb3e1e16f` against `6cd814fceafb68cfd26d475e2a1f038b88f2c534`.
- Exact same-base carry replay: passed; compiled tree equals the PR tree.
- Direct Node runtime transcript: `running -> finished -> expired-skipped -> recording-cleanup -> fresh-input`.

Local review: 1 rounds with gpt-6.1-terra (xhigh), approved.

## CI fixture repairs

CI also exposed two failures already present on the base. The browser dialog mock intercepted background title watches as well as the dialog expression; it now blocks only that expression. The dev-runner shutdown fixture invoked Cargo on cold checkouts before reaching its fake process tree; it now stubs Cargo and includes captured output in startup failures. Neither repair changes production behavior.

## 🔗 Tracking

Partial audit work for #720. That issue also covers other ongoing audit decisions, so this PR does not close it.

Implemented with GPT-6.1 Sol through the Codex harness in T3 Code.

Carry-Source-Ref: refs/lastcode/carry-sources/pr-740/6678ee249474e65cab44dff5a8bed1eeb3e1e16f
Carry-Source-Base: 6cd814f
Carry-Source-Head: 6678ee2
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(preview): recover browser automation and support reusable signed-in profiles

1 participant