Skip to content

ui-server: an owner continuing a chat from another device is refused as a safety principal mismatch #3952

Closed

Description

@schlessera

Context

On a hosted instance, the owner continued an existing chat from a different device. The turn failed with Safety principal mismatch, and on the current release that error latched safety recording for the whole brain. That outage is what #3812 removes: after #3812 the failure refuses only that turn.

The mismatch itself is still a bug. Every login or device gets its own owner principal (this instance has nine), and chat ownership already treats them as one account. account-partition.ts maps every owner principal to the owner partition (packages/ui-server/src/middleware/account-partition.ts:65). The safety binding does not. beginSafetyCollection compares the session's stored principal_id with the turn's principal exactly (packages/ui-server/src/governance/safety-store.ts:92), and the dialogue-owner check just above it does the same (:87).

So after #3812 the owner still cannot continue a chat from another device: every turn there is refused.

Decision

Selected — maintainer (2026-11-10): option A. A chat's safety record binds to the account partition, not the exact principal.

The options considered:

  • A. The account partition (recommended). Owner principals share a chat's safety history, the same way they share the chat itself. Agent principals keep their own partition. This matches the existing ownership model and loses no taint, because the history stays attached to the same chat.
  • B. The exact principal (today). An owner on another device must start a new chat. If this is the intended model, the refusal needs owner-facing copy that says so, not a generic backend error.

Option A must not let a different account's principal read or extend a chat's safety history.

Acceptance criteria

  • A second owner principal continues a chat started by the first. The turn runs, and its collection joins the same chat's safety history and taint.
  • A principal of a different account partition is still refused. The test fails if the comparison becomes "any principal".
  • Existing rows bound to a specific owner principal keep working without a migration that rewrites taint history.

Verification

Unit tests in packages/ui-server/tests for both acceptance cases, with a mutation receipt, plus the provider-history guard.

Blocked by #3812

Part of #3813.

Activity

  1. added this to the 0.45.0 milestone on Nov 10, 2026
  2. added
    type: fixSomething is broken and must behave the way it is documented.
    area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.
    priority: p1Scheduled into the current or next milestone.
    needs: decisionBlocked on a maintainer or designer ruling, not on code.
    blockedWaiting on another issue or an upstream dependency. Say which in the body.
    on Nov 10, 2026
  3. added
    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.
    and removed
    needs: decisionBlocked on a maintainer or designer ruling, not on code.
    on Nov 10, 2026
  4. schlessera commented on Nov 10, 2026

    @schlessera
    OwnerAuthor

    Ruling (2026-11-10): option A. Bind a chat's safety history to the account partition, so any owner principal can continue a chat. A different account's principal stays refused. The body records the selection, and the acceptance criteria are now unconditional. Still blocked by #3812, whose PR (#3827) is landing.

  5. removed
    blockedWaiting on another issue or an upstream dependency. Say which in the body.
    on Nov 11, 2026
  6. self-assigned this
    on Nov 11, 2026
  7. schlessera commented on Nov 11, 2026

    @schlessera
    OwnerAuthor

    Claimed for implementation. Claim token: claim-b8a6850f. Branch: fix/3952-safety-account-partition.

    path collision: draft #3662 touches safety-store.ts; others closure-only

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

Metadata

Metadata

Assignees

Labels

agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.priority: p1Scheduled into the current or next milestone.type: fixSomething is broken and must behave the way it is documented.

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions