GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(web): a finished pairing no longer closes a newly opened Add Environment dialog by StiensWout · Pull Request #39089 · pingdotgg/t3code

Conversation

@StiensWout

@StiensWout StiensWout commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Direct pairing, SSH connection, and T3 Connect route registration could finish after dismissal and close a reopened Add Environment dialog or show an inline error from the previous attempt. The dialog now checks that the opening which started the attempt is still current before closing or showing an inline error. Successful operations still show their confirmation, and a T3 Connect route registration that fails after dismissal reports the failure in a toast.

Fixes #39088
Related: #26757

Reproduction on main

Commit dcaff67177 (main). The first pairing finishes and closes the dialog you reopened. The cause is at apps/web/src/components/settings/AddEnvironmentDialog.tsx:270. Ran pnpm scenarios:prove scripts/scenarios/finished-pairing-keeps-reopened-dialog.e2e.ts --base main with the repro test added: it failed in 2 of 2 runs on a clean checkout, with Add Environment in the output.

Evidence

Environment: boat.dev default machine, Linux x64, a fresh checkout of each commit

Steps: A finished pairing leaves the reopened Add Environment dialog open: browser.route "http://127.0.0.1:34499/.well-known/t3/environment"; app.open ; expect.not.toHaveURL //pair(?:[?#]|$)/; app.open /settings/connections; locator.tap locator("#remote-environments button[aria-label="Add environment"]"); locator.fill getByRole("dialog", name: "Add Environment") >> getByPlaceholder("backend.example.com"); locator.fill getByRole("dialog", name: "Add Environment") >> getByPlaceholder("PAIRCODE"); locator.tap getByRole("dialog", name: "Add Environment") >> getByRole("button", name: "Add environment"); locator.tap getByRole("dialog", name: "Add Environment") >> getByRole("button", name: "Close"); locator.waitFor getByRole("dialog", name: "Add Environment") → hidden; locator.tap locator("#remote-environments button[aria-label="Add environment"]"); locator.waitFor getByRole("dialog", name: "Add Environment") → visible; locator.waitFor getByText("Backend added") → visible; locator.waitFor locator("#remote-environments") >> getByText(/\bConnected\b/) → visible; app.screenshot after-first-pairing-finishes; expect.toBeVisible getByRole("dialog", name: "Add Environment").

Proven: the scenario fails on base 475ae52ac2 and passes on head 25ef7293bd.

Before After
Commit 475ae52ac2 25ef7293bd
Result Fails: ASSERTION_FAILED: expect.toBeVisible failed Passes
after first pairing finishes Before: after first pairing finishes After: after first pairing finishes
failure Before: failure
Recording Before: Recording After: Recording
Scenario source: scripts/scenarios/finished-pairing-keeps-reopened-dialog.e2e.ts
import { expect } from "e2e";

import { startSecondServer } from "./second-server.ts";
import { test, WEB } from "./t3.ts";

test(
  "A finished pairing leaves the reopened Add Environment dialog open",
  WEB,
  async ({ t3, app, screen, browser }) => {
    await t3.project("demo");
    const server = startSecondServer(app.baseUrl ?? "");
    const pairingStarted = Promise.withResolvers<void>();
    const releasePairing = Promise.withResolvers<void>();
    try {
      const { host, token } = await server.ready;
      await browser.route(`${host}/.well-known/t3/environment`, async (route) => {
        pairingStarted.resolve();
        await releasePairing.promise;
        await route.continue();
      });

      await t3.open("/settings/connections");
      const open = browser.locator('#remote-environments button[aria-label="Add environment"]');
      const dialog = screen.getByRole("dialog", "Add Environment");
      await open.tap();
      await dialog.getByPlaceholder("backend.example.com").fill(host);
      await dialog.getByPlaceholder("PAIRCODE").fill(token);
      await dialog.getByRole("button", "Add environment").tap();
      await pairingStarted.promise;

      await dialog.getByRole("button", "Close", { exact: true }).tap();
      await dialog.waitFor({ state: "hidden" });
      await open.tap();
      await dialog.waitFor();

      releasePairing.resolve();
      await screen.getByText("Backend added", { exact: true }).waitFor({ timeout: 30_000 });
      // Wait for real remote connection readiness, even when the reopened dialog is modal.
      await browser
        .locator("#remote-environments")
        .getByText(/\bConnected\b/)
        .waitFor({
          timeout: 30_000,
        });

      await app.screenshot("after-first-pairing-finishes");
      await expect(dialog).toBeVisible();
    } finally {
      releasePairing.resolve();
      await server.stop();
    }
  },
);

