Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(web): first-run welcome wizard with agent setup and project import #5362

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 43 commits intomain fromrefs/pull/5362/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Fresh installs need a reliable way to connect a machine, prepare agents, and bring existing work into T3 Code. This adds first-run setup for local and paired machines. Existing workspaces still open directly in the app.

  • Enable only Codex and Claude Code by default. Other providers remain opt-in.
  • Center onboarding content on black without a logo. Restore saved appearance after setup.
  • Find projects across configured Codex and Claude homes. Import recent thread history without starting a provider turn. Preserve native session cursors and skip completed files on retry, including after restart.
  • Bound discovery and history reads. Warn when a scan is incomplete, and validate each transcript's project before import.
  • Preserve main's queued settings writes and current terminal API. Failed preference reads cannot save defaults or open the wrong browser profile. Retry recovers without losing imported threads.
  • Refresh cloud discovery while setup waits for a machine. Pause while hidden or offline, and stop after a machine is found.

Scope: this is first-run import through /welcome. Post-onboarding import, external-turn refresh, account-switch continuation, and safe single-writer handoff remain tracked in Discussion #6680.

Verification

  • Rebased onto main at c843c19294bcea9a4f5cf19632b135459a16d214. All 43 commits are preserved. The final base updates remove unused mobile and keybinding helpers and restore checkpointing after git init. git range-diff confirms unchanged PR patches.
  • 1,961 focused tests passed across 83 files during modernization: 1,948 with the root configuration and 13 Ghostty tests with the web configuration. After the final rebase, 197 tests passed across six files covering the base updates, cloud discovery, transcript scanning, and import. Imported history still creates no checkpoints.
  • Typechecks passed for server, web, desktop, contracts, shared, and client-runtime during modernization. Server and web were checked again after the final behavior changes, and server passed again after the checkpoint rebase. Targeted formatting and diff checks passed. Lint has warnings but no errors.
  • Real browser checks cover light and dark preferences, 320 px and 1,440 px layouts, both default agents, project selection, partial import, retry, reload, saved font size, and theme restoration.
  • Real discovery found 18 projects. Import and retry left 4 threads, 25 distinct messages, and 0 turns in SQLite. Replaced transcripts from another project are rejected.
  • Corrupt-settings recovery passed for fresh and existing workspaces. A 59-check browser test exhausted real local storage, then verified Retry saved settings without duplicate threads.
  • The real signed-out Codex terminal passed focus, pixel, menu, narrow-layout, and cleanup checks. The login command was pretyped but not submitted. Tests cover configured binaries, provider homes, and delayed startup.
  • macOS preview builds passed. Native macOS and mobile UI, and live T3 Connect registration, were not exercised on Linux.

Review status

  • All 152 review threads are resolved.
  • UI consistency and Effect reviews passed on 5c1b66754b5bf6fbc238cafc8019e3e4fef234bf, before the last base-only rebase. All 43 PR patches remain unchanged. Reruns hit Macroscope's shared PR review budget.
  • Macroscope correctness review is blocked by its cost limit: $14.34 estimated against a $10.00 cap. A supported manual request did not bypass the limit.
  • Cursor Bugbot is paused because the team's spend limit is reached. No billing settings or review exclusions were changed.

Screenshots

Captured from the running app on September 5. Private paths and conversation content are masked. The final rebase has no onboarding UI changes.

BeforeAfter
Earlier connection stepUpdated connection step

Agent readiness

Codex and Claude Code ready

Project import

Recent project scan with an incomplete-scan warning

Narrow layout

Onboarding at 320 px with a saved 20 px interface font

Sign-in terminal

Codex sign-in terminal menu

Settings recovery

Fresh workspace recovering from unreadable preferences

Modernized and verified with GPT-6 Astra (preview) in Codex.

Note

Add first-run welcome wizard with agent session import and settings hardening

  • Welcome wizard: New /welcome route renders a full-screen wizard for connection, agent setup, and project import. FirstRunGate holds the authenticated app tree until the first-run decision resolves.
  • Agent session import: Server scans Claude/Codex transcript directories and imports recent sessions as settled thread history via thread.history.import. Imported messages use an import: ID prefix and are excluded from checkpoints, relay awareness, and live activity tracking.
  • Settings hydration: Client settings use a pending/ready/failed/retrying state machine. Patches wait for hydration instead of persisting defaults, and useLocalStorage retries browser storage per-call. Desktop and web reads now propagate typed read errors instead of treating them as absent.
  • Terminal provider environment: Terminal open/attach/restart inputs accept a providerInstanceId and resolve the configured environment (with home expansion for CODEX_HOME/CLAUDE_CONFIG_DIR) before spawning.
  • Risk: readClientSettings in clientPersistenceStorage.ts and DesktopClientSettings.get in DesktopClientSettings.ts now fail for non-missing storage or decode errors instead of returning null; callers that assumed an empty result for malformed files will receive a failure.
Macroscope summarized a0c0a2b.

Note

High Risk Changes orchestration commands, projections, checkpoint behavior, provider runtime persistence, and desktop settings error semantics—areas where races or misclassified failures could lose preferences or corrupt thread state.

Overview Adds server-side import of Codex/Claude transcript history into orchestration threads: importRecentAgentThreads scans recent sessions, writes provider resume cursors before threads are visible, dispatches thread.create / thread.history.import, and records transcript sources in provider runtime payload. RPC scopes map scan to read and import to operate.

Imported messages use import: IDs and historyImport metadata. They stay turnless, are excluded from checkpoints and “queued work” summaries, survive revert paging on the oldest thread-detail page, and cannot be forged via live turn/assistant commands. getImportedAgentSessionSources supports bounded retries without re-reading completed transcripts.

Desktop client settings now surface DesktopClientSettingsReadError on permission, I/O, or decode failures instead of treating bad files as missing; decode picks direct vs legacy settings shape before schema validation so partial invalid JSON cannot silently become defaults.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit f78dfe489abb0b9c5b7a7b117957203afe77812d. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: 92f201e6-0378-4f3c-be90-a488d2038d3c

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review

      Warning

      Your free Security trial is over. An organization admin can activate Security or dismiss this notice.


      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    3. Effect service conventions review of the new agent-session scanner service, its contract error, and the WS wiring. Three convention violations found; details inline.

      Posted via Macroscope — Effect Service Conventions
    4. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium project/AgentSessionScanner.ts:187

      resolveClaudeConfigDir expands ~ for the configured homePath but not for process.env.CLAUDE_CONFIG_DIR. When the env var is set to something like ~/.claude-work, path.resolve treats ~ as a literal relative directory name, so the scanner looks in the wrong place and silently returns no Claude projects. Apply expandHomePath to the env var value before resolving, matching the homePath branch.

      ✅ Resolved in 6378909671c433810ea9497fef7a0e33d266ae91

    5. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Not approved

      Macroscope's review found this PR not approvable — This PR adds a substantial first-run onboarding and agent-session import capability spanning web, server, persistence, orchestration, terminal, and desktop settings behavior. Its default user experience, authorization paths, durable state handling, and static-analysis configuration require human review.

      Not approved because:

      • Per-review cost limit exceeded (workspace setting). Approvability relies on correctness review in order to determine eligibility

      No code changes detected at a0c0a2b. Prior analysis still applies.

      Review your spending limits in [Billing settings](https://app.macroscope.com/pingdotgg/settings/billing), or comment `@macroscope-app review this PR` to bypass the limit and review now. You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    6. One convention issue found in the new server service module. The three items flagged on the previous revision (redundant failure singleton on AgentSessionScanError, message-derived wrapper in ws.ts, unexported make) are all resolved.

      Posted via Macroscope — Effect Service Conventions
    7. Effect service conventions review of the new AgentSessionScanner service and its RPC wiring. The three findings from the previous run (namespace import for ProjectionSnapshotQuery, structural operation discriminator on the scan error, exported make) are all addressed. Two remaining items below.

      Posted via Macroscope — Effect Service Conventions
    8. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium onboarding/WelcomeWizard.tsx:693

      When the user clicks Skip or Continue while the inline install terminal is open, AgentInstallTerminal unmounts without closing the PTY, leaving a shell — or a running install/login command — alive and inaccessible on the server. The useEffect that calls openTerminal has no cleanup, and closeAndDismiss is only wired to the Done button, so these normal unmount paths never call closeTerminal. Consider returning a cleanup from the terminal-open effect that calls closeTerminal for the opened session.

      ✅ Resolved in e089fab10e653d8f254acb56e60bd0c8018bd6e1

    9. One remaining convention deviation on the new contract error; everything else (namespace imports, single-module service layout with inline interface + make/layer, environment-based dependency acquisition, Foo["Service"] usage) looks consistent with the conventions.

      Posted via Macroscope — Effect Service Conventions
    10. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium onboarding/WelcomeWizard.tsx:622

      When provider is undefined (the initial state before the provider probe completes), AgentCard shows an enabled Install button. getProviderSummary(undefined) returns the headline "Checking provider status," confirming this state is meant to represent pending detection — yet the card offers an actionable install button instead of waiting. A user can open a terminal pre-typed with the global install command for an agent that may already be installed on the machine, rather than waiting for the probe to detect it. The button should be disabled or hidden until provider is no longer undefined.

      ✅ Resolved in 5988af8179245c189a4becc2dcf65d73a681abae

    11. github-actions[bot](GitHub profile, opens in a new tab)commented

      Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire13.6 KiB13.5 KiB−43 B (−0.3%)15.1 KiB✅
      CodexThread snapshot wire7.0 KiB7.0 KiB+7 B (+0.1%)7.3 KiB✅
      CodexLive turn WebSocket wire6.6 KiB6.5 KiB−50 B (−0.7%)7.8 KiB✅
      CodexLive turn WebSocket decoded57.1 KiB57.0 KiB−88 B (−0.2%)66.4 KiB✅
      CodexLive turn messages108−2 (−20.0%)21✅
      ClaudeTotal thread wire13.6 KiB13.5 KiB−74 B (−0.5%)15.1 KiB✅
      ClaudeThread snapshot wire7.0 KiB7.0 KiB−9 B (−0.1%)7.3 KiB✅
      ClaudeLive turn WebSocket wire6.6 KiB6.5 KiB−65 B (−1.0%)7.8 KiB✅
      ClaudeLive turn WebSocket decoded57.9 KiB57.8 KiB−88 B (−0.1%)66.4 KiB✅
      ClaudeLive turn messages108−2 (−20.0%)21✅

      Baseline: c843c19 · PR result: a0c0a2b · Source CI: success

      Scenario and decoded snapshot size

      10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

      • Codex decoded thread snapshot: 113.8 KiB
      • Claude decoded thread snapshot: 114.5 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

    12. Oh lets go, super hyped for this

    13. UI consistency review of the new onboarding surfaces (FirstRunGate.tsx, WelcomeWizard.tsx, welcome.tsx, state/agentSessions.ts). Three findings in WelcomeWizard.tsx, all local to the new code: one raw control that recreates Button, one status treatment that bypasses the theme's success tokens, and one selection card that never exposes its selected state. Everything else (Input/Checkbox usage, the destructive error box mirroring PairingRouteSurface, terminal drawer composition) matches existing conventions.

      Posted via Macroscope — UI Consistency
    14. UI consistency review of the new onboarding surfaces (FirstRunGate.tsx, WelcomeWizard.tsx, welcome.tsx, agentSessions.ts). Two findings on the wizard's hand-rolled controls; the rest (Button/Input/Checkbox usage, the full-screen surface shell mirroring PairingRouteSurface, native overflow-y-auto list, emerald accent) matches existing repo patterns.

      Posted via Macroscope — UI Consistency
    15. One finding on the new wizard UI: the pairing URL field has no accessible name. Everything else (Button/Input/Checkbox usage, success tokens, error-surface treatment) matches the existing /pair surface and the shared primitives.

      Posted via Macroscope — UI Consistency
    16. One finding on the new onboarding UI: the wizard's CommandBlock reconstructs the app-wide clipboard contract locally instead of using useCopyToClipboard, and reports success on a failed copy. Everything else in the changed web files (primitives, tokens, selection semantics, full-screen surface chrome) lines up with the existing patterns.

      Posted via Macroscope — UI Consistency
    17. One UI consistency finding in the new welcome wizard. Everything else in the changed web files (connection cards, agent cards, back control, clipboard block, checkbox rows, pairing input/error surface) now matches the shared primitives and token usage.

      Posted via Macroscope — UI Consistency
    18. UI consistency review of the onboarding surfaces. One new finding on WelcomeWizard.tsx; the previously reported CommandBlock clipboard issue on this same commit still stands and is not repeated here.

      Posted via Macroscope — UI Consistency

Sign in to join this conversation.