Skip to content

Studio: keep text typed into a browser panel page when switching tabs - #14280

Merged
Lyxot merged 9 commits into
unslothai:mainfrom
NilayYadav:keep-form-input-hidden-tabs
Oct 20, 2026
Merged

Lyxot merged 9 commits into
unslothai:mainfrom
NilayYadav:keep-form-input-hidden-tabs

Conversation

@NilayYadav

Copy link
Copy Markdown
Collaborator

Text typed into a page in the browser panel was lost after switching between three or more tabs. Filling in a form or a comment, then checking something in two other tabs, brought back a blank form scrolled to the top. To save work on the chat's thread, the panel keeps only the newest hidden page running and rebuilds the others from the saved page, which has no typed values.

A page now tells the panel the first time the reader types into it, and the panel keeps that page running while it is hidden, so the text and scroll position are still there on return. Only the three pages typed into most recently are kept this way. Older ones and pages nobody typed into keep the current limit, and going to another address or reloading clears the mark.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 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 ⚠️ Failed 2026-10-20T14:20:02.434415Z 2405297 New commits
ℹ️ 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.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@NilayYadav

Copy link
Copy Markdown
Collaborator 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: 99d9fefa8c

ℹ️ 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 studio/backend/routes/browser.py Resolved
@NilayYadav

Copy link
Copy Markdown
Collaborator Author

@codex review

1 similar comment
@NilayYadav

Copy link
Copy Markdown
Collaborator 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: 99d9fefa8c

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 99d9fefa8c

ℹ️ 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".

@NilayYadav

Copy link
Copy Markdown
Collaborator Author

@codex review

1 similar comment
@NilayYadav

Copy link
Copy Markdown
Collaborator Author

@codex review

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 20, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 20, 2026
@NilayYadav

Copy link
Copy Markdown
Collaborator Author

@codex review

1 similar comment
@NilayYadav

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 2865a99ece

ℹ️ 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".

@NilayYadav

Copy link
Copy Markdown
Collaborator Author

Review + reproduction evidence

Pinned review: 2865a99ec. 3 findings, fixed in 24d9cf5 and 99d9fef; 1 low-priority follow-up: the visible page can still mark itself typed within about 5 s of real input.

I reproduced typing into a form in the browser panel, opening two more tabs and coming back, on the merge base 2429c7a (Linux, Chromium and Firefox, 1440x900):

  • Before (run): Customer name and Delivery instructions on httpbin.org/forms/post come back empty; the new tests fail at MAX_TYPED_PAGES in browser-panel.tsx.
  • PR head (run): the fields still hold "Nilay test 14280" and "ring twice"; Linux, macOS, Windows and the Playwright leg pass.

Back on the httpbin.org tab after example.com and Wikipedia Banana: main 2429c7a shows empty fields, PR #14280 2865a99 keeps "Nilay test 14280" and "ring twice"

  • Two tabs, Reload, untyped tabs and closing a tab behave the same before and after; with four typed tabs the newest three keep their text.
  • All 238 browser frontend tests and 97 backend route tests pass; the startup bundle stays within budget (6683.7 KB raw, 0.1 KB to spare).

Conclusion: the bug is real and fixed; CI on the current head is green, ready to merge.

@Lyxot

Lyxot commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

Pushed the local review fixes in fffead3 and integrated main in 34a5f2b: authenticate typing notices, clear draft protection on SPA navigation, and ask before evicting a typed page while keeping the five-page live limit. Added re-edit/eviction regression coverage. Local checks passed: 23 frontend tests, 100 backend tests, 31 mutation checks, and Chromium/Firefox/WebKit reproductions. Both open review threads have been checked and resolved; the embedded-iframe limitation is explained in its thread. Current main is only one commit ahead and merges cleanly.

@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: 34a5f2b03b

ℹ️ 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".

@Lyxot

Lyxot commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Fixed the confirmed frame-teardown finding in 4c1fb51: discarded pages release draft protection, so reopening the panel cannot prompt about text that no longer exists. Also integrated the newer URL-shim change from main and supplied its VM test globals, preserving all assertions. Selected checks pass: 30 frontend tests, 100 backend tests, typecheck/build, 31 frontend mutations, and teardown/reopen checks in Chromium/Firefox/WebKit. The clean whole-branch reviewer reported no findings. Staging PR #183 mirrors this head and is rerunning CI.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 4c1fb51072

ℹ️ 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".

Identical Node 22.23.2 builds of main c280b6f and its merge with 4c1fb51 measure 6,844,622 to 6,844,943 raw bytes and 2,061,061 to 2,061,185 compressed bytes, with 96 startup chunks in both. The raw growth is 276 bytes of English eviction-dialog text and 45 bytes in the draft store. Increase the limits by exactly 321 raw bytes and 124 compressed bytes to preserve the existing margin.
@Lyxot

Lyxot commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

Accounted for the startup bundle cost in 182be5e. Identical Node 22 builds of main and the proposed merge measure +321 raw bytes (+276 English eviction text, +45 draft-store logic) and +124 compressed bytes, still 96 startup chunks. The two limits increase by exactly those deltas, preserving the existing margin. All 43 bundle-gate tests and the actual budget check pass; a clean whole-branch reviewer found no issues. No application behavior or test assertions changed. Staging mirrors the new head and CI is rerunning.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 182be5e884

ℹ️ 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".

@Lyxot

Lyxot commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

Verified head 182be5e884.

  • Codex: Didn't find any major issues.
  • Staging CI: 55 successful, 3 skipped, 1 neutral, no failures. Frontend, backend and cross-platform composer jobs passed. CodeQL's neutral comparison reports unmatched Actions/Rust configurations.
  • Staging PR #183 is closed and its temporary branch removed. It tested the same head and matching merge tree d524537ed2.

The local fixes are pushed: authenticated edit notices, SPA resets and explicit draft-eviction consent. During live review, I also fixed stale marks when frames unmount, supplied the URL-shim VM test globals, and accounted for the measured +321 raw/+124 compressed startup bytes while preserving the budget margin.

All checked review threads are resolved. Embedded iframe detection remains a separate follow-up, with the reason explained in its thread. Latest main is five commits ahead and merges cleanly, so no further main merge was needed under the requested rule.

danielhanchen added a commit that referenced this pull request Oct 20, 2026
…e vision results atomically (#14334)

## Problem

`Repo tests (CPU, fsdp2)`, the shard added with #14273, failed on two of
the first three PRs that ran it, each time in a test unrelated to the
PR:

- #14326:
`test_fsdp2_native_submesh_gloo.py::test_replicated_grads_average_over_the_model_mesh_only`
  ```
torch.distributed.DistNetworkError: The server socket has failed to
listen on any local network address. port: 33653, useIpv6: false, code:
-98, name: EADDRINUSE
  ```
- #14280:
`test_fsdp2_native_vision_gloo.py::test_without_dummy_vision_desyncs[lora-blocks]`
  ```
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  ```

Two separate causes:

1. **Port race.** Each distributed test picks `MASTER_PORT` with
`bind(("127.0.0.1", 0))` and closes the socket before rank 0 listens.
`bind(0)` returns a port from the kernel's ephemeral range (32768-60999
on Linux), which is also where gloo's own peer connections get their
local ports. Those connections come from this test and from the other
three xdist workers running the same kind of test, so one of them can
take the port first.
2. **Half-written result.** The vision harness kills a surviving rank as
soon as its peer dies (the expected failure mode in the desync cases). A
rank killed inside `json.dump` leaves an empty `result.json.<rank>`,
which the reader parsed and crashed on instead of taking its "no result"
branch.

## Fix

- `tests/_rendezvous_port.py` (new): picks a free port from 20000-31999,
below every OS's default ephemeral range (Linux 32768+, macOS and
Windows 49152+). Each xdist worker draws from its own 1000-port slice,
so two tests running side by side cannot pick the same port either.
Taken or TIME_WAIT ports are skipped, and `bind(0)` remains the fallback
if a slice is exhausted.
- The `_free_port()` helper in the 18 distributed test files (the FSDP2,
context-parallel and GRPO scoring-head ones that set `MASTER_PORT`) now
returns that port. Their unused `socket` imports are dropped.
- `test_fsdp2_native_vision_gloo.py`: each rank writes its result to a
temp file and `os.replace`s it into place, and the reader treats
unreadable JSON like a missing file.

Test-only; no product code changes.

## Testing

- `tests/test_rendezvous_port.py` (new, 3 tests): the port is below
32768 and inside the worker's slice, the no-xdist case uses the first
slice, and a port with a listener on it is skipped. With the old
`bind(0)` helper all three fail.
- `ruff check` passes on every touched file, and the formatter is a
fixed point.
- The changed distributed tests run on staging CI, linked below. A local
run was not usable: this host's spawned ranks import a stale checkout of
`unsloth_zoo`, which is unrelated to the change.
Preserve the latest main startup limits plus the measured 321 raw bytes and 124 transfer bytes for browser draft retention. The reviewed browser patch is unchanged; main also includes the FSDP2 result-file race fix.

@Lyxot Lyxot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed and verified. Browser retention and security checks pass; all review threads are resolved. The latest main is included, including the fix for the unrelated FSDP2 CI failure. The only manual merge resolution preserves the measured startup-budget increase.

@Lyxot
Lyxot merged commit 3c8ffe3 into unslothai:main Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants