Repository navigation
feat(t3code): PP-408 connect your own T3 Code - #691
Conversation
Members connect their own T3 Code from profile connections by pasting its MCP URL. ProjectProject signs in to it as an OAuth client (PKCE, dynamic client registration), checks the token with t3_environment_read and keeps it sealed per user. Groundwork for starting tickets in T3 Code (PP-407). Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 240bb7e226
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ount (#692) Stacked on #691. Settings → Profile → Connected accounts had grown one row at a time: inconsistent buttons, Everhour split over two rows, long descriptions, and no way to see at a glance what's connected. It now works like the organization's integrations. **What a member sees:** - **Overview:** a card per account (GitHub, Everhour, Figma, Slack, T3 Code) with a status badge, connected ones first. The badges read Connected, Not connected, Reconnect needed, Check failed, or "No workspace yet" for Slack. - **One page per account** (`/settings/profile/connections/<kind>`), in the integration detail layout: a back link, an about text, a sidebar with status, account and "Just you", then the account's own rows. The T3 Code page also shows the machine, access level and valid-until date. - **Everhour** is one stacked API-key row (connect, update, disconnect) instead of two rows. - **Links:** OAuth sign-ins for GitHub, Figma, Slack and T3 Code return to their own page, and errors show there. The branch picker, org integration pages and command menu link straight to the right page. The command menu gets a T3 Code entry. **How:** - `IntegrationDetail` takes its back link as a prop (`orgIntegrationsBack(orgSlug)` for the six org pages) so profile pages reuse it. - Status mapping is pure logic in `features/profile/lib/connectionStatus.ts`, with tests. - `AccountDetail` wraps the layout for personal accounts. - `useOAuthNotice` reads an OAuth redirect's message once, then clears it from the URL. **Testing:** - Typecheck, lint and tests pass, including 5 new status tests. - Reviewed in the agent environment. - The OAuth flows weren't clicked through on the new pages; only their redirect targets changed. Created with Claude Opus 5.5 in T3 Code. ---------
…693) Stacked on #692 (PP-413), which is on #691 (PP-408). ## What On a member's T3 Code account page, the settings for what ProjectProject sends when they start a ticket: - **Prompt**: a template edited with field chips (type `/`), each with a tooltip saying what it fills in, plus `$skill` badges. "Preview" fills it in for an example ticket, and ⌘↵ saves. The default prompt tells the agent to read the ticket by its ID through the ProjectProject MCP tools or `pp tickets get`, not to open a link. - **Model and effort**: a command menu with a tab per provider, models grouped by provider (favorites first), and an effort pane beside the list that works like a submenu: → enters it, ↑↓ move, ↵ picks, ← goes back. Nothing is saved until you pick. The model's default effort is labeled "Default", and picking it isn't stored, so it follows T3 Code's default. - **Permission mode and working copy** each ticket's thread starts with. - **Where tickets open**: for each project, the T3 Code project its tickets open in, suggested from a matching GitHub repository. Stored as `user_settings` columns and the `user_t3code_project_link` table (migration `20261130150116_t3code_launch_settings`). Starting the work itself is PP-410 to PP-412. ## @pp/ui changes (documented in the gallery) - `CommandMenuTabs`: the active tab takes the menu highlight, so it shows inside popups. - `CommandMenuItem`: new `checked` prop for a picker's current choice. - `Select` items take a `description` line. - The slash menu can size to its content (`size="fit"`). - Tooltips with a max width now wrap their text, which used to be cut off. - `TextSwap` crossfades values longer than 48 characters instead of rolling every glyph, which stuttered on long tooltips. ## Checks - `bun run check`: format, lint and typecheck pass. - `bun run test`: 4,712 pass, 1 skipped, 0 failed. - Checked by hand in the agent dev environment: the prompt editor and preview, the model menu by keyboard and pointer, the effort pane highlight, the wrapping and crossfading tooltips, and the project picker. ---------
Stacked on #693 (PP-409), which is on #692 and #691. ## What `POST /orgs/:org/projects/:slug/tickets/:id/t3code/start` starts a ticket in the caller's own T3 Code. This is the single start that the start menu (PP-411) and the T3 Code assignee (PP-412) will both use. 1. Fills the member's prompt with the ticket. The branch is the ticket's linked one, or a suggested name. 2. Calls `t3_thread_launch` in the T3 Code project the member picked, or the one whose repository matches, with their model, effort and permission mode. In a worktree, the ticket's branch starts from `origin/HEAD`, or continues from the ticket's own branch. 3. Stores the start in `t3code_ticket_start` (migration `20261130193023_t3code_ticket_start`). 4. Records a `t3code_started` entry in the ticket's activity: "started a T3 Code thread in **vite-react-template** ↗", linking to the thread. The ticket's status and assignees are not changed. **Retries.** The member's `clientRequestId` keys both the stored start and T3 Code's own launch, so a retry returns the same thread. If the activity can't be recorded, the start is removed, so the next retry records it. **Clear reasons.** These fail before anything is sent to T3 Code: - not connected - sign-in expired or revoked - read-only approval (`T3CodeCannotStartThreads`) - no T3 Code project chosen (`T3CodeProjectNotChosen`) An unreachable machine gets its own message. When T3 Code itself refuses a start, its explanation travels as `T3CodeError.detail` and is shown to the member. **Permission mode.** A thread runs at most at the mode the member approved ProjectProject for, which `orchestrator_capabilities` reports. - The picker shows "What you approved (Supervised)" and disables broader modes. - A start leaves out a saved mode above the approved one, instead of being refused. - The T3 Code page shows the approved access, and a **Change access** button approves again using the saved address, without disconnecting. ## How it's built - `T3CodeLauncher` in `integration-t3code` handles the launch. - `T3CodeTicketStarts`, a new backend service, ties it to the ticket and its activity. - `TicketActivity.record` is called with an unchanged write, since a start doesn't touch the ticket file. ## Checks - `bun run check` passes, and `bun run test` gives 4,724 pass, 1 skip, 0 fail. - New Postgres tests cover the launcher (project choice, arguments sent, permission limit, each failure) and the start service (storing and recording, retries, nothing left behind on failure). - Tested once end to end against a real T3 Code: the thread was created, the activity line links to it, and a retry returned the same thread. ---------
Members can now connect their own T3 Code under Settings → Profile → Connections. It's the first step of PP-407, starting a ticket's work in your T3 Code from ProjectProject. This PR only connects; starting tickets comes in later PRs, so the changeset is
internal.What a member does: paste the MCP URL from T3 Code (Settings → Sharing & access; the T3 Connect address plus
/mcp) and press Connect. T3 Code's approval page opens in a new tab. On a T3 Connect address that's T3's hosted page: sign in with your T3 Connect account and approve, no pairing code. After approving, the tab returns to Connections and tells the original tab, which updates and shows the machine ("Luuk's MacBook Air"), how long the sign-in is valid, Check and Disconnect. An expired or revoked sign-in shows why, with Reconnect. A read-only approval is flagged, because starting tickets needs Supervised or more.How it's built:
packages/integration-t3code, following the integration-package rules (T3CodeHostsupplies encryption, the address check and the public base URL; noserver-coreimports).isscheck on the callback (RFC 9207), using the MCP SDK's standalone functions. The pending sign-in lives inuser_t3code_oauth_state(hashed state, 10 minutes).t3_environment_readnames the machine and proves the token works. The token is sealed inuser_t3code_integration. Reconnecting and disconnecting revoke the old token in T3 Code.RpcClientwithMcpSchema, over T3 Code's stateless protocol (2026-07-28): one JSON-RPC request per call, no session, withmcp-methodandmcp-namerouting headers.isPublicHostmoved intopublicAddress.tsso both share it.T3CODE_ALLOW_LOCAL_ADDRESSESallows loopback over http in development, and the agent environment turns it on.t3codegroup (profile,connect,checkProfile,disconnectProfile) and four tagged errors, each with copy. There's a newt3code_message file, registered inAGENTS.mdand the Inlang path pattern.Lifetime: T3 Code issues a fixed 30-day token and no refresh token, so members reconnect monthly. We asked upstream whether MCP clients can get the key-bound renewal that pairing links got in pingdotgg/t3code#37980: pingdotgg/t3code#31474 (comment)
Testing:
Created with Claude Opus 5.5 in T3 Code.
🤖 Generated with Claude Code