Skip to content

stim stop cannot clean up a named agent-device connection of a hosted macOS session #5604

Closed

Description

@janicduplessis

Problem

stim stop for a hosted macOS session driven with agent-device prints:

could not clean up agent-device connection: Command failed: agent-device connection status --json

agent-device requires a named session for a leased remote connection, and stim stop does not pass one, so the connection is left open until someone runs agent-device disconnect with the session name.

Evidence

2026-11-12, a Stim Desktop test copy built and launched on a second Mac with stim macos --remote-build <mac> --remote <mac> from apps/desktop on the branch of #5576, driven with AGENT_DEVICE_MACOS_APP_BACKEND=native and a named session. stim stop stopped the hosted app and printed the line above; AGENT_DEVICE_SESSION=<name> agent-device disconnect then closed the connection.

Expected

stim stop closes the agent-device connection of the session it stops, passing the session the connection was opened under, or reports exactly which command the person should run.

Activity

  1. added
    type: bugBreaks documented or expected behavior
    priority: P2Normal; default when unsure
    area: clipackages/stim-cli, including its README and guide
    on Nov 12, 2026
  2. janicduplessis commented on Nov 13, 2026

    @janicduplessis
    CollaboratorAuthor

    Claimed: fix/5604-hosted-macos-agent-session

  3. janicduplessis commented on Nov 14, 2026

    @janicduplessis
    CollaboratorAuthor

    Closing after #5658. The generated macOS agent command now includes a workspace session name that stim stop checks against the exact remote config before disconnecting. Stop also accepts a custom name through AGENT_DEVICE_SESSION. The PR exercised the default and custom names, a config mismatch, and failure guidance; its named status/close/disconnect sequence was checked with agent-device 0.21.36 and a local lease fixture. A live hosted Desktop run was unavailable because the mini was paused.

    The remaining case is a custom connection created with a name or state directory Stim was never given. Discovering and disconnecting arbitrary agent-device sessions is out of scope; the macOS guide documents how to stop it by name with the same state directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: clipackages/stim-cli, including its README and guidepriority: P2Normal; default when unsuretype: bugBreaks documented or expected behavior

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions