Skip to content

Studio: confirm Full Access directly from a chat tool approval - #15485

Merged
danielhanchen merged 14 commits into
mainfrom
fix/chat-approval-full-access
Oct 28, 2026
Merged

danielhanchen merged 14 commits into
mainfrom
fix/chat-approval-full-access

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Tool approval cards now offer a red Full Access button next to Deny. It opens the existing Full Access warning; Turn on allows the pending call and enables Full Access for later calls and turns in that chat.

The backend atomically upgrades the waiting run before releasing its tool. It checks both the approver and original request's account/API policy and acknowledges the upgrade explicitly. Expired, cancelled, duplicate, mismatched and image-disclosure-only approvals cannot grant it. All three tool engines and mentioned-skill preloads share the live permission state.

The frontend keeps the shortcut's grant in memory per chat/run, including first-turn adoption and parallel responses. Shared project sessions do not grant other chats access. A server without upgrade support cannot produce a false success. Account changes and newer permission choices win over delayed responses. Existing dropdown grants retain their behavior, and image sharing still asks separately.

Approval expiry and Stop settle under the same lock as the confirmation, so an approval that timed out or was stopped can never also grant Full Access, and a confirmation that was already committed wins over a later timeout. A GGUF mentioned-skill preload shares the tool loop's live permission state, so Full Access accepted on its card carries into the loop. Choosing a lower mode revokes the chat grant for future turns and live browser actions, including a first-turn grant that had not yet been adopted by its chat. An already-upgraded server response retains its accepted level until that response ends; stopping it ends that run.

Validation:

  • 3116 backend approval, permission and skill tests passed, 1 skipped, including deterministic expiry/Stop race tests that fail without the lock change.
  • 36 focused frontend scope/store/card/API tests passed; the full frontend suite (14,294 tests) passes with three source-shape tests updated for the new run id and card state.
  • Frontend typecheck, Ruff and the startup bundle budget passed (the budget is raised by the measured 1,953 B transfer this card adds).

Screenshots

A terminal call parked for approval in Ask mode (same scripted stream on both sides). The card gains a Full Access button:

Approval card before and after

Full Access opens the existing Full access warning; Cancel or Escape leaves the card as it was:

Full Access confirmation dialog

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T12:18:07.293256Z c72f5d8 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

Copy link
Copy Markdown
Member Author

Frontend build + bundle sanity and Frontend unit tests (Windows) fail here on three source-contract tests that pass on main (83 of 83 in the same three files on a1064bb), so they follow this PR's approval-flow changes:

  • tests/generation-tool-recovery.test.ts:356 "the live adapter saves identities for ordinary, approval and provider cards": the lifted adapter code throws cancelId is not defined, so a name it now uses is not in the slice the test evaluates.
  • tests/approval-waiting.test.ts:180 "both writers record which chat a parked call belongs to": the .setToolConfirmation(partId, approvalId, sessionId, \${sessionId || "_default"}:${threadId}`, thread...` call no longer matches its pattern.
  • tests/shortcut-layout-and-recorder.test.ts:330 "Escape in the composer is left to a mounted, keyboard-ready decline": const keyboardReady = !disclosure && chatActive && soleRequest && ... changed shape.

If the new Full Access path keeps those behaviours, the three tests need their patterns updated to the new code in this PR; if it changed them on purpose, the assertions should say what the new behaviour is.

@danielhanchen

Copy link
Copy Markdown
Member Author

Repo tests (CPU, studio) also fails on this PR, separately from the frontend unit tests above (job 122006603006). It reports 32 failures in tests/studio/test_project_chat_view_switch.py and tests/studio/test_new_chat_context_recount.py, and all of them pass on main at 63939ab. Their node harness builds a chat runtime store without the new full-access grants map, and the new read in chat-runtime-store.ts throws:

(threadId && Object.values(grants).some((grant) => grant.threadId === threadId))
TypeError: Cannot convert undefined or null to object

Either default grants to {} at that read (older persisted or partially built state can have it missing too) or seed it in those harnesses. The first option also covers real stores rehydrated from before this change.

The two monitor link failures in the same job are a main issue, already fixed by #15500. They clear on a merge of main.

@danielhanchen danielhanchen added affects UI# new-feature# security# Moves a security boundary: sandbox, allowlist, permission or network guard labels Oct 27, 2026
@danielhanchen danielhanchen self-assigned this Oct 28, 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: 3390b4d4f8

ℹ️ 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 pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 28, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 28, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 2b87548c53

ℹ️ 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".

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 28, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

Staging CI (Repo tests (CPU, studio)) has 32 failures from this change, all the same throw from the new Full Access helper inside the chat view-switch harnesses (test_switching_to_a_thread_priced_under_another_model_blanks_the_bar, test_a_hundred_and_twenty_view_switches_stay_bounded, test_a_saved_switch_that_lands_in_time_is_left_alone, ...):

TypeError: Cannot convert undefined or null to object
    at Function.values (<anonymous>)
    at hasChatFullAccess (harness.ts:4984)
    at withChatFullAccess (harness.ts:4994)
    at chatFullAccessPermissionPatch (harness.ts:5024)

Those harnesses build chat state without a permissions map, so Object.values(...) in hasChatFullAccess needs to treat a missing map as "no full access" (e.g. Object.values(perms ?? {})). The (Python 3.13, g-r) red on the same run is an ordering assertion that now sees the website_policy permission in a different position (['website_pol..._permissions'] == ['compact_con...bsite_policy']), which also comes from the permission patch order here.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: c72f5d8d5a

ℹ️ 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
danielhanchen merged commit 3113197 into main Oct 28, 2026
6 of 59 checks passed
@danielhanchen
danielhanchen deleted the fix/chat-approval-full-access branch October 28, 2026 12:50
danielhanchen added a commit that referenced this pull request Oct 28, 2026
…rowth (#15822)

## Summary

`Frontend build + bundle sanity` fails on main (seen on #15806, #15799,
#15798, #15795; reproduces locally on `556b28bb40`):

```
eager startup JS: 5837.8 KB raw, 1806.0 KB transfer, 85 chunks
over the startup budget: transfer 1806.0 KB > 1795.7 KB, raw 5837.8 KB > 5819.8 KB
```

Building every frontend commit since the last budget base (`8222149ee`)
and measuring the eager set the same way
`scripts/check-bundle-budget.ts` does:

| commit | raw B | transfer B |
|---|---|---|
| `ed9857c0c3` (#15718) | 5,942,150 | 1,836,750 |
| `39b8a6ce13` (#15678, Trick or treat row) | 5,972,134 | 1,847,702 |
| `556b28bb40` (main) | 5,977,895 | 1,849,311 |

Every other step in the range moves by 0.0 to 0.5 KB. #15678 added
29,984 B raw / 10,952 B transfer in one step and merged without
re-measuring. #15485 then raised the budget by its own 1,953 B, but
measured against `8222149ee`, a base from before #15678, so main has
been over ever since.

## Change

`BUDGET` in `studio/frontend/scripts/check-bundle-budget.ts` is raised
by #15678's measured growth (+29,984 B raw, +10,952 B transfer), with
the measurement recorded next to the earlier raises. Main is then within
budget with 0.5 KB transfer / 11.3 KB raw to spare, so the next
unmeasured growth still fails here.

I tried the gate's first suggestion before raising it. Loading the Trick
or treat dialog on first open (`React.lazy` in `app-sidebar.tsx`) saves
only 10.4 KB raw / 3.0 KB transfer, and it raises the startup set from
85 to 90 chunks: the case the script warns about, where a dynamic import
splits shared modules into extra startup chunks. The rest of #15678's
weight is its Halloween color themes in
`features/settings/lib/color-themes.ts`, which the theme store reads at
startup to apply the saved theme. So that is not a laziness fix, and I
left it out.

## Testing

- `npm run build && npm run bundle:check`: over on main, `within budget
(0.5 KB transfer, 11.3 KB raw to spare)` with this change.
- `tests/bundle-budget-cli.test.ts`,
`tests/bundle-budget-closure.test.ts`: 43 passed.
- Measurements on Node 24.22.1, one machine and build, as the earlier
entries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

affects UI# new-feature# security# Moves a security boundary: sandbox, allowlist, permission or network guard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant