Skip to content

feat(windows): add one tray and wait for Automation on send - #131

Closed
daveyb wants to merge 3 commits into
nixfred:mainfrom
daveyb:feat/windows-tray
Closed

daveyb wants to merge 3 commits into
nixfred:mainfrom
daveyb:feat/windows-tray

Conversation

@daveyb

@daveyb daveyb commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Why

Blip on Windows had no pull request yet. The tray in this branch is that client. Two problems showed up once it was running.

A second Start-menu launch opened a second Blip. The tray now takes the mutex Local\Nixfred.Blip. The second process sets Local\Nixfred.Blip.Show, the first process opens its window, and the second process exits.

A direct-message send died at 15 seconds in list_services. That call asks Messages for its services before --yes is checked, and 15 seconds is shorter than the Automation prompt. macOS records an unanswered prompt as a denial after about two minutes. run_osascript waits 150 seconds. On timeout it exits with one sentence, and the Windows bubble already displays that sentence.

Scope

  • windows/BlipTray, windows/BlipShim, windows/text-send.ts, and scripts/win/install.ps1 are the tray, the shim, and the installer.
  • Program.Instance owns the mutex and the show event.
  • planTextSend chooses --to or --chat-id. The body stays on stdin.
  • bridge/mac/imsg-send adds run_osascript and OSASCRIPT_TIMEOUT.
  • bridge/mac/test_imsg_send_wait.py is the CI check for that wait.

Tradeoffs

Waiting 150 seconds does not grant Automation. If the Mac shows no prompt, the send still fails, and it fails later. No real iMessage was sent. The only acceptable target is the sender's own number, and this change does not know that number.

Finding the running window by its title was the other option. A proof window can use the same title, so the mutex is the key.

Blast radius

imsg-send is the Mac tool the Linux client already calls. A send that used to stop at 15 seconds now waits up to 150. Text sends and file sends share that wait. The Windows tray is new and installs for the current user. When the installer creates a config, push_read stays off. An existing host= is left alone.

Verification

py bridge/mac/test_imsg_send_wait.py failed while list_services waited 15 seconds and run_applescript waited 30. It passed after run_osascript.

The installed Mac tool, with a fake osascript that sleeps 20 seconds and prints one service line, printed RESULT timeout elapsed=15.03 on the old script and RESULT ok elapsed=20.17 on the new one. The installed file reports OSASCRIPT_TIMEOUT 150.

Two launches of the installed Blip.exe left one process. The startup log added up, then show, then shown.

No message was sent, no thread was marked read, and no conversation was opened.

daveyb added 3 commits October 4, 2026 19:21
Blip on Windows is a WinForms tray. collector.ts and thread.ts stay the message plane. A .NET shim stands in for blip-shim and publishes as imsg.exe and the other tool names.

A second launch opens the running window and exits. The mutex Local\Nixfred.Blip is what keeps that second process out, and Local\Nixfred.Blip.Show is how it asks the first process to open.

scripts/win/install.ps1 publishes the current-user build and adds the Start menu shortcut.
list_services stops Messages after 15 seconds, and run_applescript stops it after 30. An unanswered Automation prompt becomes a denial after about two minutes, so both calls have to wait at least 150 seconds and exit with one sentence.
run_osascript is the one AppleEvent wait for list_services and for the send. A timeout exits with the Automation sentence. The Windows tray already puts that sentence on the failed bubble.

The old 15 second kill raised TimeoutExpired before a direct-message send could start.
@daveyb
daveyb requested a review from nixfred as a code owner October 4, 2026 23:23
@nixfred

nixfred commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Thank you, David, and welcome. A Windows client for Blip is a real piece of work, and the single-instance mutex and the honest tradeoff notes show care.

I took the Mac-side fix: your two commits (imsg-send waits 150 s for the Automation prompt, and test_imsg_send_wait.py in CI) are on main with your authorship, b440a49 and 1b55b40. That helps every Blip user: a first send no longer dies before anyone can click Allow, and it matches Blip's own rule about never cutting a consent prompt short. It is live on my Mac.

The Windows tray I would rather not carry in this repo. Blip is built and tested as an Omarchy plugin, I can't build or test C# here, and every Windows bug would land on a reviewer who can't reproduce it. It deserves an owner who runs Windows. If you publish it as its own repo (blip-windows, say) using this repo's bridge as the Mac side, I will link it from the README, and bridge changes you need are welcome here as PRs like this one. I'm closing this PR on that basis; please don't read it as a no to the work.

One small ask: I thank contributors by name in a weekly post on X. Is there an account you'd like tagged? "Rather not be tagged" is an equally good answer.

@nixfred nixfred closed this Oct 5, 2026
nixfred added a commit that referenced this pull request Oct 5, 2026
… they sat open (one-way doors)

LR-T: blip, weekly-notes, change-log, roster, door-classifier, #127, #122, #83, #131
LR-D: blip

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BeRMdPWNC2myz9U8hEeeCi
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.

2 participants