Skip to content

A guest opening a stopped hosted chat starts it for its owner #2930

Backlog

Description

@AbirAbbas

This is on the org/main feature line (#2903), not in dev. The setting below is in draft PR #2927.

Today, opening a shared hosted chat that is not running starts it, for its owner and in the owner's place among the chats they may have running. Anyone who can see the chat does that, including a guest with only view who runs codeaf chat --org <url> --session <chat> --once: the chat starts in one-shot mode, the guest's own message is refused, and the owner's window then reads "this conversation is already open in a different interactive or headless mode; close it before retrying" until the chat is stopped or stops itself when idle (30 minutes by default). I saw it twice with a view guest. The reverse, the owner's --once followed by the owner's window, did not do it.

It is open because it is a product call: should someone who can only watch be able to start another person's chat, and use up a slot of theirs, at all?

The setting: chats.wake_by in the organization's policy, view, run or owner. The default is view, which is today's behaviour, and an absent value means the same. The operator sets it with PUT /v1/org/policy (read the policy, change chats, send it back with its rev):

"chats": {"wake_by": "run"}

With run only a person who holds run starts a stopped chat, with owner only its owner does. Anyone else reads "This chat is not running. Starting it takes permission to send messages in it. Ask its owner." or "This chat is not running. Only its owner can start it. Ask them to open it." and the chats' host is never asked to start anything. A running chat opens for everyone who can see it, and the owner's own window is untouched. The rule is checked when the window opens, so a chat that stops in the instant between the check and the connection can still be started. Any other word is refused with a 422 that names the three. There is no screen for it in the desktop app yet.

What the setting does not fix: under the default, and for a guest who holds run, the lock-out above still happens. My reading of the code, not yet confirmed with a trace: the guest wire forwards the guest's headless field untouched (rewriteHostedGuestHello in internal/factory/serve/hosted_guest.go rewrites other fields but not that one), the engine is built from the first attach's mode (cfg.AskConsent = !hello.Headless in cmd/codeaf/engine.go), and Session.attach in internal/remote/server.go refuses a later hello whose mode differs (errExecutionMode). So a guest's one-shot hello would decide the mode the owner's window must then match. A real fix is engine-side (a mode per attach rather than per chat) or a decision that a guest's hello never picks the mode.

Activity

  1. added
    bug
    needs a ruling
    on Nov 25, 2026
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

    bugneeds a ruling

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions