[TUI] strata launch: moving the Access-step highlight makes an API key a local launch keeps
Los mantenedores suelen responder en 4 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 80/100
Línea de trabajo
Empieza por strata_cli/launch/screens.py, en los métodos on_cursor() y commit() de la pantalla Access. Después, lee las acciones del cursor que llaman a on_cursor() y compara la regla clave de strata_cli/cmd.py:437-440. Añade o actualiza pruebas de terminal para mover el resaltado y confirmar cada opción de acceso. El trabajo estará terminado cuando explorar las opciones no tenga efectos secundarios y un inicio local no guarde ninguna clave de API.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
On the strata launch Access step, pressing up/down to read the help text under each option runs a handler that makes an API key as soon as the highlight lands on any option beyond "This computer only". Nothing clears that key when the highlight goes back to "This computer only", so a launch that ends on localhost serves with a key - while the same screen says a key is not needed there.
strata_cli/launch/screens.py:1556 (Access screen):
def on_cursor(self) -> None:
kind = self.menu().current.key
s = self.ctx.settings
s.access = kind
if kind != "local" and not s.api_key and not s.no_key:
s.api_key = acc.kept_key() or acc.new_key()
action_move calls on_cursor() on every cursor move (screens.py:192-197), and so do action_edge (:199-204) and paging. commit() (:1607-1611) only sets a key for a non-local choice; it never clears one for a local choice. The only ways off are t (key toggle) or --no-api-key (cmd.py:277-290).
The key then follows the launch: derive_config writes it into the run config regardless of the access choice (strata_cli/launch/runner.py:551-556, if s.api_key: cfg["api_key"] = s.api_key), it is stored in the private launch preset (settings.py:134 "stored only in the private preset file"), and kept_key() (access.py:320) hands it to later launches.
Environment
Strata Version: 0.2.13 (engine 0.1.59), Terminal installed over a fresh desktop-app install
OS: Windows, Linux, macOS - the handler is platform-independent; the report below is from Linux
Model/quant: Qwen 3.8 Flash Next, IQ3_S (native pack)
Reproduce
Reported from a real setup, exactly as the reporter worked:
- Fresh install. The desktop app downloads Qwen 3.8 Flash Next IQ3_S, tunes it, chatting works.
- Install the Terminal, run
strata launch, and create a model preset. - On the Access step, move the highlight between the choices in order to read the help text below them.
- Leave the highlight on "This computer only" and finish the launch.
- Quit, then serve that model with
strata serve --profile <the profile the launch created>. - Point a client (Pi) at the localhost address.
Expected
No key: the help text on that very screen says "Only programs on this computer can reach it, so no key is needed." (screens.py:1553) and "This computer only is the safe default and never needs a key" (:1496). Outside the TUI the rule is the one expected here - a key is made only when s.access != "local" (cmd.py:437-440).
Actual
The key made while browsing is kept, written into the run config and into the saved preset, and the server requires it. The client is refused:
{"error": {"type": "authentication_error", "message": "missing or wrong API key"}}
(serve/server.py:7867-7873; the server takes the key straight from the config: serve/server.py:10166-10176, strata_cli/cli.py:788-792.)
Secondary, same handler: on_cursor also assigns s.access = kind, so moving the highlight to read a description changes the pending choice. Reading the help text is not a read-only action.
Evidence
Function-level replay of the shipped logic (verbatim on_cursor + commit + the derive_config key lines, stubbed menu, fake key generator):
| cursor moves | s.access |
s.api_key after |
cfg["api_key"] |
|---|---|---|---|
| down to "Other computers" | lan | set | - |
| down to Tailscale | tailscale | set | - |
| up to "Other computers" | lan | set | - |
| up to "This computer only" | local | still set | - |
| commit, then derive_config | local | set | written into the run config |
Nothing in tests/terminal exercises on_cursor, keytoggle or newkey (grep -rln "on_cursor\|keytoggle\|newkey" tests/terminal/*.py is empty), so no test locks this as intended behaviour.
Reproduction status: the user workflow above was reproduced by the reporter in normal use. The code path is additionally confirmed here by reading the 0.2.13 source and by the function-level replay above; the full TUI was not driven in this checkout (Textual is not installed in its test environment).
Suggested minimum fix
Make a key where the choice is acted on, not where the cursor rests: keep on_cursor to the help text, and let the TUI use the rule cmd.py:437-440 already uses - make a key only at commit, and only when s.access != "local". That also makes the local path byte-identical to strata launch --access local, which writes no key (runner.py:551-556).
Related
#4396 (closed) fixed a different route to the same visible symptom - strata launch silently minting a new API key through kept_key() when a profile file could not be read. Different cause, same user-visible failure; this thread is about the Access screen's cursor handler.
- Lenguaje dominante
- C++
- Estrellas
- 11.6k
- Forks
- 1k
- Merge medio
- 18 d 13 h
- PR fusionados (30 d)
- 4
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Niko1221/Strata
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Niko1221/Strata#6071 · 2 comentarios ·
Los mantenedores suelen responder en 4 días
-
needs-format
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
Niko1221/Strata#6040 · 1 comentario ·
Los mantenedores suelen responder en 4 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 4 días
-
[Engine] RTX 5090 32 GB, Q2_0: the ~13 KB/token KV figure measured, and why 1M context cannot start at --kv int8 (--kv-resident is the lever)Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Niko1221/Strata#5852 · 1 comentario ·
Los mantenedores suelen responder en 4 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 4 días
Todos los issues de Niko1221/Strata
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
grizzlypeak3d/DJV#962 ·
-
cognizant-backlog
Dificultad 2/5 1-3 horas Aptitud para principiantes 61/100
KhronosGroup/OpenCL-CTS#2882 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Documentation: Fix parameter markup, legacy branch link, and phrasing in Detachable Joints and Model Command tutorialsPosiblemente ocupada @patelshivani2283-lab la tomó hoy. Abierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
LunarG/gfxreconstruct#3440 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día