unsloth/studio/frontend/src
Daniel Han f01011e4dd Studio: real Codex parallel-call tab UI + in-process SDK spoof
Two paired changes that finally make the Codex parallel-calls fan-out
visible as actual clickable tabs in the chat surface, plus a credit-
free spoof that lets the whole pipeline run in dev / CI without ever
touching the upstream API.

1. Real tab UI (frontend).

   The chat-adapter used to render the per-worker outputs as inline
   `[Codex tab 1/N] ...` text blocks in the assistant message body,
   which collapsed into one big run-on block once more than a handful
   of tokens had streamed. Now each `codex_*` SSE event is folded into
   `codexParallelState` and re-published as the `args.state` of a
   single tool-call part with `toolName === "codex_parallel"`. The
   assistant-ui surface dispatches that to the new
   `CodexParallelToolUI` wrapper, which mounts the existing
   `CodexParallelTabs` component -- one tab per worker, one Synthesis
   tab, click to switch. The stable `toolCallId` keeps assistant-ui
   updating the SAME card across stream yields rather than spawning
   new cards.

   `renderCodexTabsBlock` now returns the empty string so the message
   body no longer contains the labelled-text fallback (kept the
   function name so the rest of the adapter's `renderFullContent` /
   pin-signature paths are untouched).

2. Credit-free Codex SDK spoof (backend).

   New `studio/backend/core/inference/codex_spoof.py` exposes a drop-in
   subset of the upstream `openai_codex` surface (`AsyncCodex`,
   `AppServerConfig`, `ApprovalMode.deny_all`, `SandboxMode.read_only`,
   thread with `turn().stream()` + `run_streaming()` + `run()`) and
   emits deterministic per-tab streaming events tagged with the worker
   index, so flipping between tabs in the UI shows visibly distinct
   text. Activated by `UNSLOTH_CODEX_SPOOF=1`; `_import_codex` installs
   the spoof into `sys.modules` under both `openai_codex` and
   `codex_app_server` and the rest of the provider keeps running
   unchanged. OFF by default; production is unaffected.

   Six new tests cover the spoof itself (module install, env-flag
   gating, delta + completion event shape, per-tab tagging, provider
   import path, safety-kwargs resolution against the spoof). 69/69
   tests pass with and without the flag; TypeScript clean.
2026-05-27 13:30:53 +00:00
..
app Studio: add frontend i18n support (#5765) 2026-05-27 04:52:16 -07:00
assets Final cleanup 2026-03-12 18:28:04 +00:00
components Studio: real Codex parallel-call tab UI + in-process SDK spoof 2026-05-27 13:30:53 +00:00
config Studio: expose image size setting in training UI (#5743) 2026-05-27 05:01:24 -07:00
features Studio: real Codex parallel-call tab UI + in-process SDK spoof 2026-05-27 13:30:53 +00:00
hooks studio: engage draft-mtp on vision MTP GGUFs (drop incorrect vision gate) (#5560) 2026-05-18 08:42:55 -07:00
i18n Studio: add frontend i18n support (#5765) 2026-05-27 04:52:16 -07:00
lib studio: fix toast close-button click and light-mode hover (#5597) 2026-05-19 00:55:55 -07:00
shared studio/frontend: make toast and inline error text selectable and copyable (#5506) 2026-05-18 03:47:21 -07:00
stores Update license headers 2026-03-12 17:23:10 +00:00
types feat(studio): add Continued Pretraining (CPT) as a training method (#4677) 2026-05-06 13:38:35 +04:00
utils Update license headers 2026-03-12 17:23:10 +00:00
index.css Keep generated image loading dots animated (#5786) 2026-05-26 04:37:18 -07:00
main.tsx Studio: add frontend i18n support (#5765) 2026-05-27 04:52:16 -07:00
speech-recognition.d.ts Update license headers 2026-03-12 17:23:10 +00:00