Repository navigation
fix(apps): open an app's window under the installed linux service - #30992
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The fix reuses the existing desktop-session lookup ( What this change shipsInventory (5 items) — 5 justifiedIntent: A Linux desktop user running the gateway as the installed service can press Open on an app and see it launch. FIX (#30068).
[FIRST-PRINCIPLES-REVIEWED] fbbbe4a Description read[DESCRIPTION-READ] b13896a66ffda5add96981b5456ca66e3642250fc421abebba3d46f6e461b270 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the change reuses the checked, cached desktop-session lookup the file manager already relies on, and only gains a launch case. Notes
[DESIGN-REVIEWED] fbbbe4a Description read[DESCRIPTION-READ] de15e2f7185cc7a69c4cafd3d74991722ae03f30b5faca02e5b5814306e29c15 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
An app's Open action decided "remote" from the gateway's own environment only. The installed Linux service is a system unit, so its environment never names a display server, and every Open on a desktop host answered "Kiro Crew is running remotely" instead of launching. When the gateway names no display, ask the desktop session the user's systemd manager names, the same checked lookup the file manager already uses, and launch when it is live. The launcher gets that session's display, X cookie and desktop name; the session never supplies a bus address, so the child's bus reach is unchanged.
89e0e16 to
fbbbe4a
Compare
|
Rebased: main moved in files this PR touches or imports since this head's CI ran (7ecc6c9 -> 6c9b032); CI re-running. The backend shard 6 failure ( [operator: bolichen97] |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved by Crew Captain for the on-call: checks green, PR Readiness passed, review lanes clean on this head.
…0992) An app's Open action decided "remote" from the gateway's own environment only. The installed Linux service is a system unit, so its environment never names a display server, and every Open on a desktop host answered "Kiro Crew is running remotely" instead of launching. When the gateway names no display, ask the desktop session the user's systemd manager names, the same checked lookup the file manager already uses, and launch when it is live. The launcher gets that session's display, X cookie and desktop name; the session never supplies a bus address, so the child's bus reach is unchanged. (cherry picked from commit 0f93202)
Problem / Motivation
Goal: On a Linux desktop running the installed gateway service, an app's Open action launches the app instead of saying Kiro Crew is running remotely.
With the gateway installed as a service (
kirocrew service install), pressing Open on an app whose manifest has anopenCommandanswers"remote": truewith "Kiro Crew is running remotely. Run this on your local machine: ...". Nothing opens, even though the user is sitting at that machine.Why it matters
Every Linux desktop user who runs the gateway as the installed service cannot open any app that launches outside the dashboard (for example an Electron app). The message also tells them something false about their setup.
Not a goal
openCommandchild gets. That question stays with apps: standard-mode openCommand child holds a live user-bus address #16520.What changed (motivation → approach → change)
The Open route decided "remote" from the gateway's own environment only: not macOS, and no
DISPLAYorWAYLAND_DISPLAY. The installed service is a system unit, so that environment never names a display server, even on a desktop host. #30083 fixed the same cause for the dashboard's file manager.handle_open_app(src/kiro_crew/apps/routes_enable.py) now asks the same lookup when the gateway names no display. The lookup asks the user's systemd manager for the desktop login's session, checks each value, and counts a display only while its socket exists. It runs off the event loop. If a live session answers, the route launches instead of answering remote.The launcher's desktop hints come from that session when the gateway has none. Only the names already in
_OPEN_COMMAND_DESKTOP_ENV_KEYSare copied (display, X cookie, desktop name). The session never carries a bus address, so the child's bus locators are exactly what they were. A gateway that names its own display behaves as before.The decision is about the gateway host, not the caller: with a live desktop login the window opens on that host's screen, as it already does on macOS.
docs/app-kit/manifest-reference.mddescribes the lookup in theopenCommandsection.Backwards compatibility
Compatible: a gateway with its own display, macOS and native Windows take the same path as before; only a Linux gateway with no display gains a launch when a live desktop session exists.
Removes nothing: the route only gains a case where it launches; no key, path or answer shape is removed.
Tests
test_a_desktop_login_launches_under_the_installed_service: with no display in the gateway's environment and a live session from the user's manager, Open spawns the command. The child gets the session's display, and its desktop name over the gateway's own, but no name outside the launcher's hint list.test_headless_host_returns_command_instead_of_launchingstubs the lookup to "no session", so the headless answer no longer depends on the test host's own login.Proof: PROVEN test/test_apps_routes_coverage_app_serving.py::TestOpenApp::test_a_desktop_login_launches_under_the_installed_service (head fbbbe4a)
Determinism: both tests 20/20 at
-n0; the whole file 10/10 at-n 4; the file's 48 node ids in a shuffled order (seed 30068) all pass.Gates run locally: backend related tests (385 passed), black, isort, flake8, mypy, subprocess encoding, comment history, brand name, harness parity, feature map, line cap, sync-io, docs-lint, flake ratchet. Not run: semgrep (not installed on this host) and the frontend related set (no
website/change).Manual verification
Not run on a desktop: this host has no desktop session. Still needed: on a GNOME or KDE login with the gateway installed as the service, press an app's Open and see its window appear.
Related Issues
Closes #30068
Sibling sweep
Swept: git grep -nE 'environ(.get)?(?[?"(DISPLAY|WAYLAND_DISPLAY)"' -- src/
Sibling: src/kiro_crew/apps/routes_enable.py -- changed here
Sibling: src/kiro_crew/platform_compat_trust.py -- not affected -- already asks the user manager since #30083
Sibling: src/kiro_crew/cli.py -- not affected -- browser auto-open for the caller's own terminal, the same check the gateway's boot-time auto-open runs; the service starts with --no-open
Sibling: src/kiro_crew/cloud/connect.py -- not affected -- runs in the user's own shell, which carries its display
Sibling: src/kiro_crew/cloud/login.py -- not affected -- runs in the user's own shell, which carries its display
Pattern harvest
Not generalizable: the only remaining server-side display check reads the user manager already; the other sites run in the user's own terminal, where the environment is the right source.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)