Tests

  • 917778b178 adds the failing test, alone, before the fix.
  • cd apps/web && pnpm exec vp test run src/components/settings/AddEnvironmentDialog.browser.test.tsx passed on head.
  • pnpm exec vp run check:changed passed on head.

Not in this change

  • Native mobile pairing navigation is outside this change.

Who did the work

  • Written by Claude Opus 5.5, in Claude Code
  • Review findings fixed by GPT 6.2 Sol, in Codex
  • Reviewed by GPT 6.2 Sol, in Codex, and by Claude Opus 5.5, in Claude Code, each on its own
  • Also reviewed by cubic, run locally by a program, with no score
  • Reproduction, checks and proof run by a program on base and head, not by an agent
  • Left open after review: should, scripts/scenarios/finished-pairing-keeps-reopened-dialog.e2e.ts:16: The request gate spells out the descriptor path. A route change in packages/contracts/src/environmentHttp.ts could leave the browser waiting on pairingStarted until the scenario times out. Build the match from EnvironmentHttpApi.groups.metadata.endpoints.descriptor.path and keep the existing request gate and assertions.; should, apps/web/src/components/settings/AddEnvironmentDialog.browser.test.tsx:191: This direct pairing success case repeats the real-server scenario, while a late SSH success still has no test. Use this browser case to hold and resolve connectSshEnvironment after reopening, then assert that the SSH success toast appears and that the new dialog stays open. The scenario already covers the equivalent direct pairing success.

Made in T3 Code by Claude Opus 5.5 and GPT 6.2 Sol

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
StiensWout and others added 10 commits November 19, 2026 12:01
@StiensWout @claude
test(web): a finished pairing keeps a reopened Add Environment dialog…
917778b
… open

Co-authored-by: Claude Opus 5.5 <[email protected]>
@StiensWout @claude
fix(web): a finished pairing no longer closes a newly opened Add Envi…
18e5892
…ronment dialog

Co-authored-by: Claude Opus 5.5 <[email protected]>
@StiensWout @codex
fix(web): keep dismissed pairing errors out of reopened dialogs
6069ff8
Co-authored-by: GPT 6.2 Sol <[email protected]>
@StiensWout @codex
test(web): verify the reopened dialog stays expanded after pairing
1f824c2
Co-authored-by: GPT 6.2 Sol <[email protected]>
@StiensWout @codex
test(web): use the descriptor contract in the pairing scenario
104e2ed
Co-authored-by: GPT 6.2 Sol <[email protected]>
@StiensWout @codex
test(web): preserve the original pairing regression scenario
8348182
Keep the original descriptor route matcher in the pairing regression test.

Co-authored-by: GPT 6.2 Sol <[email protected]>
@StiensWout @claude
test(web): drop assertions the reopened-dialog checks already cover
aba0824
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@StiensWout @codex
fix(web): preserve reopened dialogs after adding a T3 Connect route
4407092
Co-authored-by: GPT 6.2 Sol <[email protected]>
@StiensWout @codex
test(web): type the rejected relay registration result
ee8da9e
Co-authored-by: GPT 6.2 Sol <[email protected]>
@StiensWout @codex
fix(web): report a dismissed T3 Connect route failure
25ef729
Co-authored-by: GPT 6.2 Sol <[email protected]>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Nov 19, 2026
@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 19, 2026
@juliusmarminge @claude
test(web): use Promise.withResolvers in the reopened pairing test
7e05ec8
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Asynchronous pairing and SSH operations now check whether the dialog session that started them is still current. Stale completions do not close a reopened dialog or replace its error. Browser and end-to-end tests cover these cases.

Changes: Add Environment dialog session handling

Layer / File(s) Summary
Guard asynchronous completions
apps/web/src/components/settings/AddEnvironmentDialog.tsx
Saved-backend SSH and remote pairing operations close the dialog only if their starting session remains current. Remote pairing failures update the dialog error only for the current session; the toast behavior is unchanged.
Test completions after reopening
apps/web/src/components/settings/AddEnvironmentDialog.browser.test.tsx, scripts/scenarios/finished-pairing-keeps-reopened-dialog.e2e.ts
Browser tests cover pending pairing success and failure, and pending SSH success, after the dialog is reopened. The end-to-end test pauses pairing until the dialog is reopened, then verifies that the dialog remains visible after pairing completes.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Low

Possibly related PRs

  • pingdotgg/t3code#28867: It addresses stale SSH completions in AddEnvironmentDialog.tsx.

Suggested reviewers: macroscopeapp, mnigos, maria-rcks

Merge Risk: Minimal · up to 8c7dd

This change keeps a reopened Add Environment dialog open when an earlier pairing or SSH attempt finishes late. No actionable merge risk remains.

Pre-merge checks: Passed 3 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Out of Scope Changes check Inconclusive The pairing and SSH session guards in AddEnvironmentDialog.tsx match #39088 and the PR objectives. The head commit 8c7ddc1 ('keep the reopened-dialog guard to pairing and SSH') and the PR objective… Provide readable whole-PR diff evidence for AddEnvironmentDialog.tsx at the route-registration section (and the matching test hunks) relative to the merge base 475ae52. Confirm whether the route-registration code matches main at head 8c7…
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed The title names the main change: a finished pairing no longer closes a newly opened Add Environment dialog. The raw summary and PR objectives both describe the dialog session guard for direct pairing,…
Description check Passed The description follows the repository template sections: Problem, Change, Scope, Verification, and an agent attribution line. The Problem and Change sections are clear. The Scope section links issue …
Linked Issues check Passed [#39088] requires that a reopened Add Environment dialog stays open when an earlier pairing finishes after dismissal. At head 8c7ddc1, AddEnvironmentDialog.tsx captures savedBackendSessionRef.curre…
Full details: Title check

Explanation

The title names the main change: a finished pairing no longer closes a newly opened Add Environment dialog. The raw summary and PR objectives both describe the dialog session guard for direct pairing, SSH connection, and remote pairing failures. The title is specific and matches the changeset. It is a conventional commit title, and the length of 83 characters is acceptable. Note that the title says 'pairing' while the change also covers SSH connections, which is a narrower scope but still a real part of the change.

Full details: Description check

Explanation

The description follows the repository template sections: Problem, Change, Scope, Verification, and an agent attribution line. The Problem and Change sections are clear. The Scope section links issue #39088 and explains the bug. The Verification section gives a reproduction on main, a proof run on base and head, screenshots, recordings, and test commands. The template's guidance on verification is met. The description has no explicit 'Scope' statement that the change is a bug fix rather than a feature, but the linked issue covers that. Minor gap: the Scope section does not restate that the issue is the bug report, and the 'Left open after review' notes are unresolved review items left in the body. Those are not template sections, but they do not make the description incomplete.

Full details: Linked Issues check

Explanation

[#39088] requires that a reopened Add Environment dialog stays open when an earlier pairing finishes after dismissal. At head 8c7ddc1, AddEnvironmentDialog.tsx captures savedBackendSessionRef.current before the remote pairing await. It closes the dialog only when session === savedBackendSessionRef.current. Pairing failures set the inline error only for the current session. handleOpenChange(false) increments the session, so the reopened dialog has a new session. The pairing success toast is still shown after the guard. The SSH path (connectSavedBackendSshTarget) uses the same guard for close and error. The head commit message and the current PR description disagree on T3 Connect route registration, but that path does not affect the pairing and SSH requirements in #39088. Limit of evidence: the file read was truncated at 16000 bytes before the route-registration section, so that section was not read. The browser test file and e2e scenario were not read in this review; the previous assessment cited them and they are not required to establish the pairing behavior.

Full details: Out of Scope Changes check

Explanation

The pairing and SSH session guards in AddEnvironmentDialog.tsx match #39088 and the PR objectives. The head commit 8c7ddc1 ('keep the reopened-dialog guard to pairing and SSH') and the PR objectives say T3 Connect route registration stays as on main. The current PR description still says a T3 Connect route registration failure after dismissal is reported in a toast. The whole-PR diff could not be read: the diff operation reported missing changed blobs, and the file read was truncated before the route-registration section of AddEnvironmentDialog.tsx. The previous summary also describes the route-registration hunk as changed. Therefore it is not established whether the head still changes route-registration behavior. That change would be outside #39088, which covers pairing and SSH only. The browser test additions and the e2e scenario were not read in this review, so their scope is also unverified.

Resolution

Provide readable whole-PR diff evidence for AddEnvironmentDialog.tsx at the route-registration section (and the matching test hunks) relative to the merge base 475ae52. Confirm whether the route-registration code matches main at head 8c7ddc1. If it differs from main, either revert it or document how it relates to #39088, and update the PR description to match the head commit.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: pingdotgg/t3code
  • Branch: main
  • File: .coderabbit.config.ts
  • Commit: 475ae52
  • Layers: Repository TS config
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f111bbae-de95-474f-be58-5b96ed050045
Commits

Reviewing files that changed from the base of the PR and between 7e05ec8 and 8c7ddc1.

Files selected for processing: 2

  • apps/web/src/components/settings/AddEnvironmentDialog.browser.test.tsx
  • apps/web/src/components/settings/AddEnvironmentDialog.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge @claude
fix(web): keep the reopened-dialog guard to pairing and SSH
8c7ddc1
Leave T3 Connect route registration as on main; it is outside the
reported pairing bug and was not shown fixed in the real app.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@juliusmarminge

juliusmarminge commented Nov 19, 2026

Copy link
Copy Markdown
Member

The automated pipeline stopped on this pull request and will not merge it:

the proof was not accepted:

  • The stated bug and expected behaviour include T3 Connect route registration (a finished registration closing the reopened dialog, stale inline errors, and a toast for a dismissed registration failure), but head commit 8c7ddc1 ('keep the reopened-dialog guard to pairing and SSH') removed that part. The final diff (origin/main...8c7ddc1) no longer touches T3 Connect, so that part of the claim is neither in the change nor shown in any capture.
  • The diff guards three paths in AddEnvironmentDialog.tsx: closing on SSH success (line 189), closing on pairing success (line 271), and the inline error for a pairing failure (line 258). The captures show only pairing success. The late pairing failure no longer putting an error in the reopened dialog and the SSH success no longer closing it are not captured; the capture's own 'unverified' list confirms neither was exercised.
  • The capture covers only successful remote pairing, so together the captures do not show everything stated in the bug and expected sections.

It stays open for a person to finish or close.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge added takeover:blocked Takeover blocked; reason in the PR body and removed takeover:in-progress A takeover lead is working on this PR labels Nov 19, 2026
@StiensWout StiensWout closed this Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:M 30-99 changed lines (additions + deletions). takeover:blocked Takeover blocked; reason in the PR body vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[Bug]: A finished pairing closes a newly opened Add Environment dialog

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@StiensWout @juliusmarminge
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.