Skip to content

fix(ui-react): refuse unsupported safety history selections - #3977

Merged
schlessera merged 2 commits into
mainfrom
fix/3811-safety-history-target
Nov 11, 2026
Merged

schlessera merged 2 commits into
mainfrom
fix/3811-safety-history-target

Conversation

@schlessera

@schlessera schlessera commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Closes #3811

What changed

Selecting a host-only voice history or an unsupported stored session key now clears the safety request, unsubscribes and shows unavailable. The client validates session IDs against the existing SDK schema before sending a read. Valid backend sessions retain paging, subscription and gap recovery.

Why this shape

The published safety target has no host-only history form. Reusing its existing session-key schema keeps the wire grammar in one place and preserves the server contract.

Containment

  • Trigger: a selected key fails the published safety session-id schema; recorder, transport and permission failures keep their existing handling.
  • Scope: only that selection's safety read is unavailable. It does not block chat, backend session reads or host admission. Unsubscribing also clears the stale page request.
  • Restricted mode: the client shows unavailable, because the wire has no supported safety target for that selection.
  • Recovery: selecting a valid backend session starts a read automatically; no owner judgment or restart is required.
  • Diagnosis: the selected chat key remains the existing selection and safety state reports unavailable. This introduces no durable error latch or restricted boot.
  • Isolation proof: both new tests switch between invalid histories and valid sessions; valid paging, subscription and gap recovery remain usable.

Proof

Head 8cbafb4cb2f52a902fe412eceef2adc7c994d968; base 0f6296a791061c5343230e303117f8278093340b. The branch now contains merged tracker recovery fix #3980.

  • Combined client/announcer/store/tracker checks: 114 passed, 402 assertions across four files. The three safety-client cases check every emitted frame with the real parseClientMessage across hello, selection, paging, subscription, gap recovery and reconnect. Invalid targets stay unavailable and stale pages cannot restore them.
  • Failing first: both new cases fail on the original client at SAFETY_CLIENT_FRAMES_MATCH_PUBLISHED_PARSER, with the reported target.sessionId pattern error. Removing the validation reproduces those intended assertion failures; restoring the exact source passes. These original controls ran at 97a94e2; both source and regression test bytes remain identical after the main refresh, and the combined checks ran at the new head.
  • Strict tsc --noEmit passed with the repository heap setting.
  • bun run check:pr --base origin/main: all five gates passed; 456 fast-invariant tests, 1,448 assertions. Pending changeset names and the complete release plan validate.
  • No component rendering or provider-facing history changes; this issue specifies the real client/parser lifecycle proof without browser or network requirements.
{"version":1,"kind":"brain-check-pr-receipt","head":"8cbafb4cb2f52a902fe412eceef2adc7c994d968","base":"origin/main","mode":"focused","startedAt":"2026-11-11T11:37:59.474Z","finishedAt":"2026-11-11T11:38:43.214Z","checks":[{"name":"all lint and leakage gates","categories":["changeset"],"outcome":"passed","elapsedMs":13463.243583},{"name":"environment documentation","categories":["changeset"],"outcome":"passed","elapsedMs":100.91079600000012},{"name":"pending changeset package names","categories":["changeset"],"outcome":"passed","elapsedMs":83.87021599999935},{"name":"contribution changeset","categories":["changeset"],"outcome":"passed","elapsedMs":20.411925000000338},{"name":"affected fast invariants","categories":["verify","unit"],"outcome":"passed","elapsedMs":30053.017127999996}]}

Collision record

At head 8cbafb4cb2f52a902fe412eceef2adc7c994d968, the current collision scan reports closure: #3054, #3056, #3059, #3069, #3116, #3393, #3437, #3464, #3581, #3622, #3806, #3968, #3971, #3972, #3979; textual: #3662. The direct safety-client overlap with #3662 will be preserved during its later refresh; other closure and textual reports do not transfer branch ownership.

Checklist

  • Complete selected hosted candidate and main delivery proof passed.
  • The four issue criteria have focused failing-first, mutation and restored-control evidence.
  • PR and issue use the confirmed upcoming 0.45.0 milestone (published packages remain 0.44.0).
  • A ui-react patch changeset is included.
  • Leakage gates pass; fixtures use the established fictional example world.
  • The published wire schema, SDK exports and provider-facing conversation remain unchanged.
  • Existing documentation still describes the supported target forms; containment and automatic recovery are recorded above.

Anything left open

Merged through integrate.ts confirm as 3c44ac6fc56d27675dadaf38a16254db53c39f69, with parent 0f6296a791061c5343230e303117f8278093340b and tree 405136cad4db123bd175b4e4d8cb598e2e9930ee. Exact candidate run 43016644219, attempt 1, passed all eight selected jobs. Every actual selected checkout is 804980cf3fbd7948e7029d1fe7e91dee448b4ab9, whose immutable parents/tree match the recorded candidate and squash. All three real safety-client cases and all 35 actual provider-history cases passed. Six heavy categories were intentionally unselected on the candidate.

Automatic main run 43020467075, attempt 1, passed all 17 selected jobs at squash 3c44ac6fc56d27675dadaf38a16254db53c39f69. All actual job checkouts match that squash. All 35 actual provider-history cases and all three safety-client cases passed. Independently inspected native artifacts confirm four healthy Claude/Pi and UID 0/1000 hosted-app executions, complete owned cleanup and the separate verified intentional negative control. Candidate, actual squash and required main delivery proof are complete; #3811 is closed and both retain milestone 0.45.0. The separate chat safety PR #3662 overlaps this client and its tests; preserve both changes and verify their combined tree during refresh. Host-only safety history remains outside this issue's scope.

@schlessera schlessera added this to the 0.45.0 milestone Nov 11, 2026
@schlessera schlessera added type: fix Something is broken and must behave the way it is documented. area: ui-react React chat/files/voice components, stores, WebSocket transport. labels Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ui-react React chat/files/voice components, stores, WebSocket transport. type: fix Something is broken and must behave the way it is documented.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ui-server: shipped clients send WebSocket frames whose target.sessionId fails the id pattern

1 participant