Skip to content

fix: close the hosted macOS agent-device connection on stop - #5658

Merged
janicduplessis merged 3 commits into
mainfrom
fix/5604-hosted-macos-agent-session
Nov 13, 2026
Merged

janicduplessis merged 3 commits into
mainfrom
fix/5604-hosted-macos-agent-session

Conversation

@janicduplessis

@janicduplessis janicduplessis commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Description

stim stop queried the unnamed agent-device remote connection for a hosted macOS app. Agent-device refuses unnamed commands on leased connections, so the host stops the app while the agent's saved connection stays open.

Solution

Include a stable workspace-specific session name in the hosted macOS command. On Stop, check that name and any explicit AGENT_DEVICE_SESSION. Close and disconnect a name only when agent-device reports that exact name and the same canonical remote config. If cleanup of a verified connection fails, print the exact disconnect command and let the hosted Stop finish.

An earlier connection can be checked by running Stop with its session name and the same agent-device state directory. Stop cannot discover an ad hoc name or a different state directory the caller does not supply. The guide describes how to disconnect those manually.

Test plan

  • 196 hosted macOS, hosted iOS and guide tests passed. They cover command arguments, a custom session, conflicting session names and config paths, and a quoted manual command after cleanup fails.
  • Verified named status, close and disconnect against agent-device 0.21.36 with a fake local macOS lease. The Mac mini refused a live validation run because incoming builds were paused.
  • Formatting, lint and type checking passed.

Related to #5604

@janicduplessis janicduplessis added area: cli packages/stim-cli, including its README and guide area: website website/ ci-full run the macOS, Windows, Desktop and license jobs on this pull request labels Nov 13, 2026
@janicduplessis

Copy link
Copy Markdown
Collaborator Author

Fresh independent review after Full suite success found no actionable issues at c9ab2e5. Stop checks the deterministic name and any explicit literal name against the canonical config before closing or disconnecting. The fallback quotes the exact name without printing the vendor error or config. All 164 focused cases passed independently. Live hosted Desktop verification was unavailable because the mini was paused. #5604 remains open for names or state directories that were never supplied to Stim.

Configured Codex review:

No actionable regressions found in session naming, connection ownership checks, or cleanup behavior. Runtime tests were not run because the environment is read-only.

@janicduplessis janicduplessis added the review: ai-approved A fresh AI review found nothing left to fix label Nov 13, 2026
@janicduplessis
janicduplessis marked this pull request as ready for review November 13, 2026 06:12
@janicduplessis
janicduplessis added this pull request to the merge queue Nov 13, 2026
Merged via the queue into main with commit ee003fe Nov 13, 2026
76 of 80 checks passed
@janicduplessis
janicduplessis deleted the fix/5604-hosted-macos-agent-session branch November 13, 2026 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli packages/stim-cli, including its README and guide area: website website/ ci-full run the macOS, Windows, Desktop and license jobs on this pull request review: ai-approved A fresh AI review found nothing left to fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant