Skip to content

T3 Code clone: open prompt and thread links as unsent drafts - #758

Merged
daehyeon-mun merged 7 commits into
daehyeon/t3-code-mainfrom
daehyeon/t3-up-prompt-links
Oct 18, 2026
Merged

daehyeon-mun merged 7 commits into
daehyeon/t3-code-mainfrom
daehyeon/t3-up-prompt-links

Conversation

@daehyeon-mun

@daehyeon-mun daehyeon-mun commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Prompt links now open a draft in T3 Code. A plain prompt opens No project; repository and pull request links find the matching project or existing thread across connected environments. Hidden characters are removed with a persistent warning, existing drafts require Replace draft, and a new pull request worktree requires Check out before any setup script runs. Links never send messages automatically.

The palette offers Copy prompt link and Copy prompt link with repo and model; user messages have a Copy prompt link action. Packaged builds declare t3code with distribution_only: true and /open?u=%s, using the separately adopted framework support. Development and lane bundles register no scheme. Lane verification enters the app route directly.

Ported upstream 5fe7568e87 (pingdotgg/t3code#18454), matching reference 9c161462c9. Shared parsing, hidden-character rules, repository/model selection, draft replacement text and checkout choices follow the upstream implementation; the app reuses its existing connection fleet, project cloning and PR preparation operations.

Acceptance Result Proof
Plain, repository and thread links prepare an unsent draft Native plain-link drive passed; repository/thread routing regressions pass Unsent draft, tests
Hidden characters and existing drafts Native drive asserted exact sanitized text and empty thread ID; warning/replacement tests pass Draft pair, tests
Existing PR thread and explicit new PR checkout Handler tests pass; no preparation before confirmation Handler tests
Missing repository clone / No project choices Native choices render above empty-home landing; clone requires explicit action Repository pair
Copy links from palette and user messages Native-clipboard adapter tests pass Copy tests
Packaged-only handler, no lane scheme Approved declaration; final Info.plist has neither handler nor URL scheme Manifest and final native bundle inspection

Native qualification at c5f5ed247; final source merges integration de2558b58b (including #754) at 673945745:

  • Full Bun suite: 5,120 passed, zero failures, 123,043 assertions across 356 files. The focused prompt tests: 26 passed, 111 assertions.
  • Frozen install, generator, strict app TypeScript, full optimized Contract preflight (32.6 MB plan), caps and boot passed.
  • Final native bundle passed. Its Info.plist contains neither CFBundleURLTypes nor ExactProtocolHandlers.
  • After integrating the current target: 763 affected tests passed (3,250 assertions across 34 files), strict TypeScript, full Contract preflight (35,525,218 bytes), caps and whitespace checks passed. No new native bake was needed for that app-task merge; final combined native qualification follows integration.
  • Matched native before/after captures passed, including missing-repository choices above the landing and a sanitized, unsent draft. Both fixtures use isolated lane homes and an explicit Git ceiling so the real server offers its scratch workspace. No OS scheme is registered or invoked.

Incoming repository link before and after

Sanitized unsent draft before and after

Known differences: none identified in the scoped behavior. The scheme-registration framework change was reviewed separately in #747 and is already adopted by the target branch; this PR changes app files only.

Prepared with Codex; continues work begun in the prior Claude session.

daehyeon-mun and others added 6 commits October 18, 2026 23:51
Co-Authored-By: Codex <noreply@openai.com>
…choices

Register the T3 Code protocol only for distribution builds, route cold and warm links through the app, and reuse existing project, fleet and pull request preparation operations.

Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
@daehyeon-mun

Copy link
Copy Markdown
Collaborator Author

Matched native BEFORE/AFTER: incoming missing-repository choices and an unsent sanitized prompt. Both runs use isolated lane homes and an explicit Git ceiling; the t3code OS scheme was neither registered nor invoked.

Incoming repository link: before and after

Sanitized unsent prompt: before and after

@daehyeon-mun
daehyeon-mun marked this pull request as ready for review October 18, 2026 16:19
@daehyeon-mun
daehyeon-mun merged commit 6daa324 into daehyeon/t3-code-main Oct 18, 2026
2 checks passed
daehyeon-mun added a commit that referenced this pull request Oct 18, 2026
)

Settings → General can install or remove the desktop `t3` command. The
app writes an executable launcher in `<T3 home>/bin`, prefers a writable
command directory already on PATH, preserves foreign commands, and warns
when another `t3` runs first. Its launcher preserves arguments and
`T3CODE_HOME` overrides and passes `T3CODE_CLI_PATH` to the bundled CLI
and backend.

Installed-backend admission and CLI availability share the exact
distribution-only handler plus registered-scheme predicate. No unwritten
resource marker is needed; ordinary development and `--release` builds
retain the isolated home/port guard.

Desktop bootstrap credentials derive from a native in-memory secret in
twelve-hour HMAC windows. The server receives the secret through its
stdin bootstrap envelope; fresh exchanges derive the current token after
suspend. Diff previews preserve the project's cwd without retrying at
the server's cwd. Project icon writes and the native picker admit
`.icns`; server conversion is supplied by #740's immutable runtime.

Upstream commits followed at `9c161462c9`: `0678e4e23d` (#16683),
`73e87f683a` (#16676), `3bfbc37dbf` (#17351), `5afe18eaf9` (#16275),
`cfbd1457ad` (#17724), `de49d637d4` (#17149). Their server-side portions
come from the merged runtime pin.

| Acceptance | Result | Proof |
| --- | --- | --- |
| Install/remove, PATH ordering and foreign command preservation |
Native executable/filesystem fixtures pass | [Native
tests](https://github.com/ccheever/exact2/blob/c9b1f2e41aa5bba81675683ab7adc49dda34ef45/examples/t3-code/macos/tests/local-backend/cli.swift)
|
| Launcher arguments, home override, CLI path and moved app | Real
launcher subprocesses pass, including Unicode and shell metacharacters |
Same native tests: three focused launcher cases pass at final source |
| Installed backend and distribution-only CLI availability | One
metadata predicate requires the exact handler and scheme; marker-only,
incomplete and wrong metadata remain refused |
[Policy](https://github.com/ccheever/exact2/blob/c9b1f2e41aa5bba81675683ab7adc49dda34ef45/examples/t3-code/modules/apple/T3LocalBackend.swift),
sixteen native policy/launcher/inspection cases pass |
| Twelve-hour rotation and secret envelope | Native known HMAC vector,
boundary, secret separation, dynamic clock and stdin tests pass; real
app connects to the official server | [Live
connection](https://github.com/user-attachments/assets/5541c209-39f6-431b-ac82-b88eb71454cd)
and native tests |
| Project cwd remains authoritative | Actual client command makes one
request and preserves its error | [Diff
regression](https://github.com/ccheever/exact2/blob/c9b1f2e41aa5bba81675683ab7adc49dda34ef45/examples/t3-code/tests/diff/diff-opens-on-changes.test.ts)
|
| `.icns` project icons | Project-update validation and native picker
admission pass | Native picker fixture and immutable server conversion
from #740 |

Validation:

- Final integrated source `c9b1f2e41a` includes reviewed provider
integration `4d312fec8f`. Generated assets, **891 affected tests with
zero failures (5,431 assertions/72 files)**, strict app TypeScript, full
Contract preflight (36,911,323 bytes), caps and whitespace passed.
- All app Swift plus backend/media-preview inspection fixtures compiled
at this final head. **Sixteen focused native policy/launcher/inspection
tests passed** with temporary homes and metadata dictionaries. They
cover complete/missing/wrong metadata, marker-only backend refusal,
packaged defaults and explicit home/port overrides, virtual port
exhaustion, launcher execution, and legacy inspection compatibility. No
packaged app was launched against the real home/3773, no lane metadata
was altered, and no OS scheme was registered.
- Frozen feature snapshot `4c791b6bd`: full Bun suite **5,576 passed,
zero failures, 125,211 assertions across 359 files**. Frozen
install/generator, strict app TypeScript, optimized Contract preflight
(34.4 MB plan), caps and boot passed.
- Native local-backend/CLI suite: **94 passed, zero failures**,
including six new CLI/bootstrap/icon cases. The subsequent `6af0045d5`
adjustment changed only the launcher's internal shell variable to
`t3_home`; all app Swift recompiled, three focused real launcher tests
passed, and caps/whitespace passed. No full native rebake was needed for
that variable rename.
- Terminal assets, offline runtime staging and signed native bundle at
`4c791b6bd` passed. The bundled 80,665,649-byte official archive
independently hashes to
`6bd4ba617d321f31ac0c4bffe154ab14bf9ed8d67a7c244dcbda4c5f9581c521`;
staging verified eleven Mach-O signatures, the actual CLI version and
isolated startup.
- Matched native BEFORE/AFTER passed on their first attempts, at
1280×840 with fresh isolated stores and homes. The search entry changes
from absent to present; AFTER connects to the real
`0.1.1-nightly.20261018.3302` server at port 16498 with the new secret
envelope. BEFORE uses the required baseline bundle at port 16499. Their
4,052/3,145-entry journals contain no 3773 requests. Both apps closed
and their PIDs are gone.

![Desktop t3 command search before and
after](https://github.com/user-attachments/assets/dec77887-61c4-4f95-8f5e-29bf38316094)

![Real desktop bootstrap connection before and
after](https://github.com/user-attachments/assets/5541c209-39f6-431b-ac82-b88eb71454cd)

The runtime version difference in the second pair belongs to #740; this
PR's verified change is successful startup/authentication with the
rotating secret envelope. Development bundles intentionally hide
Install, so launcher mutations are qualified by native
filesystem/subprocess fixtures rather than forcing distribution metadata
into a lane build.

Known differences: Exact ships the server as an executable rather than
Electron's Node entry, so the launcher invokes the verified installed
executable directly. The packaged-local-home blocker is resolved by the
shared metadata predicate, using #758's approved distribution-only
handler. Existing home/port overrides and defaults remain unchanged. A
legacy `distribution.json` marker alone no longer admits backend/browser
home access; it remains an additional Web Inspector-disable condition,
preserving old release inspection behavior and production receipt
handling. The resolution is recorded in
`clone/issues/cli-and-tokens-packaged-local-home.md`.

The existing isolated real-bootstrap images qualify frozen bundle
`4c791b6bd`; the shared packaging predicate is separately qualified by
the final-head pure policy tests, so no full bundle rebake was needed.
No framework files change, and evidence stays outside git.

Prepared with Codex; continues work begun in the prior Claude session.

---------

Co-authored-by: Codex <noreply@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant