serve: strict per-run fields — a pick list that is a catalog, not a convenience - #323
Conversation
…onvenience
CommandDef.field_suggestions offers a host pick list inside a free-form text
input; by its contract the list never constrains the value. A downstream
op whose field *is* a catalog lookup (axol-pi's task_id: the id names the
dataset and the prompt, and an unknown one is refused at run start) had no
way to say so, so the panel let free text into it.
CommandDef(strict_fields=(...)) marks suggested fields whose value must be
one of the suggestions:
- /api/commands lists them as strictFields; a strict field without a
provider is a registration error.
- The panel renders a strict field as a <select> over the fetched rows
("value — label"), disabled with a placeholder until the list loads,
showing a stored value the list no longer carries as "(not in the list)",
and blocks Start with "Pick <field> from the list" while the value is
off it. A provider failure says the field cannot be set rather than
"type the value".
- /api/op/start runs check_strict_fields before any hardware survey and
refuses an off-list value as a 400 — so an older panel's text input
cannot get past it either. A failing provider refuses too (the list is
the source of truth); a blank value is the schema's business.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 84c8cba. Configure here.
| className="h-9 w-full rounded-md border border-input bg-white/[0.02] px-3 text-sm text-foreground outline-none focus-visible:border-ring/70 disabled:opacity-50" | ||
| > | ||
| {!loaded ? ( | ||
| <option value={value}>Loading options…</option> |
There was a problem hiding this comment.
Fetch errors freeze strict selects
Medium Severity
A thrown fetchFieldSuggestions request is swallowed, so suggestions never becomes an array. StrictSelect treats that as still loading and stays disabled on Loading options…, and Start is not blocked for a stored value. A 200 with a provider error is handled; a network or HTTP failure is not, so the catalog field cannot be set until the panel remounts.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 84c8cba. Configure here.


Why
CommandDef.field_suggestions(#284) offers a host pick list inside a free-form text input; by its contract the list never constrains the value. A downstream op whose field is a catalog lookup — axol-pi'stask_id, where the id names the dataset and the prompt and an unknown id is refused at run start — had no way to say so, so the panel let free text into it.What
CommandDef(strict_fields=(...))marks suggested fields whose value must be one of the suggestions./api/commandslists them asstrictFields; a strict field without afield_suggestionsprovider is a registration error.<select>over the fetched rows (value — label), disabled with a placeholder until the list loads, showing a stored value the list no longer carries as "(not in the list)", and blocks Start with "Pick from the list" while the value is off it. A provider failure says the field cannot be set rather than "type the value"./api/op/startrunscheck_strict_fieldsbefore any hardware survey and refuses an off-list value as a 400, so an older panel's text input cannot get past it either. A failing provider refuses too (the list is the source of truth); a blank value is the schema's business (a required field is refused by the config parse).Nothing changes for ops that don't declare strict fields; older panels ignore
strictFields.Tests
tests/test_serve_field_suggestions.py: specs list the strict fields, a strict field needs a provider, listed/unlisted/blank values, failing provider refuses,/api/op/start400 vs start.python -m unittest discover -s tests -p "test_serve_*.py": 94 OK.web/app:tsc -b, eslint, prettier,npm testclean.Consumer: axol-pi will put
strict_fields=("task_id",)on its recording ops once this is pinned.Made with Cursor