Skip to content

fix(web): import Claude Code and Codex sessions after onboarding - #22411

Open
ahmetaydin35 wants to merge 1 commit into
pingdotgg:mainfrom
ahmetaydin35:fix/import-sessions-after-onboarding
Open

ahmetaydin35 wants to merge 1 commit into
pingdotgg:mainfrom
ahmetaydin35:fix/import-sessions-after-onboarding

Conversation

@ahmetaydin35

@ahmetaydin35 ahmetaydin35 commented Oct 20, 2026 •

Copy link
Copy Markdown

Fixes #10961

Session import only runs from the /welcome wizard, and nothing leads back there once onboarding is done. A Claude Code or Codex session started in a terminal after setup can't be imported. That includes sessions in projects T3 Code already has, and projects that were deleted and added again. On desktop there is no address bar, so the only way back is DevTools. The welcome wizard guide also says "Run import again to continue a large batch", but there was nowhere to run it.

Settings → General → Projects & threads now has Import from Claude Code and Codex. It opens the same project list as the wizard's import step, in a dialog, and runs the same agentSessions.scan and agentSessions.import calls.

  • The wizard's import step moved to onboarding/ProjectImportStep.tsx unchanged, apart from a configurable dismiss label, a shared result toast, and the toast copy described below. Settings imports it without pulling in the rest of the wizard. Git shows this as a new file; the rest of the moved block matches the old code line for line.
  • The dialog scans the connected environments selected in Settings. It mounts its scan only while open, rescans a cached result when it opens so sessions started since the last scan appear, and does not close while an import runs.
  • Existing projects are matched through the projectId the scan already returns, and the server skips conversations it imported before, so running it again only adds new ones. No server or contract changes.
  • The server's importedCount also counts conversations imported on an earlier run (AgentSessionImporter and its retry test treat that as intended). During onboarding that was invisible, but a second import from Settings said "Imported 14 threads" when 3 were new. The result toast and warnings now read "N threads are in T3 Code", which is true for both first and repeat imports. The wizard tests are updated for the new copy.

Scope and approval

This makes the existing onboarding import reachable after onboarding. It does not add a new workflow. Same scan, same import, same eligibility rules, same 30-day window. Picking a single session (#6873, #18025) and refreshing already-imported threads are out of scope.

#13510 took a similar approach from project settings and was closed for missing before/after evidence and a recording of the import. This PR includes both. Unlike #13510, it also covers folders that are not projects yet, because it reuses the wizard's project list instead of importing into one existing project.

Surfaces: web and desktop share this UI. Mobile has no session import UI today and is unchanged. Remote environments work through the same RPCs; the dialog lists each selected environment separately, as the wizard does.

Verification

  • vp test run src/components/settings/AgentSessionImportDialog.browser.test.tsx: 3 new tests, written with the disposable render helper from test(web): disposable render helper and lint rule for browser tests #22187. Importing into a project that already exists uses its ID without creating a project and shows the result toast. The dialog stays open until a running import finishes; this test fails if the guard is removed. Opening with a cached scan rescans.
  • vp test run src/components/onboarding/WelcomeWizard.import.browser.test.tsx src/components/onboarding/WelcomeWizard.browser.test.tsx src/components/settings/settingsSearch.test.ts: the existing wizard and settings search tests still pass after the move. 84 tests across the four files.
  • tsc-rs --noEmit for apps/web, plus vp lint and vp fmt --check on the changed directories, all pass.
  • Manual check in the dev web app against an isolated home, with synthetic Claude Code and Codex transcripts set through CLAUDE_CONFIG_DIR and CODEX_HOME. After onboarding, the first import from Settings brought in 10 threads across 3 projects. Adding a session to an existing project and running it again imported only that one. Sessions in a folder that was not a project yet showed up at the top of the list and imported as a new project. Each reopen of the dialog listed the session added since the last scan.

Not checked: the packaged desktop app, and an environment connected over relay or T3 Connect.

Before

Settings → General → Projects & threads has no way back to the import.

Settings, General, Projects & threads before: no import row

After

Settings, General, Projects & threads after: Import from Claude Code and Codex row Import dialog listing four projects Result toast: 15 threads are in T3 Code

Recording

Reopening the import after a new Codex session in docs-site: the list shows it, the import adds it, and it appears in the sidebar.

import-after-onboarding.mp4

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

🤖 Generated with Claude Code

Session import was only reachable from the /welcome wizard, so sessions
started after onboarding had no way into T3 Code (pingdotgg#10961).

Settings > General now has "Import from Claude Code and Codex". It opens
the wizard's project import step in a dialog. The step moves unchanged to
ProjectImportStep.tsx so Settings does not load the whole wizard. The
dialog scans the environments selected in Settings, rescans when it opens
so new sessions show up, and stays open while an import runs. The server
already skips conversations that were imported before, so there are no
server or contract changes.

The server's import count includes conversations imported on an earlier
run. That was invisible during onboarding but would overstate a second
import, so the result toast now says how many threads are in T3 Code
instead of how many were imported.

Fixes pingdotgg#10961

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels Oct 20, 2026
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3a8d6745-4fc5-464f-ad19-6db05a9f302d
📥 Commits

Reviewing files that changed from the base of the PR and between 81dea78 and 368cb22.

📒 Files selected for processing: 8
  • apps/web/src/components/onboarding/ProjectImportStep.tsx
  • apps/web/src/components/onboarding/WelcomeWizard.browser.test.tsx
  • apps/web/src/components/onboarding/WelcomeWizard.tsx
  • apps/web/src/components/settings/AgentSessionImportDialog.browser.test.tsx
  • apps/web/src/components/settings/AgentSessionImportDialog.tsx
  • apps/web/src/components/settings/SettingsPanels.tsx
  • apps/web/src/components/settings/settingsSearch.ts
  • docs/user/welcome-wizard.md

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

📝 Walkthrough

The project import flow is now a shared onboarding component and is available from General Settings. The settings dialog refreshes scans, passes connected environments to the import step, blocks dismissal during imports, and reports completion.

Changes: Project import

Layer / File(s) Summary
Shared import step and onboarding integration
apps/web/src/components/onboarding/ProjectImportStep.tsx, apps/web/src/components/onboarding/WelcomeWizard.tsx, apps/web/src/components/onboarding/WelcomeWizard.browser.test.tsx
The project scan, selection, and import flow now resides in ProjectImportStep.tsx. WelcomeWizard uses the shared component and toast helper. Toast test expectations use the updated “in T3 Code” wording.
Settings import entry and dialog
apps/web/src/components/settings/AgentSessionImportDialog.tsx, apps/web/src/components/settings/AgentSessionImportDialog.browser.test.tsx, apps/web/src/components/settings/SettingsPanels.tsx, apps/web/src/components/settings/settingsSearch.ts, docs/user/welcome-wizard.md
General Settings now provides an import dialog for connected environments, with a settings search entry. The dialog refreshes cached scans, blocks dismissal during imports, and reports the result. Browser tests cover import completion, pending-import dismissal, and scan refresh. The welcome wizard documentation describes how to import later.

Priority: ➖ Normal

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

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant SettingsPanels
  participant AgentSessionImportDialog
  participant ImportStep
  participant ProjectScansAndThreadImporter
  SettingsPanels->>AgentSessionImportDialog: Open with connected environment IDs
  AgentSessionImportDialog->>ImportStep: Provide scans and import state
  ImportStep->>ProjectScansAndThreadImporter: Scan candidates and import thread history
  ImportStep-->>AgentSessionImportDialog: Report completion and imported-thread count
  AgentSessionImportDialog->>AgentSessionImportDialog: Close and show the result toast
Loading

Suggested reviewers: juliusmarminge, t3dotgg

Merge Risk: ⚪ Minimal · up to 368cb

This change lets users import Claude Code and Codex sessions from General Settings after onboarding, using the same import flow as onboarding. Existing projects are reused, permission checks still apply, and the dialog cannot be closed while an import is running. No outstanding defects were identified, so the change appears ready to merge.

Security architecture risk: ⚪ Minimal · up to 368cb

Settings makes the existing import workflow easier to reach without adding import privileges. Environment-scoped permission checks, workspace validation, and retry safeguards are retained. No material security risk introduced or worsened by this change was identified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The affected sensitive outcomes are discovery of project metadata and persistence of imported conversation history across the environments selected for the workflow. Settings improves reachability but does not grant additional scopes. The importer loads the requested project and rejects an expected-workspace-root mismatch before deriving history from that project root.

Trust Boundaries and Controls

  • observed — Authorization is not solely a UI control. The WebSocket endpoint authenticates the connecting session and installs RPC authorization using that session's scopes. Middleware rejects requests missing a required scope; scan requires orchestration read and import requires orchestration operate before reaching the existing scanner and importer handlers.

Resilience and Maintainability Implications

  • observed — The generation guard stops stale client continuation after component unmount; it does not itself undo already-dispatched mutations. Project creation and history import remain separate steps, as before this PR. Server ownership and retry safeguards provide recovery boundaries, while parent-route interruption and packaged-client recovery remain unexercised coverage areas rather than established security defects.
Pre-merge checks: Passed 6
Check name Status Explanation
Linked Issues check Passed The description links issue #10961 and clearly explains how the Settings import entry point resolves the issue without changing the stated eligibility rules.
Out of Scope Changes check Passed The changes match the stated objective. They add a post-onboarding Settings entry point, reuse the existing import workflow, update result messaging, and add focused tests and documentation. Mobile, s…
Title check Passed The title clearly and concisely describes the primary change: enabling Claude Code and Codex session imports after onboarding.
Linked Issues check Passed Issue #10961 requires a reachable post-onboarding action for eligible Claude Code and Codex sessions. GeneralSettingsPanel now exposes an Import action and passes connected environment IDs to `Agent…
Out of Scope Changes check Passed The changes stay within the linked issue scope. The extracted ProjectImportStep, settings dialog, settings row, search entry, result-copy update, tests, and user documentation all support post-onboa…
Description check Passed The pull request description includes the problem, change, scope and approval context, verification steps with observed results, limitations, before/after screenshots, a recording, and the agent model…
Full details: Out of Scope Changes check

Explanation

The changes match the stated objective. They add a post-onboarding Settings entry point, reuse the existing import workflow, update result messaging, and add focused tests and documentation. Mobile, server contracts, single-session selection, and thread refresh remain out of scope.

Full details: Linked Issues check

Explanation

Issue #10961 requires a reachable post-onboarding action for eligible Claude Code and Codex sessions. GeneralSettingsPanel now exposes an Import action and passes connected environment IDs to AgentSessionImportDialog. The dialog mounts useProjectScans only while open, refreshes cached scans, reuses ImportStep, and uses the existing import flow. The shared step preserves project matching, eligibility, and import calls. The reported browser tests cover existing-project imports, import-in-progress closing protection, and rescan behavior.

Full details: Out of Scope Changes check

Explanation

The changes stay within the linked issue scope. The extracted ProjectImportStep, settings dialog, settings row, search entry, result-copy update, tests, and user documentation all support post-onboarding session import. The diff adds no server or contract changes and does not add automatic discovery, single-session selection, or refresh behavior for already imported threads.

Full details: Description check

Explanation

The pull request description includes the problem, change, scope and approval context, verification steps with observed results, limitations, before/after screenshots, a recording, and the agent model and harness used.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

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:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Session import is unreachable after onboarding, so externally started sessions can never be imported

1 participant