Draft: explore two-way teleport with native CLI sessions - #1
Draft
baanish wants to merge 18 commits into
Draft
Conversation
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>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
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>
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>
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>
4 tasks
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.
Review these, not this PR
mainThat 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:Later slices use
--base baanish:<previous-branch>. Do not open this mega branch upstream.Checklist