Skip to content

fix(nix): show the T3 desktop app as T3 instead of Electron - #495

Merged
furedea merged 4 commits into
mainfrom
fix/t3-desktop-app-bundle
Nov 23, 2026
Merged

furedea merged 4 commits into
mainfrom
fix/t3-desktop-app-bundle

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

T3 Code desktop app が Dock・Cmd+Tab・メニューバーで "Electron" と表示される問題を直す.macOS は実行中バイナリを含む bundle の名前を表示するため,llm-agents の launcher が nixpkgs の Electron.app 内のバイナリを exec すると Electron と表示される.dotfiles 側で T3 の bundle を組み立て,その bundle 自身の Electron を起動する.

項目 変更前 変更後
t3codeDesktopPackage llm-agents の t3code-desktop nix/packages/t3code_desktop.nix
実行される Electron nixpkgs の Electron.app/Contents/MacOS/Electron T3 Code (Beta).app/Contents/MacOS/Electron(同じ electron 44.9.3 のコピー)
CFBundleName / CFBundleDisplayName / アイコン Electron / Electron / electron.icns(実行時の表示) T3 Code (Beta) / T3 Code (Beta) / t3code.icns
CFBundleIdentifier com.github.Electron(実行時) org.nixos.t3code-desktop(llm-agents の org.nixos.T3 Code (Beta) は空白と括弧を含み Apple の規則に反するため変更)
署名 nixpkgs の Electron.app 変更後の bundle を codesign --force --deep --sign - で ad-hoc 再署名
PATH と引数 llm-agents の 2 段 wrapper 同じ PATH(signed Codex を含む)と app directory を 1 つの launcher に集約
  • Red:追加した check t3-desktop-app-bundle が既存 package で失敗(CFBundleDisplayName なし)
  • Green:nix build .#checks.aarch64-darwin.t3-desktop-app-bundle が pass
  • plutil -p で名前・identifier・アイコン・CFBundleExecutable を確認,codesign --verify --deep --strict は valid on disk かつ Designated Requirement を満たす
  • launcher の PATH が llm-agents の desktop wrapper と一致し,dotfiles の signed Codex(codex-0.170.0,ADR-0041)を含む
  • nix flake check:all checks passed.nix build で t3-desktop-app-bundle,t3-settings-merge,home-configuration,host-configuration も pass(feat(nix): merge the chosen T3 settings at activation #496 の merge 後の main に rebase した状態)
  • レビュー:claude-review の P2(identifier の文字種)を修正し,check で文字種を検査.codex-review は指摘なし
  • 起動確認:未実施.store path から起動すると稼働中の desktop app と single-instance lock や ~/.t3 を共有する恐れがあるため,Dock 表示の確認は下の手順で利用者が行う

利用者の手順

  1. この PR を merge する
  2. mbp で lane が動いていないときに darwin-rebuild switch を実行する
  3. T3 Code を開き直し,Dock と Cmd+Tab の名前とアイコンが T3 Code (Beta) になっていることを確認する
  4. 通知の許可を求められたら再度許可する(identifier と署名が変わるため)
  5. 問題なければ mba でも darwin-rebuild switch を実行して同じ確認をする
根拠と範囲
  • 起動経路:t3code.desktop/bin/t3code-desktop(--prefix PATH,--inherit-argv0)→ t3code.unwrapped.desktop/bin/t3code-desktop(--add-flags .../libexec/t3code/apps/desktop)→ electron-44.9.3/bin/electron(Electron.app/Contents/MacOS/Electron を exec).Darwin で設定される環境変数は PATH のみ
  • Electron は llm-agents の nixpkgs input の electron_44 を使う(dotfiles の nixpkgs は 44.10.2 で異なる).store path が llm-agents の wrapper のものと一致することを確認済み.check が Electron の version,PATH,app directory のずれを検出する
  • helper は Electron Helper*.app の名前のまま残す
  • bin/t3code-desktop は bundle 内の launcher への symlink として残す
  • ADR-0047(proposed,feat(nix): merge the chosen T3 settings at activation #496 が 0046 を使ったため 0047):.app を dotfiles で組み立てる判断.実機確認後に accepted にする
  • 範囲外:llm-agents upstream,T3 の設定管理(feat(t3): run the T3 Code server on mbp and operate it from mba and iPhone over the tailnet #489 step 5),launchd server(t3codePackage は変更なし),Moshi
  • plan:fix(nix): show the T3 Code desktop app as T3 Code, not Electron, on macOS #494 (comment)
  • 計画からの逸脱:なし

Refs #494

🤖 Generated with Claude Code

@furedea

furedea commented Nov 22, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T02:55:14.720011Z e9a1c0f Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

Review summary

No blocking findings. I read through the new t3code_desktop.nix bundle derivation, the nix/home/default.nix switch to it, and the t3-desktop-app-bundle check.

  • The launcher runs the copy of Electron inside the bundle and passes the same app directory and PATH as the llm-agents wrappers, so the signed Codex from ADR-0041 is kept. The check catches drift in PATH, app directory and Electron version.
  • dontFixup keeps the ad-hoc signature from being undone after signing. The check verifies it with codesign --verify --deep --strict.
  • Leaving the helpers named Electron Helper*.app matches the helper names Electron is compiled to look for.
  • The check is in the Darwin-only section and uses /usr/bin tools, which fits how the other Darwin checks run.

Still untested, as the PR says: the app hasn't been launched to confirm the Dock and Cmd+Tab name and icon.

🤖 Generated with Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 2f05aeac68

ℹ️ 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".

@furedea

furedea commented Nov 22, 2026

Copy link
Copy Markdown
Owner

@codex review

Comment thread nix/packages/t3code_desktop.nix Resolved
@github-actions

Copy link
Copy Markdown
Contributor

Review summary

I reviewed the PR read-only and found no blocking issues.

  • P2 nix/packages/t3code_desktop.nix:40: the running bundle now gets the identifier org.nixos.T3 Code (Beta). Apple doesn't allow spaces or parentheses in CFBundleIdentifier, so notifications and TCC could misbehave. A sanitized identifier would avoid this, and the check would need to change with it.

What looks correct:

  • The helper lookup still works: Electron first looks for Electron Helper*.app, and the PR keeps those names.
  • dontFixup stops fixup from rewriting the Mach-O files after re-signing.
  • Using /usr/bin/codesign and /usr/bin/plutil follows the existing approach in codex.nix.
  • The new check catches drift in PATH, the app directory and the Electron version.

Not verified yet: actually launching the app, which the PR already leaves for the user to do.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 198c0af2b8

ℹ️ 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".

furedea and others added 4 commits November 23, 2026 11:51
macOS names the Dock and Cmd+Tab entry after the bundle that holds
the running binary. llm-agents' launcher execs nixpkgs' Electron.app,
so the app showed as Electron. Assemble a T3 bundle around a copy of
the same Electron with the wrappers' arguments and PATH, and re-sign
it ad-hoc.

Refs #494

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #494

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
llm-agents' "org.nixos.T3 Code (Beta)" contains spaces and parentheses,
which Apple does not allow; the bundle now runs under that identity.

Refs #494

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ADR-0046 was taken by #496.

Refs #494

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@furedea-agent
furedea-agent Bot force-pushed the fix/t3-desktop-app-bundle branch from 8aa9d65 to e9a1c0f Compare November 23, 2026 02:52
@furedea

furedea commented Nov 23, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

Copy link
Copy Markdown
Contributor

Review summary: I found no blocking issues and posted no inline comments.

What I checked:

  • The new t3code_desktop.nix copies llm-agents' Electron.app. It edits Info.plist (name, display name, identifier, icon, executable), adds a binary wrapper as CFBundleExecutable that execs the bundle's own Electron with the upstream app directory and the provider PATH, and then re-signs the bundle ad-hoc. Setting dontFixup correctly stops fixup from changing Mach-O files after signing.
  • The t3-desktop-app-bundle check covers the behaviour that changed: the bundle name and identifier (including the allowed characters), the icon, the launcher target and app directory, PATH matching the upstream wrapper (including the signed Codex), the helper app, the Electron version matching the unwrapped launcher, and codesign --verify --deep --strict. If llm-agents moves to a different Electron, the check fails instead of the build silently running the wrong runtime.
  • The impure /usr/bin/plutil and /usr/bin/codesign calls follow the pattern codex.nix already uses.

One thing is still unverified, as the PR says: launching the app for real (Dock name, single instance, notification permission). That needs the manual step after darwin-rebuild switch.

Blocking findings: 0

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: e9a1c0ffc2

ℹ️ 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".

@furedea
furedea merged commit 29eaa94 into main Nov 23, 2026
23 checks passed
@furedea
furedea deleted the fix/t3-desktop-app-bundle branch November 23, 2026 02:57
furedea added a commit that referenced this pull request Nov 23, 2026
Dock の固定アプリに T3 Code (Beta) を足し,Ghostty の左に置く.#495 で T3 が自分の bundle
で動くようになったので,Dock に固定できる.

| | 変更前 | 変更後 |
| --- | --- | --- |
| Dock の並び | Tinycast → Ghostty → Dia → … | Tinycast → **T3 Code
(Beta)** → Ghostty → Dia → … |

## 確認

- [x] `nix eval` で mbp・mba の `system.defaults.dock.persistent-apps` に
`/Users/<user>/Applications/Home Manager Apps/T3 Code (Beta).app` が
Ghostty の前に入る
- [x] `Home Manager Apps` の `.app` は store への symlink
ではない普通のディレクトリなので,switch 後もパスは変わらない
- [ ] CI
- [ ] 利用者:T3 desktop app を終了し,mbp で `darwin-rebuild switch` → Dock で
Ghostty の左に T3 が出る(mba も同様)

<details>
<summary>範囲</summary>

- 対象:`nix/darwin/default.nix` の `persistent-apps` のみ.
- パスは `config.users.users.${username}.home` から作るので,ホストごとの書き分けは不要.

</details>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: furedea <132188853+furedea@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.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