feat(integrations): pair T3 Code directly through Matrix - #1126
Draft
HamedMP wants to merge 27 commits into
Draft
Conversation
Summary: - preserve a bounded T3 Connect request through auth and billing - open the canonical Terminal across desktop, Canvas, and mobile - require confirmation before running the pinned T3 CLI Rationale: - let T3 clients bootstrap a persistent Matrix OS environment - keep credentials out of the handoff and prevent replay or unsafe actions Tests: - focused platform auth, billing, and redirect tests - focused desktop, Canvas, mobile, queue, and command tests - @matrix-os/platform build
Summary: - exercise the exact handoff URL at the ShellHome boundary - verify both desktop and mobile renderers receive the canonical Terminal action Tests: - tests/shell/shell-home-launch.test.tsx - focused Matrix handoff suites
Summary: - create T3 setup as a canonical named Zellij shell session - link the T3 account before starting the long-running relay server - cover consent, command quoting, and canonical session creation Rationale: - Matrix VPSes do not expose a user systemd manager for T3 persistence - keeping serve attached to Zellij survives browser disconnects and remains visible to the user Tests: - pnpm exec vitest run tests/shell/terminal-launch.test.ts tests/shell/terminal-mobile-actions.test.tsx
Summary: - preserve a bounded T3 Connect request through auth and billing - open the canonical Terminal across desktop, Canvas, and mobile - require confirmation before running the pinned T3 CLI Rationale: - let T3 clients bootstrap a persistent Matrix OS environment - keep credentials out of the handoff and prevent replay or unsafe actions Tests: - focused platform auth, billing, and redirect tests - focused desktop, Canvas, mobile, queue, and command tests - @matrix-os/platform build
Summary: - exercise the exact handoff URL at the ShellHome boundary - verify both desktop and mobile renderers receive the canonical Terminal action Tests: - tests/shell/shell-home-launch.test.tsx - focused Matrix handoff suites
Summary: - create T3 setup as a canonical named Zellij shell session - link the T3 account before starting the long-running relay server - cover consent, command quoting, and canonical session creation Rationale: - Matrix VPSes do not expose a user systemd manager for T3 persistence - keeping serve attached to Zellij survives browser disconnects and remains visible to the user Tests: - pnpm exec vitest run tests/shell/terminal-launch.test.ts tests/shell/terminal-mobile-actions.test.tsx
Summary: - expose a bounded HTTP and WebSocket proxy to a loopback T3 server - launch T3 pairing from the canonical Matrix terminal without Clerk - preserve explicit VM routing and document the direct-pairing contract - cap requests, frames, buffers, handshakes, and active connections Rationale: - users should pair normal T3 clients with their Matrix computer without a T3 account or the managed T3 Connect relay - the T3 server stays loopback-only while Matrix owns public routing and T3 continues to authenticate pairing and session credentials Tests: - 208 focused gateway, platform, and shell tests passed - bun run check:patterns (0 violations) - changed package typechecks passed; root desktop baseline has two existing implicit-any errors in untouched files - bun run test reached unrelated existing Codex workspace-provider failures
Contributor
|
Platform preview revision deployed
Runs as the preview runtime SA against the staging database with Stripe TEST-mode keys; production service, SA, database, and live Stripe keys are untouched. |
Contributor
|
Preview VPS deployed
The VPS is deleted when this PR closes, or by the daily reaper after 72h. |
HamedMP
added a commit
that referenced
this pull request
Aug 3, 2026
## Summary - ask first-time users where they heard about Matrix inside the Settings-owned onboarding surface - offer a bounded source list for TikTok, Instagram, YouTube, X/Twitter, Reddit, search, friend/colleague, and other - record a viewed event, a submitted event, and set-once PostHog person properties for first-touch attribution - align acquisition sources and coding agents into compact numbered rows - support `1`-`8` source selection, `1`-`4` agent toggles, and Enter-to-continue/build with minimal button hints - add staggered, reduced-motion-safe entrance and selection feedback - use the main shell's default Moraine Lake wallpaper behind Settings in every pre-VPS onboarding path - allow that wallpaper through the platform-owned shell's prefixed public-asset route - continue directly into the coding-agent chooser from merged parent PR #1086 - restore explicit callback types in two current-main desktop components so the restacked head passes strict typecheck - leave reused add-computer install flows unchanged ## Screenshots ### 1. Acquisition question inside Settings TikTok is selected here to show the active row, number shortcut, minimal Enter hint, and the production default shell wallpaper.  ### 2. Immediate handoff to coding-agent selection Continue keeps the user in the same Settings shell and moves directly into numbered coding-agent rows from #1086.  ## Tests - `pnpm exec vitest run --reporter=dot tests/deploy/cloud-workspace-runtime.test.ts tests/shell/onboarding-acquisition-source.test.tsx tests/shell/posthog-session-replay.test.tsx tests/shell/settings-panel.test.tsx tests/shell/platform-shell-assets.test.ts tests/shell/boot-sequence.test.tsx tests/shell/billing-gate.test.tsx tests/shell/runtime-manager.test.tsx tests/observability/telemetry-events.test.ts` (94 passed on rebased head) - `pnpm exec vitest run --reporter=dot tests/gateway/coding-agents-codex-app-server-contract.test.ts tests/gateway/coding-agents-codex-events.test.ts tests/scripts/check-codex-provider-contracts.test.ts tests/deploy/cloud-workspace-runtime.test.ts tests/gateway/agent-launcher.test.ts` (43 passed on rebased head) - `pnpm exec vitest run tests/desktop/command-palette.test.tsx tests/desktop/panel-strip.test.ts tests/desktop/panel-strip-render.test.tsx` (20 passed) - `bun run typecheck` (passed) - `bun run check:patterns` (0 violations; existing warning groups only) - local full sweep: 9,209 passed; 11 platform/integration timeouts caused by an overlapping host test run all passed in single-worker isolation; six unrelated `tests/ui/*` suites remain blocked locally by the shared pnpm store failing to resolve `vitest` from `@testing-library/jest-dom`, while exact-head Core CI is the canonical clean install ## Review/Monitoring - parent PR #1086 merged through Graphite; this PR is rebased directly onto its squash commit on `main` - temporary current-main Hermes and Codex compatibility backports dropped cleanly during the rebase because `main` already contains them - audited all open PRs by changed file before implementation - avoids #1096's signup/billing handoff files beyond the inherited parent work - does not change #985's broader Agent Settings work or #1126's T3 Connect behavior - the initial stack merge landed #1086 and stopped on the child's post-squash conflict; this head is the conflict-free restack for final exact-head review and CI ## Invariants - **Source of truth:** PostHog's identified event stream and set-once person properties are the attribution source of truth; the UI keeps only transient selection state. - **Lock/transaction scope:** no database or multi-write persistence is introduced. - **Acceptable orphan states:** analytics capture may be unavailable or consent-limited without blocking onboarding or VPS provisioning. - **Auth source of truth:** the existing Clerk-identified shell session remains authoritative; telemetry continues through the existing same-origin PostHog relay and consent configuration. - **Deferred scope:** no free-text attribution, platform database column, historical backfill, add-computer prompt, campaign dashboard, or public documentation change is included.
Resolve manual preview deployments against the requested pull request head and bake the configured Clerk publishable key into the shell image. Add regression coverage for both invariants.
Carry the disposable preview's validated owner and collaborator Clerk IDs into the isolated Cloud Run route. Reuse the preview provisioning schema so malformed, duplicate, or owner-overlapping access lists fail closed.
Treat an omitted preview collaborator list as empty while still requiring and validating the real owner identity. This keeps older fleet records deployable without broadening access.
Set the public Matrix app URL on the running preview auth shell so Clerk redirects never inherit Cloud Run's internal host. Add workflow regression coverage for the runtime configuration. Tests: focused preview workflow test; YAML parse; diff check; pattern scan. Repo-wide checks remain blocked by existing Node 22/24 and native module mismatches plus unrelated desktop type errors.
Move the Matrix return URL out of Clerk's reserved redirect_url query parameter and pass an absolute, allowlisted public VM handoff to the sign-in and sign-up components. Tests: 45 focused shell tests pass; pattern scan passes. React Doctor reports no findings in the changed auth files. Production build remains blocked by unrelated local Langium dependency links.
Summary: - pin Clerk forwarded origin headers to the configured public app URL - cover Cloud Run internal-host handshakes with a regression test Rationale: - prevent Clerk from rejecting preview redirects derived from the internal Cloud Run service origin Tests: - vitest auth handoff suite (46 passed) - bun run check:patterns (0 violations) - production build attempted; blocked by unrelated missing linked Langium dependency
Summary: - merge the latest origin/main into the T3 integration branch - preserve direct T3 handoff behavior on the new action-based terminal API - retain new Hermes and OpenClaw setup actions across desktop and mobile Rationale: - resolve PR 1126 conflicts without dropping either the T3 flow or current main behavior Tests: - 6 focused shell files, 101 tests passed - react-doctor changed scope: 0 errors, 10 warnings - git diff --check
Use the owner-scoped /vm/:handle route as a validated fallback when MATRIX_HANDLE is absent from the terminal shell. This keeps the direct pairing URL scoped to the active preview or customer computer. Add an executable regression test for the missing-environment case and align the mobile action assertions with the pinned T3 preview package.
Queue URL-triggered setup actions without a transient Terminal window ID so the canonical desktop or mobile Terminal that survives hydration can drain the one-shot handoff. Add a regression that simulates the persisted Terminal replacing the initial launch target. Validated with 106 focused tests, the pattern scan, diff checks, and changed-scope React Doctor.
Summary: - allow a validated build-scoped HTTPS origin for T3 pairing links - configure preview VPS bundles to advertise preview.matrix-os.com - cover safe override and unsafe fallback behavior Rationale: - PR preview clients must reach the credentialless platform changes under test instead of the production Clerk-gated route - production bundles remain unchanged when no preview origin is configured Tests: - pnpm exec vitest run tests/shell/terminal-launch.test.ts - focused Matrix/T3 suite: 200 tests passed - bun run check:patterns (0 violations) - typecheck attempted; blocked by unrelated stale contracts build errors
HamedMP
added a commit
that referenced
this pull request
Aug 4, 2026
The guidance claimed Greptile never runs without an @greptileai mention and that an unreviewed PR "will sit indefinitely". Observed behavior across six PRs contradicts that: opening a non-draft PR spends one automatic review on the initial head. PR #1134 was reviewed 29 minutes before its first mention, and #1128 was reviewed with no mention anywhere; the draft PR #1126 got none. Only later commits require an explicit mention -- which is why this PR's own 5/5 was stale against its second commit. The absolute framing pushed agents to pay for a mention on freshly opened PRs where a free review was already inbound, inverting the cost goal of the original change. Also adds the check that a review's footer names the commit it covers, so a 5/5 against a superseded head is not mistaken for satisfying the merge gate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
127.0.0.1:3773in the canonical Matrix Terminal/Zellij session/vm/<handle>/api/integrations/t3/User story
t3 serveand prints one.This flow does not use T3 Connect, a T3 account, Cloudflare Tunnel, or a long-lived Matrix-specific T3 fork. Matrix OS itself still uses Clerk for Matrix account authentication.
Tests
bun run check:patterns: 0 violations (existing general warnings only)git diff --check: passed@matrix-os/contractsexport-resolution errorsInvariants
Source of truth
Lock/transaction scope
Acceptable orphan states
Auth source of truth
Deferred scope
--pairing-base-urlsupport is a rollout dependency.Paired PR
Test plan
https://app.matrix-os.com/vm/pr-1126?launch=__terminal__&terminal_action=t3-connect.https://preview.matrix-os.com/vm/pr-1126/api/integrations/t3/.pr-1126appears as a normal remote environment without a T3 account.