Commit 45d1c0a
authored
fix(desktop): run the macOS Host from the helper so it takes no Dock tile (#149)
## Related Issue
No issue — reported directly: a second, unnamed icon appears in the
macOS Dock whenever the desktop app is running.
## Problem
The packaged app starts its Host by re-executing its own binary
(`Pythinker.app/Contents/MacOS/Pythinker`). macOS registers that child
with
LaunchServices as a second **foreground** application under the same
bundle id, so it takes a
Dock tile of its own. A bare executable has no icon, so the tile renders
with the generic
Unix-executable artwork next to the real app icon.
`ELECTRON_RUN_AS_NODE=1` is already set and is not the missing piece: it
stops the child from
becoming a browser process, but it does not affect LaunchServices
registration.
Observed on the installed 0.1.5 build:
```
90) "pythinker-code" bundleID="com.pythinker.desktop"
executable path="/Applications/Pythinker.app/Contents/MacOS/Pythinker"
pid = 83782 type="Foreground"
parentASN="Pythinker" (inferred)
```
## What changed
`resolveHostExecutable` picks the bundled Electron helper
(`Contents/Frameworks/<name> Helper.app`) as the Host runtime on macOS.
The helper declares
`LSUIElement`, so it registers as a UI element rather than a foreground
app and takes no Dock
tile, while running the identical Node runtime. It falls back to
`process.execPath` when the
bundle ships no matching helper, and non-macOS platforms are returned
unchanged.
Verified against the installed bundle:
```
same script via the app binary → type="Foreground" (Dock tile)
same script via the helper → type="UIElement" (no Dock tile)
helper as a Node runtime → node v24.18.1, electron 43.4.0
```
## Checklist
- [x] I have read the
[CONTRIBUTING](https://github.com/PyModel/pythinker-code/blob/main/CONTRIBUTING.md)
document.
- [ ] I have linked a related issue (external PRs: the issue must have a
maintainer's `/approve`).
- [x] I have added tests that prove my feature works. — 3 cases in
`apps/desktop/tests/host-supervisor.spec.ts`; reverting the fix turns
the first one red.
- [x] Ran `gen-changesets` skill, or this PR needs no changeset.
- [x] Ran `gen-docs` skill, or this PR needs no doc update.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **Bug Fixes**
- Fixed a macOS Dock issue that could display a second unnamed Pythinker
icon while the app was running.
- Improved packaged desktop startup behavior across macOS, Windows, and
Linux.
- **Changes**
- Removed managed Kimi update checks, marketplace defaults, official
plugin badges, tips, and sign-up links.
- Kimi remains available as a model provider through OAuth or an API
key; marketplace access requires a configured marketplace URL.
- Updated activity card wording to “subagent.”
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 9e372f0 commit 45d1c0a
4 files changed
Lines changed: 87 additions & 1 deletion
File tree
- .changeset
- apps/desktop
- src
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
312 | 313 | | |
313 | 314 | | |
314 | 315 | | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
315 | 341 | | |
316 | 342 | | |
317 | 343 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
115 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
116 | 122 | | |
117 | 123 | | |
118 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
509 | 510 | | |
510 | 511 | | |
511 | 512 | | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
0 commit comments