Skip to content

fix(web): import sessions from connected non-primary environments - #35131

Open
ahmetaydin35 wants to merge 2 commits into
pingdotgg:mainfrom
ahmetaydin35:fix/import-sessions-non-primary-environments
Open

ahmetaydin35 wants to merge 2 commits into
pingdotgg:mainfrom
ahmetaydin35:fix/import-sessions-non-primary-environments

Conversation

@ahmetaydin35

@ahmetaydin35 ahmetaydin35 commented Nov 12, 2026 •

Copy link
Copy Markdown

Reopens #22411 from current main, as asked when it was closed for being open over 3 weeks. @juliusmarminge asked for this scope in his review, and the review changes were already pushed there. The code is the same, rebased onto current main as one commit.

Problem

#33209 lets users reopen the Welcome page from Settings → About and re-import sessions on the primary environment. The page only scans the primary environment, so Claude Code, Codex and Pi sessions on a connected non-primary environment still cannot be imported.

Change

  • /welcome accepts an environmentId search param. The Welcome page already works on one environment at a time and opens for a non-primary environment after a ChatGPT sign-in, so this only lets Settings ask for one. An id the catalog does not know falls back to the primary environment, as the sign-in hash already did. resolveWelcomeEnvironmentId holds that choice.
  • Settings → Environments adds Import sessions… to the ⋯ menu of each saved environment. It shows only when the environment is on and connected and the connection has orchestration:operate, the scope the import needs.
  • docs/user/welcome-page.md says where to find it.

The Welcome page's scan, import and eligibility rules are reused as they are. No server or contract changes.

Scope

Requested by a maintainer in review on #22411: "Please cut this down to the remaining separate gap: importing sessions from connected non-primary environments, which the Welcome page does not scan." Follow-up to #10961.

Verification

Run on this branch, on top of current main:

  • vp test run src/onboarding/welcomePage.logic.test.ts: 14 tests pass, 5 of them new for resolveWelcomeEnvironmentId (default, requested environment, sign-in return wins, unknown id falls back, no primary environment as in the hosted app).
  • vp test run --project browser on WelcomePage.import, AddEnvironmentDialog and EnvironmentRoutesList: 20 existing tests pass.
  • effect-tsgo tsrs --noEmit for apps/web reports no errors. vp fmt, vp lint and knip pass.
  • CI: Test Web 2 fails on CommandPalette.browser.test.tsx:113, which this PR does not touch. The same test fails on main at ee90bdc. It passes locally on this branch (3/3 runs).

Manual check on #22411 with the same code, in the dev web app with isolated state. A second server on the same Mac, with its own --base-dir and synthetic Claude Code and Codex transcripts, was paired as a remote environment named "Build Server". Its menu showed Import sessions…, which opened /welcome?environmentId=…. The page read "Setting up Build Server" and listed that server's 5 projects, with the 3 recent git repositories checked.

Not checked: running the import itself from that page (the test server had no signed-in agent), an environment connected over SSH or T3 Connect, and the packaged desktop app. No browser test covers the environment row menu.

Before

Settings → Environments, menu of a connected environment: no way to import its sessions.

Environments menu before: Icon, Routes, Copy MCP URL, Remove

After

Environments menu after: Import sessions… between Routes and Copy MCP URL Welcome page setting up Build Server, offering to import 3 of 5 projects

Claude Opus 5.5 in Claude Code, run through T3 Code.

🤖 Generated with Claude Code

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Nov 12, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at e570d43

Macroscope's review found this PR approvable — Adds an explicit way to import session history from another connected environment. It reuses the existing environment-scoped import flow and permission checks without changing the default environment.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Settings now provides an “Import sessions…” action for eligible connected environments. The action opens the Welcome page with the selected environment ID. The Welcome page validates and resolves that ID against the available environments.

Changes: Environment session import

Layer / File(s) Summary
Environment selection logic
apps/web/src/onboarding/welcomePage.logic.ts, apps/web/src/onboarding/welcomePage.logic.test.ts
The resolver prefers a known resume environment, then a known requested environment, and otherwise returns the primary environment ID. Tests cover these selection cases.
Welcome route selection
apps/web/src/routes/welcome.tsx
The route validates the requested environment ID, waits for the catalog when required, and uses the resolver to select an environment.
Settings navigation and Welcome page guidance
apps/web/src/components/settings/SavedEnvironmentRows.tsx, docs/user/welcome-page.md
Eligible connected environments gain an “Import sessions…” action that navigates to /welcome with the environment ID. The documentation describes importing projects and sessions from another connected computer.

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant SavedBackendListRow
  participant WelcomeRouteView
  participant resolveWelcomeEnvironmentId
  User->>SavedBackendListRow: Select “Import sessions…” for an eligible environment
  SavedBackendListRow->>WelcomeRouteView: Navigate to /welcome with environmentId
  WelcomeRouteView->>resolveWelcomeEnvironmentId: Resolve requested ID against resume ID and catalog IDs
Loading

Suggested reviewers: juliusmarminge, t3dotgg

Merge Risk: Minimal · up to 3f040

This adds an "Import sessions…" menu action for connected environments that opens the Welcome page for the chosen environment, and unknown IDs fall back to the primary environment. No concrete defect was found, so the change looks safe to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title follows the conventional commit format and names the main change: letting users import sessions from connected non-primary environments. The changeset matches it. It adds an Import sessions …
Description check Passed The description follows the repository template. It has Problem, Change, Scope, and Verification sections, and each is filled in with specific content. The Problem section states the gap in the primar…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title follows the conventional commit format and names the main change: letting users import sessions from connected non-primary environments. The changeset matches it. It adds an Import sessions action in Settings → Environments, an environmentId search param on /welcome, and a resolver that picks the environment. The title is specific and accurate.

Full details: Description check

Explanation

The description follows the repository template. It has Problem, Change, Scope, and Verification sections, and each is filled in with specific content. The Problem section states the gap in the primary-only scan. The Change section lists the route param, the Settings menu item, and the docs update. The Scope section links the prior issue and a maintainer request. The Verification section gives the test commands, the CI failure with its cause on main, a manual check, and what was not checked. Before and after screenshots are included, as the template requires for UI changes. The template asks for the model and harness used, and the description names Claude Opus 5.5 in Claude Code. The Scope section cites a maintainer request but gives no issue link for the bug itself. This is a minor gap and does not make the description incomplete.

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

Commits

Reviewing files that changed from the base of the PR and between cea6dee and 3f04012.

Files selected for processing: 1

  • apps/web/src/components/settings/SavedEnvironmentRows.tsx

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

The Welcome page only scans the primary environment, so sessions on a
connected non-primary environment could not be imported. Settings →
Environments now has Import sessions… in each connected environment's menu,
which opens the Welcome page for that environment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ahmetaydin35
ahmetaydin35 force-pushed the fix/import-sessions-non-primary-environments branch from e570d43 to cea6dee Compare November 12, 2026 10:33

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants