Skip to content

Draft: explore two-way teleport with native CLI sessions - #1

Draft
baanish wants to merge 18 commits into
mainfrom
cursor/teleport-session-sync-1e23
Draft

Draft: explore two-way teleport with native CLI sessions#1
baanish wants to merge 18 commits into
mainfrom
cursor/teleport-session-sync-1e23

Conversation

@baanish

@baanish baanish commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Draft. Do not merge.

Playground branch for the full teleport integration. Review the six stacked PRs, not this mega diff.

Review these, not this PR

Slice PR Base
1. Teleport backend #8 main
2. Teleport UI #11 #8
3. Codex support #13 #11
4. Claude support #12 #13
5. Grok support #10 #12
6. OpenCode support #9 #10

That stack is the complete work: engine, UI, all four native formats, and the OpenCode Stop/Working settle.

How to open these upstream

From this fork, against pingdotgg/t3code, one draft at a time:

gh pr create --repo pingdotgg/t3code --draft \
  --base main \
  --head baanish:cursor/teleport-backend-1e23

Later slices use --base baanish:<previous-branch>. Do not open this mega branch upstream.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes
Open in Web Open in Cursor 

cursoragent and others added 3 commits August 14, 2026 07:21
Introduce versioned teleport RPC schemas and an internal
thread.history.replace command so native session import can replace T3
history in place without starting a live turn.

Co-authored-by: aanishbhirud <aanishbhirud@gmail.com>
Discover Codex, Claude, OpenCode, and Grok sessions for a project cwd,
import them onto T3 threads in place, and export T3 history back to
native files with temp-write, re-parse, and replace.

Co-authored-by: aanishbhirud <aanishbhirud@gmail.com>
Import native sessions from the command palette after picking a project,
and write the current idle thread back out from the chat header.

Co-authored-by: aanishbhirud <aanishbhirud@gmail.com>
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3fda3226-8e4c-4242-8ffe-0351b5ccd585

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

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.

❤️ Share

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

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL labels Aug 14, 2026
cursoragent and others added 3 commits August 14, 2026 07:41
Restore the command-palette import, mock TeleportService in router tests, and tighten native format helpers so optional fields and filesystem errors typecheck.

Co-authored-by: aanishbhirud <aanishbhirud@gmail.com>
Grok Build stores conversations under ~/.grok/sessions/<encoded-cwd>/<id>/,
not a single JSON file. Import and export now read and write that layout so
a T3 thread can resume in the CLI and come back with CLI turns intact.

Co-authored-by: aanishbhirud <aanishbhirud@gmail.com>
Keep idle threads from racing a second teleport, and do not replace an
existing transcript with an empty native file. Lock the Grok and OpenCode
session files the CLIs actually hold instead of the whole home directory.

Co-authored-by: aanishbhirud <aanishbhirud@gmail.com>
@cursor cursor Bot changed the title Teleport native sessions in and out of T3 Teleport native Codex, Claude, OpenCode, and Grok sessions Aug 14, 2026
cursoragent and others added 2 commits August 14, 2026 21:21
Codex sessions titled themselves from <environment_context> wrappers,
Claude imports mixed in tool_result user records, and OpenCode export
refused while T3's idle process held opencode.db.

Co-authored-by: aanishbhirud <aanishbhirud@gmail.com>
Export left the T3 provider session holding Codex's writer, and a second
export overwrote native Grok history. Store whether the thread is in T3
or the native CLI, stop the T3 session on export, refuse a second export
until import, and swap the header button so import is visible.

Co-authored-by: aanishbhirud <aanishbhirud@gmail.com>
@cursor
cursor Bot changed the base branch from main to feat/teleport-session-import August 14, 2026 23:52
cursoragent and others added 10 commits August 15, 2026 00:24
Cached thread detail can skip HTTP and never see a backfilled
teleport_json column. Put presence on the shell snapshot and fall
back to it so a native thread shows Import instead of Export.

Co-authored-by: aanishbhirud <aanishbhirud@gmail.com>
Native CLIs encode the persisted cwd spelling and lock files with
platform-specific APIs. Match /tmp to /private/tmp, keep Windows
drive-letter case in folder names, replace files without Unix
rename-over, and probe locks without lsof on Windows.

Co-authored-by: aanishbhirud <aanishbhirud@gmail.com>
Use the same export glyph and flip it horizontally when the thread
is native so Import reads as the reverse of Export.

Co-authored-by: aanishbhirud <aanishbhirud@gmail.com>
Import lived only in the command palette, so a blank thread looked
like a dead end. Add a visible Import action on the draft hero and
skip the project picker when the current project is already known.

Co-authored-by: aanishbhirud <aanishbhirud@gmail.com>
OpenCode sqlite parts include step-finish telemetry. Import treated every
part as a message and reused the same id, so the last part (usually
step-finish) overwrote the real assistant text.

Only type=text parts become chat messages, grouped by message id. Sessions
launched from a parent folder also match the T3 project, except generic
roots like /tmp or /home/ubuntu.

Co-authored-by: aanishbhirud <aanishbhirud@gmail.com>
Import from the new-thread screen opened the root command palette, then
fetched sessions, then either pushed a submenu or toasted. That flashed
the command list for a beat.

Open the import submenu in the same turn as the dialog, show a loading
row while listing, and keep empty or error results in that menu.

Co-authored-by: aanishbhirud <aanishbhirud@gmail.com>
Import into a Codex project failed with "Native session file is locked:
opencode.db". That file is T3's live OpenCode store, not a Codex session.
SQLite-backed OpenCode sessions use the db as nativePath, so the lock
probe refused T3's own process.

Skip the shared db. Also stop listing parent-cwd OpenCode sessions under
sibling harness folders such as native/codex.

Co-authored-by: aanishbhirud <aanishbhirud@gmail.com>
Export was writing a header Codex skips (extra format version, no cli_version), so resume treated the first chat line as the start of the file.

Co-authored-by: aanishbhirud <aanishbhirud@gmail.com>
Stop marked the turn interrupted but left the session running, so the thread stayed Working after abort hung or only emitted turn.aborted.

Co-authored-by: aanishbhirud <aanishbhirud@gmail.com>
A projected running OpenCode thread stayed Working after Stop if the
in-memory provider session was already gone. Interrupt no longer
recovers a session just to abort it, and Stop settles the projection
when there is nothing live to interrupt.

Co-authored-by: aanishbhirud <aanishbhirud@gmail.com>
@cursor cursor Bot changed the title Teleport native Codex, Claude, OpenCode, and Grok sessions Draft: explore two-way teleport with native CLI sessions Aug 15, 2026
@cursor
cursor Bot changed the base branch from feat/teleport-session-import to main August 15, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants