Repository navigation
ui-server: an owner continuing a chat from another device is refused as a safety principal mismatch #3952
Description
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
schlessera commentedon Nov 10, 2026
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.
schlessera commentedon Nov 11, 2026
Claimed for implementation. Claim token:
claim-b8a6850f. Branch:fix/3952-safety-account-partition.path collision: draft #3662 touches safety-store.ts; others closure-only
CONTRACT: fix(ui-server): bind a chat's safety history to the account…
CONTRACT: fix(ui-server): bind a chat's safety history to the account…
CONTRACT: fix(ui-server): let another owner login continue a chat's r…