Skip to content

Studio settings (c): a missing API Key says where to set it, and the film's now line says it waits on it - #235

Merged
ZLHad merged 29 commits into
mainfrom
claude/settings-first-run
Nov 22, 2026
Merged

ZLHad merged 29 commits into
mainfrom
claude/settings-first-run

Conversation

@ZLHad

@ZLHad ZLHad commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Stacked on #234 (claude/settings-keys, 55aced6), which follows #233. Land those first.

This is PR c of Studio's settings page: first-run guidance when a service's API Key is missing.

What changes

  • One sentence for a missing key, the same everywhere (tools/keys.py's missing(), local_way() and stopping()). It names:

    For example:

    no Gemini API Key (GEMINI_API_KEY): paste one into Studio's Settings → Services (get one at https://aistudio.google.com/apikey), or set GEMINI_API_KEY in the environment; or leave the provider out for this computer's own voice, which needs no key (qwen, free, about 2.6 GB on first use)

    It goes on the run's record with a new error code, no_key (in tools/jsonerr.py's list and error.schema.json). The record also says what the key was for (need: voice, timing, music or image) and lists its names (keys). Exit statuses are unchanged.

  • What works with no key depends on this computer:

    Platform Voice Word timing Music Pictures
    Apple Silicon the local voice (qwen) --align local (pace: --align whisper) composed here Codex
    Intel Mac macOS's say none composed here Codex
    Linux none: it says the local voice runs only on Apple Silicon, and that --provider edge needs no key but is an online service none composed here Codex

    Codex means image gen --provider codex on the ChatGPT plan. It's offered only when the codex program is on the PATH, the way bin/vh doctor finds it.

  • Every command that stops for a key says it:

    • bin/vh tts, each online provider (need: voice), and --align gemini / --join transcribe (need: timing);
    • voices audition (voice or timing). Its run goes in the film's log when its --text or --out is a file in the film, as with every command's project. Run from inside the film with a text file elsewhere, it is in no film's log, so no film shows it as waiting.
    • pace --align gemini (timing);
    • music --provider lyria (music). lyria.py now writes its run's end line (bin/vh execs into it), so this stop shows as a failure, and no Lyria run reads as cut off any more.
    • image gen (image).

    The check comes before any call, so nothing is spent and nothing is voiced.

  • bin/vh status and Studio's now line say the film waits on the key. The new code is needs_key, with you: decide and the amber tone. For example:

    配音停下了:还没有 Gemini 的 API Key。
    在设置 → 服务里填上,再让 agent 接着做。不想用在线服务,也可以让 agent 换成这台电脑上的声音。

    • In English: "The voice-over stopped: there's no Gemini API Key yet. Set it up in Settings → Services, then ask the agent to carry on. Or ask the agent to use this computer's own voice, with no service."

    • The second sentence follows what the key was for and what this computer has. A tts --align gemini stop on the local voice says the timing line. Where there's no way without a key, it says so: "这台电脑上没有不用 API Key 的办法。"

    • The space's card says "等 API Key" / "waiting for an API Key".

    • The action is a new kind, {kind: "settings", sub: "services", label}. In Studio's column it is a button that opens Settings → Services; the terminal prints the words.

    • When it stops being said:

      • one of the named keys is now set, in Studio or the environment;
      • a later run did the same kind of work fine: a voice-over clears a voice or timing stop from tts, voices or pace; a picture clears an image stop; and so on;
      • a later run of anything failed or was cut off, since that's newer news.

      A run stopped on purpose, a different kind of work that went fine, and the console's own run don't clear it.

    • It's worked out from the whole log, not the last five runs. bin/vh status passes the result as activity.key_stop, and the now line then checks whether the key is still missing.

    • facts gains keys, service and need. The status and projects schemas gain needs_key, the settings kind and those facts. The activity schema's error gains need and keys. mod may be null for the settings kind.

  • Not changed: waiting_on keeps what bin/vh status computes from the stations (usually "agent"); only the now record says the person decides. Stop messages written by an older bin/vh (code failed) aren't read as needs_key. A key set only in a terminal's environment, with Studio opened elsewhere, is not seen by Studio, so it still says the film waits until that command runs again from the terminal. The desk README says so.

Shared files touched (against claude/settings-keys, 55aced6)

File +/-
tools/desk/static/studio.js +1/−0: the settings act kind renders a link to #/settings/<sub>
core.js, agent.js, server.py, tools/settings.py none

Others:

File +/- What
tools/standing.py +82/−1
tools/keys.py +83/−1
tools/audio/tts.py +11/−16
tools/jsonerr.py +7/−6 report() passes extra fields to the note
tools/activity.py +3/−1 the reader keeps a no_key error's need and keys
tools/status.py +1/−1 activity.key_stop
lyria.py, pace.py, image.py small
the four schemas, tools/desk/README.md small

How it was checked

  • tools/desk/test_agents.py's status sentence check (agent_checks), on made-up records with no store, no key in the environment and a made-up platform:

    • the sentence: the line under it, the short form, the action and the facts for a voice-over; MiniMax's two keys; the timing line for a tts --align gemini stop;
    • what clears it:
      • cleared by a later tts after a voices, pace or tts stop; by a later image run after an image stop; and by a failed check after an image stop;
      • still waiting after a render that follows a pace stop, and after a stopped render that follows an image stop;
      • an older failed message isn't read as a key stop; a key that is set clears it;
      • key_stop from the whole log wins over five unrelated runs in the window, and null means no wait;
    • the platform:
      • an Intel Mac gets macOS's voice and "no way" for timing;
      • Linux gets "no way" for voice and timing, and local composing for music;
      • the commands' own words there say plainly that there's no local way;
      • Codex is offered for pictures only when it's there.
  • tools/desk/test_settings.py (settings_page_checks), on the store of its own:

    • tts: bin/vh tts <film> gemini with no key: exit 1, the sentence, nothing voiced, no_key with need: voice on the run's record. bin/vh status --json then gives needs_key with the settings action, the key's name and need: voice, and the text view prints the now: line.
    • Lyria: bin/vh music <film> --provider lyria --prompt … with no key: exit 2, the sentence, and its run ends as failed (not gone). bin/vh status then gives needs_key for music.
    • Once a made-up key is saved, the wait isn't said any more.

    No service is called.

  • By hand: voices audition --provider gemini with no key and --text in the film shows the film as waiting ("The voice trial stopped…"). With the text elsewhere, run from inside the film, it isn't recorded, as said above.

  • pyflakes (through uvx) is clean on every Python file this PR touches.

  • tools/ci.sh --committed on 7d18d88: all checks passed (20 min 55 s; 8.4 GB free at the end; the usual skips: frames on a HyperFrames composition, plus shellcheck and pyflakes, which ci.sh doesn't find installed here). The person's keychain search list was the same before and after. The first version (b89fd5d) also passed a full run, in 20 min 33 s.

  • Looked at in an isolated Studio, before this round (its own HOME, config and keychain; port 8875; the film's voice-over had stopped for a Gemini key):

    • the space card ("等 API Key");
    • the film's now line in Chinese and English, in Darkfield, Prism and Bridge;
    • the button opens Settings → Services;
    • after saving a made-up key there, the line has moved on;
    • no errors in the page console, the person's keychain search list unchanged, the key in no log.

    Screenshots are in the architect's notes folder (settings-first-run-shots/). This round changes only the words under the sentence, not the page, so I didn't take new pictures.

Not looked at:

  • the line inside OVH Studio's own window;
  • a real Intel Mac or Linux machine (the platform is faked in the check);
  • image gen with Codex installed (the check fakes it).

ZLHad added 28 commits November 22, 2026 03:33
…ce's first download

Measured on a clean Mac: 71 of the install's 90 s and 305 MB were the reference repos, which a first film does not use;
the install ended with a 60-line doctor report that said ready even when uv or a render browser was missing (Linux);
the local voice's first use downloaded about 2.5 GB without a word.

- install.sh fetches the reference repos only with --refs; references/fetch.sh <dir> says what it fetches and how big
  first (a size table in the script, checked by CI), and an unknown name exits 2.
- bin/vh doctor --first: ready for a first film or not, what is missing and how to get it, how a voice comes here;
  the installer ends with it, the skills step says one line, the example sentence is the README's silent one.
- bin/vh tts: before the local voice's first download, one line with the size, the time it may take and the way
  around it (--provider edge); uv's download lines shown, the model's progress every 10 s. The default provider
  is set in tts.py alone (DEFAULT_PROVIDER).
- README, homepage: the sizes measured.
… checks run the behaviour

- install.sh asks for python3 up front; bin/vh doctor --first with no python3 is not ready (exit 1).
- doctor --first: a Chinese locale with no Chinese font is not ready; on Linux the render browser's missing system
  libraries are not ready, and libraries it cannot ask about are 'not checked' (exit 3, the installer then does not say
  ready); an outdated agent is told to update; Python 3 in the ready line; uv says what it is for.
- tools/audio/firstuse.py: the local voice's and the local Whisper's first downloads in one table (sizes measured:
  0.8 + 1.8 GB, 2.0 + 1.6 GB), the line before them, the model's progress written to the real stdout so a
  redirect_stdout around the loader cannot swallow it. bin/vh's first_use helper is used by tts, voices audition and
  pace; tts checks its script first. doctor and tts read the sizes from there; edge 'needs only a small package'.
- references: one repo by name that does not come exits 1; a full fetch with no network is one line; 'under 1 MB';
  doctor's references line is fine by default; setup says its size; four docs say the one-name fetch.
- The example sentence follows the locale; the skill says to read the installer's last lines.
- README sizes: no double count. CI: fetch.sh through a stand-in git, doctor --first's states, the bare doctor, the
  first-download lines through a stand-in uv, the progress inside a redirect.
…ts now writes the sample and fetches nothing)
…al npm registry does not answer, and every later download follows

- tools/mirrors.txt: each kind of download, its variable, the official source, the mainland-China mirror, who runs it.
- This machine's settings in $XDG_CONFIG_HOME/ovh/settings.json (tools/settings.py, bin/vh settings): mirror cn|off|auto.
- bin/vh exports the mirror variables for everything it runs when the mirror is cn (a variable already set wins);
  HyperFrames' Chrome is fetched from the mirror by bin/vh new, install.sh and settings chrome, as HyperFrames has no
  setting for it.
- install.sh tries registry.npmjs.org for 5 s; only when it does not answer and the mirror does, it keeps cn and says so;
  --mirror cn|off forces it either way. doctor says which sources are in use.
- README: the China network line; homepage and overview: 74 commands.
… reads it); ci: bin/vh exec's into settings.py, known
…rge, keep the other keys, replace whole); save() goes through it

Studio's settings panel and a terminal writing at once both land: the CI check runs two writers of 60 updates each
(all 120 land; without the lock, 64 did).
…rror writes, without the saying (Studio calls it in-process)
…chine's defaults in one place

A page at #/settings (the rail's foot, Cmd/Ctrl+, and the shell's Settings… menu item): General (language, look,
where films are kept), Agent (the default agent, each one's model and effort once it has offered them), Film defaults
(the download mirror, editable; LOCAL.md's lines shown only), This computer (what it lacks), About. Studio's own
three settings (studio_lang, studio_theme, agent_default) are kept in this machine's settings file through
tools/settings.py, so another port, a second window and the terminal see the same; the top bar's buttons stay and
change the same settings. GET/POST /api/settings need the run's token and take only these names and values.
…lier bin/vh exported), a source of the person's own stays, every Chrome fetch through the mirror, the probe tries the right hosts twice

settings.py: env_changes() is the one reader (bin/vh asks it when the file names a mirror or one was inherited), an
inherited OVH_MIRROR with the setting not cn takes out exactly the values bin/vh exported; npm's registry in an .npmrc and
uv's index or Python mirror in a uv.toml or pyproject.toml are left alone and said; a broken file kept as settings.json.bad,
a newer version never written over, a relative XDG_CONFIG_HOME ignored, an unwritable folder one line.
install.sh: npmjs through npm ping, Hugging Face and Google's storage through curl, all at once, twice each; the reason says
what happened; the Chrome step cannot stop the install; -h prints the whole header.
bin/vh: render, frames, textcheck and hf fetch HyperFrames' Chrome through the mirror with cn, with the @puppeteer/browsers
HyperFrames' node_modules holds; settings chrome [project]; the hints name it. mirrors.txt says what is checked and what is
trusted to the mirror, and what is not covered; README and the change note too.
…every start, so a file it names reaches every CI group
…takes the default agent, folders can be opened

- The console writes Studio's look and language into the page it serves (no flip after the first paint); the
  language and look buttons are drawn from the settings file and every click saves; radio groups are one tab stop
  with arrow keys.
- "New chat" and a new film on the space start with the default agent; the default must be an agent that is set up.
- Where films are kept: only folders that exist, ~ for the home folder, each with a button that opens it (one of
  those folders only, $OVH_REVEAL stands in for the file browser).
- LOCAL.md: only list items count, and a value's bracketed hint is left out; a model or effort that could not be
  written is an error, not "saved".
- The rail marks the space only on the space; on the settings page the column says it is the space's chat; without
  this run's token the page says to open it in Studio's window, with the button that does.
- Mirror: the page says that downloads Studio itself started in this run follow once it is reopened.
- tools/ci-paths.txt keeps its four narrow lines: tools/settings.py says "the installer", the version comes from git,
  "What's new" links the release page; LOCAL.example.md also runs settings_page_checks.
- Tests: the file wins over the browser's copy, the top bar's buttons save, the default agent for a new chat, the
  folder button, an agent not set up refused, LOCAL.md's list items.
…rd store, found by every command

- tools/keys.py: a service's key from the environment first, else the one saved in Studio, kept in the Keychain (macOS)
  or the Secret Service (Linux, through secret-tool); written through standard input, never an argument, never in a
  file; only the names tools/modules.json's services need. tts, pace, image, lyria, doctor and bin/vh read keys
  through it; a command the agent column runs finds a saved key (the agent's own environment still has none).
- The settings page's Services section: each service, what it is for, free or paid in a word, each key not set / set
  in Studio / set in the environment, Set up / Replace / Remove (asked twice) / Test (doctor's free probe), where to
  get a key; one sentence on where a saved key is kept; an API Key is not a budget.
- bin/vh doctor says "set in Studio" or "set in the environment" (--json: key_source). tools/modules.json: cost and
  key_url on the four services. tools/ci.sh turns the store off (OVH_KEYSTORE=none): no check finds a key the person
  saved, so nothing paid is called.
- Tests on a keychain of their own (made with HOME in the scratch folder, named on every call, deleted after; the
  person's search list checked unchanged) or a stand-in secret-tool elsewhere.
…ect in Studio at once

- Merged first-film's reviewed tools/settings.py (Newer, env_changes, kept_own); Studio's three keys kept beside it.
- Switching the mirror in the page applies settings.env_changes() to Studio's own environment, so the install it runs
  and the agents it starts next follow it; checked: Studio started under cn, switched to the official sources, a child
  of the console carries none of the mirror's variables (it did before: all six).
- The page lists the sources of the person's own that stay theirs under cn (kept_own), says one plain line when the
  settings file was written by a newer version (Newer), and says "以后的下载只从官方源" again, with the one case that
  waits: a chat already open keeps its agent's own npm and uv until the next chat.
…mirror switch at once, and the services' checks beside it
…e store lookup per name, a readers check that finds indirect reads

- the page and the change note: pictures and Lyria music stop without a budget; voices, word timing and auditions with these services are called directly and bill that account
- tools/keys.py remembers each name's lookup per process (a missing key and a store that does not answer within 3 s too); a save or a removal refreshes that name; keys up to 2048 characters
- the readers check searches bin/, tools/, engines/, components/, styles/ for a key read by name and, in files that touch keys, any read of the environment by a name the line does not spell; it is first tried on the old ways of reading
- refusals carry a reason the page says in its own words; a failed save keeps the box open with the next step; no password box or form; a computer with no store gets plain words and a README section on how
- doctor --probe asks with each key that is set (both of MiniMax's)
- OVH_KEYSTORE=none passed on by the three doctor checks that build their own environment, and kept by acp.clean_env; the checks stage their store before any check
…here to set it and where to get one; Studio's now line says the film waits on it

- tools/keys.py: one sentence for a missing key (the service, Studio's Settings → Services or the environment, where to get one, what works with none), put on the run's record as the new code no_key
- tts (each provider, --align gemini, voices audition), pace --align gemini, music --provider lyria, image gen say it
- tools/standing.py: needs_key while the newest run of a command stopped for a key that is still not set, with the way to Settings → Services (act kind settings); Studio's column renders that button
- schemas, jsonerr's code list, the desk README
…hat the key was for and what this computer has, and it clears on a later run

- lyria.py writes its run's end (bin/vh exec's into it): a stop for a key shows as one, and no Lyria run reads as cut off
- the no_key record says what the key was for (voice, timing, music, image) and its names; the line under Studio's sentence follows it, not the command
- what works with no key is per platform (Apple Silicon: the local voice and timing; an Intel Mac: macOS's say; Linux: none, said plainly), and Codex for pictures when it is there, in the command's words and in Studio's
- a stop clears once a later run did the same kind of work fine, or a later run failed; read from the whole log (activity.key_stop), not the last five runs
- the desk README: a key set only in a terminal's environment is not seen by a Studio opened elsewhere
Base automatically changed from claude/settings-keys to main November 22, 2026 07:56
@ZLHad
ZLHad marked this pull request as ready for review November 22, 2026 07:57
@ZLHad
ZLHad enabled auto-merge (squash) November 22, 2026 07:57
@ZLHad
ZLHad merged commit d2da9d0 into main Nov 22, 2026
4 checks passed
@ZLHad
ZLHad deleted the claude/settings-first-run branch November 22, 2026 08:26
ZLHad added a commit that referenced this pull request Nov 22, 2026
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.

1 participant