Skip to content

Studio: add /skills to open the Skills dialog (CS 146S) - #16717

Merged
danielhanchen merged 12 commits into
unslothai:mainfrom
bjornts:studio-skills-command
Nov 15, 2026
Merged

danielhanchen merged 12 commits into
unslothai:mainfrom
bjornts:studio-skills-command

Conversation

@bjornts

@bjornts bjornts commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #16716

The Skills dialog opens only from "Manage skills" in the Skills pill's menu, and the pill is hidden while Skills is off, which is the default until a skill is enabled. Typing /skills and pressing Enter now opens the same dialog, with Skills on or off. Like /rewind, it is handled in the composer before the model and queue gates, so it is never sent and works with no model loaded. Only the bare command matches: /skills list, or /skills with an attachment or staged audio, is sent as usual.

It reuses ChatSkillsDialog and adds no new strings.

Testing

  • chat-skills-command.test.ts: only the bare /skills matches, ignoring case and surrounding whitespace. It also checks that handleSubmit intercepts it ahead of shouldBlockSend and interceptSend, clears the composer and opens the dialog.
  • Live, in Studio with no model loaded, with Skills on and with Skills off: /skills opened the dialog and cleared the composer. No message was sent and no /chat/completions request was made.
  • Typecheck is clean. ESLint reports nothing new.

This touches the same command block in handleSubmit as #13929 (/context). I'll rebase whichever lands second.

Before / after

/skills typed into a fresh chat with no model loaded, then Enter. Before (merge base 3221ed08b): it is sent as a prompt, a user message appears and Studio starts loading a model. After (0fcc25b1f): the Skills dialog opens, nothing is sent, and the composer stays empty after a reload.

/skills before and after

The dialog opens only from the Skills pill, which is hidden while Skills is
off, as it is on a fresh install. Typing exactly /skills now opens it, like
/rewind opens its picker. It is never sent and works with no model loaded.
@Imagineer99

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 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-15T11:00:44.941915Z 6d66b9b 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 0fcc25b1f2

ℹ️ 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 self-assigned this Nov 15, 2026
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 4a615e5a76

ℹ️ 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 Nov 15, 2026
@danielhanchen

Copy link
Copy Markdown
Member

The staging run of this branch fails tests/studio/test_chat_ui_driver_cpu_throttle.py::test_every_page_the_driver_opens_goes_through_one_factory:

AssertionError: a page is still opened outside new_throttled_page, so it runs unthrottled for every step that follows it
    draft_page = draft_ctx.new_page()

The new /skills draft check in tests/studio/playwright_chat_ui.py opens its page with draft_ctx.new_page(). Using draft_page = new_throttled_page(draft_ctx) instead keeps it under the same CPU throttle as every other page the driver opens, and the guard passes.

@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@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: 1b9ba257e5

ℹ️ 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 +5782 to +5784
!hasAttachments &&
!hasPendingAudio &&
isSkillsCommand(composerText)

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 Exclude materializing native drops from the bare-command match

In the desktop app, submitting /skills while the first dropped file is still being read satisfies this condition: composer.attachments is still empty and pendingAudioName is unset, while the pending file is tracked by the hasMaterializingImageAttachments, hasMaterializingAudioAttachments, or hasMaterializingVideoAttachments flags. This branch consequently clears the draft and opens Skills instead of reaching shouldBlockSend() and parkIfWaitingOnAttachments(), swallowing the attachment-bearing submission. Include the materializing-attachment checks so these prompts retain the existing wait-and-send behavior.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Fixed in 279c0bc: the /skills branch now also requires no image, audio or video drop still materializing, so that submit reaches shouldBlockSend and parks as before.

@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 279c0bcb86

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

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 6d66b9b8c2

ℹ️ 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 to unslothai/unsloth-zoo that referenced this pull request Nov 15, 2026
…top depending on order (#2520)

## Summary

Since #2510, the Gemma 3 tests fail depending on test order in unsloth's
`Core zoo` jobs (HF=4.57.6, default and latest; seen on the staging runs
of unslothai/unsloth#16717, #17725 and #17801):

```
ERROR at setup of test_unpadded_prefill_longer_than_window_matches_sdpa
tests/test_gemma3_fa2_sliding_window_mask.py:45: in model
E   AssertionError: generic Gemma3 attention patch did not install

tests/test_gemma3_forced_float32_undo.py::test_bf16_then_fp16_still_installs_forced_set
E   AssertionError: assert 'patch_Gemma3TextScaledWordEmbedding' in 'Gemma3TextScaledWordEmbedding.forward@106'
```

## Cause

`get_transformers_model_type` records the base model name in
`os.environ["UNSLOTH_MODEL_NAME"]` by design.
`test_adapter_of_a_native_model_resolves_without_the_base_config` (both
parametrizations, added in #2510) calls it with `base_model_name_or_path
= "/nonexistent/unsloth-dsv41-base"` and never restores the variable. A
Gemma 3 test that later lands on the same xdist worker sees that name:

- the Gemma 3 patches decide by model name, so the generic attention
patch does not install;
- the forced float32 test's subprocess inherits the environment.

I found it by running each test file new since `0c225609`, then each
test, before `tests/test_gemma3_fa2_sliding_window_mask.py` in one
process. Only these two parametrizations reproduce it.

## Fix (tests only)

- `tests/test_deepseek_v41_native_resolver.py`:
`monkeypatch.setenv("UNSLOTH_MODEL_NAME", "")` before the call, so
monkeypatch restores the previous value, or its absence, at teardown.
`delenv(raising=False)` would not work here: on an unset name it records
nothing to restore.
- `tests/conftest.py`: the existing autouse fixture that restores
`UNSLOTH_RETURN_HIDDEN_STATES` after every test now restores
`UNSLOTH_MODEL_NAME` too. A future test that reaches
`get_transformers_model_type` cannot leak it either.

## Verification

`tests/test_deepseek_v41_native_resolver.py` followed by
`tests/test_gemma3_fa2_sliding_window_mask.py` in one process:

| | result |
|---|---|
| main | 13 passed, 1 error |
| test fix only | 14 passed |
| conftest fix only | 14 passed |
| both | 14 passed |

The resolver test plus all three Gemma 3 files
(`fa2_sliding_window_mask`, `forced_float32_undo`,
`prepare_decode_after_prefill`): 21 passed.

Every test file that reads or writes `UNSLOTH_MODEL_NAME`, run under `-n
8`:

| | result |
|---|---|
| main | 2 failed |
| this branch | 0 failed |

Both arms also share the same 12 setup errors in
`test_gpt_oss_causal_mask_not_skipped.py`. Those come from my local
environment, not this change.
danielhanchen added a commit that referenced this pull request Nov 15, 2026
…narios run on main again (#17816)

## Summary

`tests/studio/test_chat_autoload_failure_gate.py` has failed 85 of 86
scenarios on `main` since #17673 ("Show loadable Hugging Face snapshots
from custom folders in Select Model"). It shows up in `Repo tests (CPU,
studio)`, first on the staging run of #16717:

```
tests/studio/test_chat_autoload_failure_gate.py:950: in _build_harness
E   AssertionError: the sliced region uses ['isOtherCacheSnapshot'], imported by chat-adapter.ts but absent
    from this harness. Add a stub to PREAMBLE, or these scenarios will fail as wrong-model assertions
```

#17673 is correct. `isAutoLoadableLocalRow` now admits another cache's
snapshot rows through `isOtherCacheSnapshot` (from
`features/model-picker/inventory/local-cache-snapshot.ts`). The harness
slices that region of `chat-adapter.ts` and supplies its imports itself,
and its import guard flagged the new name as intended.

## Change (test only)

The harness now inlines the shipped `isOtherCacheSnapshot`, plus the
`looksLikeLocalPath` it calls, read from source. It already inlines
`server-model-wait.ts` and `load-request.ts` the same way. A
hand-written stub would let the scenarios drift from the rule auto-load
actually applies. If the function stops being a top-level `export
function`, the extraction asserts and names the file.

## Verification

| | `test_chat_autoload_failure_gate.py` |
|---|---|
| main (`04ce4572`) | 85 failed, 1 passed |
| this branch | 86 passed |

Every `tests/studio` file that reads `chat-adapter.ts` (16 files): 446
passed.
@danielhanchen
danielhanchen merged commit 77a73f3 into unslothai:main Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Studio: /skills command to open the Skills dialog

3 participants