Skip to content

t3code: split desktop app into t3code-desktop and t3code-cli - #555814

Open
repparw wants to merge 1 commit into
NixOS:masterfrom
repparw:t3code-split-desktop
Open

repparw wants to merge 1 commit into
NixOS:masterfrom
repparw:t3code-split-desktop

Conversation

@repparw

@repparw repparw commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Split t3code into t3code-cli (server and web UI) and t3code-desktop (Electron app). Keep t3code as a warning alias for the desktop package.

The CLI derivation runs pnpm exec vp run --filter t3 build; upstream's task graph includes the web UI as a dependency. Only the desktop variant runs build:desktop, installs desktop artifacts, and references the Nix Electron package. The shared pnpm dependency fetch remains unchanged and still includes desktop npm dependencies; this is not a promise to eliminate every desktop-related tarball from the fetch.

Rebased onto master at e211f4b80b83, retaining its T3 Code 0.1.0 source, dependency hashes, and packaging updates. Provider wrappers, resource monitor, shell completions, and desktop integration remain available.

Validation for this revision:

  • Formatting and git diff --check pass.
  • Complete CLI derivation graphs on x86_64-linux and aarch64-linux contain no Electron derivations; the desktop graph does include Electron.
  • Both variants evaluate with the intended build commands and share the original pnpm dependency output.
  • Fresh x86_64-linux nix-build -A t3code-cli.unwrapped --no-out-link passed. Output: /nix/store/4w2fnzwxw1j10hvwlsw4xbxhsf8r1i0j-t3code-unwrapped-0.1.0.
  • Actual task log contains only apps/web and apps/server builds. The server bundled the web app into dist/client.
  • t3 --version reports t3 v0.1.0. An isolated t3 serve --mode web with a temporary home/state directory returned HTTP 200 and HTML on loopback; it was stopped afterward.
  • The built output has no desktop executable or installed desktop app directory, and its runtime closure has no Electron package.
  • No fresh ARM build or desktop runtime test is claimed for this revision; ARM was checked through derivation evaluation and dependency inspection.

Assisted by Codex (OpenAI GPT-6.1-sol); validation uses Nix derivation inspection, nixfmt, and an isolated CLI/HTTP smoke test.

@nixpkgs-ci
nixpkgs-ci Bot requested review from iamanaws and qweered August 23, 2026 18:11
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. llm-assisted Contributions that include code generation with LLMs labels Aug 23, 2026
@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. labels Aug 23, 2026
repparw added a commit to repparw/nix that referenced this pull request Aug 23, 2026
No host ships an Electron t3code/opencode app anymore. The split
stopgap reduces to stripping the launcher from t3code until
NixOS/nixpkgs#555814 merges; the local builder package is deleted.
Mod+G now spawns a chromium --app window against the self-hosted web
UI (t3code-web.service, 127.0.0.1:3773).
@teutat3s teutat3s mentioned this pull request Aug 24, 2026
28 of 50 tasks
@repparw
repparw force-pushed the t3code-split-desktop branch from 772b352 to 364a4a1 Compare August 25, 2026 00:26
@repparw

repparw commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

Squashed history to a single commit per the one-commit-per-PR convention. Content since your review of 8938a54c: the electron_43 bump (previously a separate commit) and a fix for the missing .desktop entry (symlinkJoin doesn't run copyDesktopItems, so the desktop item is merged into paths now — verified installed in the built output on x86_64 and aarch64).

@repparw
repparw force-pushed the t3code-split-desktop branch from 364a4a1 to 5b444eb Compare August 25, 2026 00:58
@repparw

repparw commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up pushed on the same commit: t3code now builds t3code-unwrapped server-only by default (enableDesktop ? true on the unwrapped derivation; the desktop workspace is dropped from the monorepo build filters and install). t3code-desktop builds its own desktop-enabled copy, so it is unchanged in behavior. Rationale: headless t3 serve --mode web users shouldn't compile or store the desktop workspace at all. Verified on x86_64: server-only output is 205 MB / 136 closure paths / zero Electron references, and t3 serve --mode web serves the UI; t3code-desktop still builds with the desktop entry and Electron. aarch64 check running on a Pi 5.

@repparw
repparw force-pushed the t3code-split-desktop branch from 5b444eb to f7cc9a5 Compare August 25, 2026 01:07

@qweered qweered left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm otherwise

@iamanaws iamanaws left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me. I think it is a good move, but I'm not sure I would like to break people configs by moving the package around t3code -> t3code-desktop unexpectedly, just like that

@repparw

repparw commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor Author

It looks good to me. I think it is a good move, but I'm not sure I would like to break people configs by moving the package around t3code -> t3code-desktop unexpectedly, just like that

I think policy is adding aliases only if it landed in stable already. think it wasn't? might want to double check

it's on 26.05, how do we want to proceed? it wouldn't fail outright but it would point to the cli/server now
do we add an alias for t3code to desktop? a warning to choose between the new options? or do we keep t3code for the whole one and name the other -cli?

@repparw

repparw commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

doesn't seem like there's a standard in repo

bitwarden-cli / bitwarden-desktop
plex / plex-desktop
1password-cli/ 1password-gui

might be better to do -cli and -gui/desktop and just throw a warning?

@repparw
repparw force-pushed the t3code-split-desktop branch from f7cc9a5 to 0d8bf64 Compare August 31, 2026 03:08
@repparw repparw changed the title t3code: split desktop app into t3code-desktop t3code: split desktop app into t3code-desktop and t3code-cli Aug 31, 2026
@repparw

repparw commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

Restructured per this thread: t3code-cli (server/CLI, desktop workspace skipped at build time) + t3code-desktop (Electron app, unchanged behavior), with t3code kept as a lib.warn shim resolving to t3code-cli — so existing pkgs.t3code configs keep working with a pointer to the new attr rather than silently losing the launcher. No aliases file needed since the name stays in by-name.

@nixpkgs-ci nixpkgs-ci Bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Aug 31, 2026
Comment thread pkgs/by-name/t3/t3code/package.nix Resolved
Comment thread pkgs/by-name/t3/t3code-cli/package.nix Resolved
Comment thread pkgs/by-name/t3/t3code-cli/package.nix Resolved
Comment thread pkgs/by-name/t3/t3code-cli/package.nix Resolved
@repparw
repparw force-pushed the t3code-split-desktop branch from 0d8bf64 to 8a5b38f Compare August 31, 2026 04:33
@repparw

repparw commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

Applied all review items: t3code/package.nix removed in favor of warnAlias in pkgs/top-level/aliases.nix pointing at t3code-desktop (per your suggestion); enableDesktop ? false is now the unwrapped default with the desktop package passing true explicitly; and all the flagged comments are gone. Rebased onto master (picked up the 0.0.34 bump from #556674).

@nixpkgs-ci nixpkgs-ci Bot removed 2.status: merge conflict This PR has merge conflicts with the target branch llm-assisted Contributions that include code generation with LLMs labels Aug 31, 2026
@repparw
repparw requested a review from iamanaws October 21, 2026 13:29
@repparw
repparw force-pushed the t3code-split-desktop branch from 51f7cd2 to 22be378 Compare October 24, 2026 01:50
@nixpkgs-ci nixpkgs-ci Bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Oct 24, 2026
@repparw

repparw commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current master and pushed 22be3786e226, retaining the existing 0.1.0 version and dependency hashes.

Also corrected the remaining server-only build issue: enableDesktop = false previously skipped installing desktop artifacts but still ran build:desktop. The CLI now runs pnpm exec vp run --filter t3 build, which builds the server and its web UI dependency. The desktop variant still runs build:desktop.

Verified on this revision:

  • All applicable CI checks pass; merge conflicts are resolved.
  • Complete CLI derivation graphs on x86_64-linux and aarch64-linux contain no Electron derivations.
  • A fresh x86_64-linux server build passed. An isolated t3 serve --mode web returned HTTP 200 with the web UI; its output has no desktop executable and its runtime closure contains no Electron.

The shared pnpm dependency fetch is unchanged and still includes desktop npm dependencies. No fresh ARM build or desktop runtime test is claimed for this revision.

Assisted by Codex (OpenAI GPT-6.1-sol).

@nixpkgs-ci nixpkgs-ci Bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Oct 24, 2026
@repparw
repparw force-pushed the t3code-split-desktop branch from 22be378 to f605bbc Compare October 26, 2026 21:51
@nixpkgs-ci
nixpkgs-ci Bot requested a review from 0x4bs3nt October 26, 2026 21:57
@nixpkgs-ci nixpkgs-ci Bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Oct 26, 2026
@pbsds
pbsds removed their request for review October 27, 2026 20:12
@nixpkgs-ci nixpkgs-ci Bot added 2.status: merge conflict This PR has merge conflicts with the target branch and removed 2.status: merge conflict This PR has merge conflicts with the target branch labels Oct 29, 2026
@repparw
repparw force-pushed the t3code-split-desktop branch from 5280d0c to b822302 Compare October 30, 2026 18:19
@repparw

repparw commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor Author

The server bundle inlines everything except what upstream's selectCliRuntimeExternalDependencies (scripts/lib/cli-external-packages.ts) selects. Running that function on the source at build time and copying apps/server/dist plus the pnpm closure of the selected packages gave me 287 MiB and ~7k files, with no list to maintain. t3 serve works in normal use (pairing, terminals, Claude sessions). That's close to upstream's own @t3code/t3-linux-x64 (288 MiB, 4.6k files).

I've opened a draft follow-up for the smaller CLI runtime: repparw/nixpkgs#2, stacked on this PR.

Native builds and runtime validation are still pending. This does not need to block 555814 Once the split merges, I'll rebase the optimization onto master and submit it separately.

AI disclosure: drafted with ChatGPT (OpenAI GPT-6), reviewed before posting.

@nixpkgs-ci nixpkgs-ci Bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Nov 1, 2026
@repparw
repparw force-pushed the t3code-split-desktop branch from b822302 to c47ba2b Compare November 2, 2026 17:11
@nixpkgs-ci nixpkgs-ci Bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Nov 2, 2026
@nixpkgs-ci nixpkgs-ci Bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Nov 10, 2026
Retain upstream 0.1.8 packaging and align the desktop identity with Electron.

Assisted-by: ChatGPT (OpenAI GPT-6.1-sol)
@repparw
repparw force-pushed the t3code-split-desktop branch from 41b4f5e to 80042d4 Compare November 13, 2026 01:53
@nixpkgs-ci nixpkgs-ci Bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 3+ This PR was reviewed and approved by three or more persons. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. llm-assisted Contributions that include code generation with LLMs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants