Skip to content

fix(apps): open an app's window under the installed linux service - #30992

Merged
bolichen97 merged 1 commit into
mainfrom
fix/30068-open-app-service-display
Nov 6, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/30068-open-app-service-display

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

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 an openCommand answers "remote": true with "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

What changed (motivation → approach → change)

The Open route decided "remote" from the gateway's own environment only: not macOS, and no DISPLAY or WAYLAND_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_KEYS are 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.md describes the lookup in the openCommand section.

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_launching stubs 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

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 6, 2026 02:29
@bolichen97
bolichen97 requested a review from Zedmor November 6, 2026 02:29
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 6, 2026
@bolichen97
bolichen97 enabled auto-merge (squash) November 6, 2026 02:43
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision fbbbe4ab7da7d2cb309b18a632d5e623070980e3 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of fbbbe4ab7da7d2cb309b18a632d5e623070980e3 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. The fix reuses the existing desktop-session lookup (platform_compat_trust._user_manager_desktop_session), which already serves the file manager. There is one caller site and no new surface.

What this change ships

Inventory (5 items) — 5 justified

Intent: A Linux desktop user running the gateway as the installed service can press Open on an app and see it launch. FIX (#30068).

  1. On a Linux service host with a live desktop login, Open now launches the app instead of answering "running remotely". — justified
  2. The launched child gets the session's display, X cookie and desktop name when the gateway has none, and the session's desktop name replaces the gateway's own. — justified
  3. On a Linux gateway whose environment names no display, Open now asks systemd off the event loop before replying. The answer is cached. — justified
  4. The openCommand section of the manifest reference describes the session lookup. — justified
  5. The headless-host test now stubs the lookup, so it no longer depends on the test host's login. — justified

[FIRST-PRINCIPLES-REVIEWED] fbbbe4a

Description read

[DESCRIPTION-READ] b13896a66ffda5add96981b5456ca66e3642250fc421abebba3d46f6e461b270

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of fbbbe4ab7da7d2cb309b18a632d5e623070980e3 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • The only open item is the manual check the description already names: on a GNOME or KDE login with the gateway installed as the service, Open should show the app's window. Linux CI never runs the live-session branch outside the stubbed test.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed fbbbe4ab7da7d2cb309b18a632d5e623070980e3 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] fbbbe4a

Verdict parsed from the review's SHA-scoped output markers for commit fbbbe4ab7da7d2cb309b18a632d5e623070980e3.

False positive or not applicable? A repository writer can comment:
/ai-review override fable fbbbe4ab7da7d2cb309b18a632d5e623070980e3 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of fbbbe4ab7da7d2cb309b18a632d5e623070980e3 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] fbbbe4a

False positive or not applicable? A repository writer can comment:
/ai-review override gpt fbbbe4ab7da7d2cb309b18a632d5e623070980e3 false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 6, 2026
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.
@bolichen97
bolichen97 force-pushed the fix/30068-open-app-service-display branch from 89e0e16 to fbbbe4a Compare November 6, 2026 07:14
@bolichen97

bolichen97 commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

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 (test_the_lazy_imports_stay_inside_the_functions_that_need_them, 131 == 130) was a count main has since updated; this PR does not touch that module.

[operator: bolichen97]

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 6, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved by Crew Captain for the on-call: checks green, PR Readiness passed, review lanes clean on this head.

@bolichen97
bolichen97 merged commit 0f93202 into main Nov 6, 2026
98 checks passed
@bolichen97
bolichen97 deleted the fix/30068-open-app-service-display branch November 6, 2026 09:41
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 6, 2026
buluoray pushed a commit that referenced this pull request Nov 8, 2026
…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)
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.

Linux service install: an app's Open says Kiro Crew is running remotely on a desktop host

2 participants