Skip to content

Studio: save Full access granted to a chat with that chat - #17801

Merged
danielhanchen merged 10 commits into
mainfrom
studio/per-chat-full-access
Nov 15, 2026
Merged

danielhanchen merged 10 commits into
mainfrom
studio/per-chat-full-access

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Summary

A chat given Full access through "Allow for this chat" lost it on logout and on restart, so reopening that chat dropped back to its saved level and needed the warning again (#17297). Ask, Approve for me and Run automatically were already saved with each chat; Full access was the only level that was not.

This saves Full access with the chat it was granted to:

  • Granting Full access to a chat writes fullAccess: true to that chat's stored settings, next to its permission level.
  • Opening the chat restores it, so logging out and back in, a restart, or another browser all come back to the same level for that chat. Other chats keep their own levels.
  • Leaving Full access in that chat (picking another level, turning the bypass off, or turning on Deep Research) writes fullAccess: false.
  • Installs with other accounts or a restricted policy never restore it, and clear the saved flag when they read it.
  • Forking a chat does not copy its Full access: the grant was given to one chat.
  • Leaving Full access in a chat while its settings are still loading wins over the saved flag, and a revocation saved from another tab removes the chat's grants when it is reopened.
  • The flag never cancels other pending settings writes for the chat: for the open chat it goes out with the normal settings write, and for a chat in the background it queues behind that chat's writes.

Unchanged:

  • Full access picked for the whole app stays session-only and still needs the warning dialog each session.
  • Logout still clears the in-memory grants; the chat gets its Full access back from the saved flag when it is opened again.
  • The server still refuses Full access on installs where it is not permitted, and for API keys.

Changes

  • ChatThreadSettings accepts an optional fullAccess boolean, and fork_chat_thread drops it from the copied settings.
  • sanitizeThreadScopedSettings keeps a boolean fullAccess, so the chat open path hands it to the store.
  • The chat store writes the flag when a grant binds to a chat, clears it on the three exit paths, keeps it in full snapshot writes, and restores it when the chat's settings are applied. Every write is a no-op when the flag already holds the value, so repeating it changes nothing.

Testing

  • New tests/chat-full-access-saved.test.ts (11 tests) opens chats the way the app does (stored row through the sanitizer): logout and login, reopening, switching chats, a restart, leaving Full access, other-accounts installs, leaving Full access while a chat loads, revocations from another tab, and settings edits queued around a grant. Each case was checked to fail before its fix.
  • Frontend: 89 store, thread-settings and Full access test files (1204 tests) pass; npm run typecheck is clean.
  • Backend: test_chat_thread_settings.py, test_chat_history_storage.py, test_chat_settings_payload.py and test_chat_history_routes.py pass (296). The round trip and fork tests fail on main.

Fixes #17297

Screenshot

A chat stored with permission level Approve for me plus fullAccess: true (what Studio writes when Full access is granted to the chat), then opened in a new login. BEFORE is main at 0945ac0, where the server rejects the flag; AFTER is this PR.

Chat reopened after logging in

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T08:50:13.034719Z 8e76c43 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@danielhanchen danielhanchen self-assigned this Nov 15, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 15, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 15, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 15, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 15, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 15, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 15, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 15, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 15, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 15, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 15, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cb68662080

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1346 to +1347
if (!explicit && savedChatFullAccess.get(threadId) === on) return;
chatFullAccessDecidedSinceOpen.add(threadId);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Record fresh grants even when the cached flag is already true

If this tab previously read fullAccess: true, another tab revoked it, and a fresh “Allow for this chat” grant arrives while the chat's settings are loading, this early return skips both recording the new decision and saving it. The incoming fullAccess: false then passes restoreSavedChatFullAccess's decision guard and removes the freshly granted access. This is reproducible by opening a saved-full-access chat, switching away, changing its stored flag to false, and granting access during its next settings read. Distinguish a fresh user grant from the scan of existing grants so the fresh choice is recorded and persisted even when the cached value matches.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not changing this one: it needs another tab's revocation and a fresh grant to race the same chat's settings read, and the outcome fails safe (the chat ends without Full access and the user can grant it again). It never leaves the sandbox off against a choice, which is the case the previous fixes cover.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 15, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 8e76c43a41

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

danielhanchen added a commit that referenced this pull request Nov 15, 2026
… stock baseline (#17808)

## Summary


`tests/test_fp8_ragged_block_dequant.py::test_ragged_rows_match_block_reference[glm5_3]`
and `[ling3]` fail in `Repo tests (CPU, rest)` on every PR whose CI
installs unsloth-zoo at or after `898a6b0d`
(unslothai/unsloth-zoo#2515). Seen on #17725 and #17801:

```
tests/test_fp8_ragged_block_dequant.py:74: in test_ragged_rows_match_block_reference
    with pytest.raises(ValueError):
E   Failed: DID NOT RAISE ValueError
```

unsloth-zoo#2515 now patches `Fp8Dequantize._dequantize_one` on import
to dequantize partial edge blocks correctly. Its wrapper is marked
`_unsloth_partial_block_patched` and keeps the stock function in
`_unsloth_original`. This test's "unpatched" baseline only unwrapped
unsloth's own ragged-block wrapper (`_unsloth_ragged_blocks` /
`__wrapped__`). So the baseline was actually the zoo-fixed op, and the
expected stock `ValueError` never came. The zoo patch is correct; the
test's notion of "unpatched" was too narrow.

## Changes (test only)

- `_op_cls(patched=False)` unwraps both markers, so the baseline is
transformers' own op again.
- `test_unpatched_op_carries_no_unsloth_wrapper` pins that the baseline
has no unsloth or unsloth-zoo wrapper left. The `ValueError` assertion
only means something against the stock op.
- `test_ragged_padding_composes_over_the_zoo_partial_block_patch` covers
the real-world case, where both patches are live in one process. It
stacks unsloth's ragged padding on top of the zoo partial-block patch
and checks the block reference for 576x384, 576x2560 and stacked
2x256x200 experts. It skips when the zoo module is absent.

## Verification

| unsloth-zoo | before | after |
|---|---|---|
| `0c225609` (before #2515) | 6 passed | 7 passed, 1 skipped (no zoo
patch module) |
| `c8655b99` (main) | 2 failed, 4 passed | 8 passed |
| `c8655b99`, zoo patch applied explicitly first | 2 failed, 4 passed |
8 passed |
| main, with the new unwrap branch removed | | 3 failed (the two
reference cases and the new baseline guard) |
@danielhanchen
danielhanchen merged commit e7884e8 into main Nov 15, 2026
@danielhanchen
danielhanchen deleted the studio/per-chat-full-access branch November 15, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Studio: persist "Full access" permission mode (session-only today)

1 participant