Skip to content

serve: strict per-run fields — a pick list that is a catalog, not a convenience - #323

Merged
shawnpatel merged 1 commit into
mainfrom
strict-field-suggestions
Sep 25, 2026
Merged

shawnpatel merged 1 commit into
mainfrom
strict-field-suggestions

Conversation

@shawnpatel

Copy link
Copy Markdown
Member

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's task_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/commands lists them as strictFields; a strict field without a field_suggestions 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 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 (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/start 400 vs start.
  • python -m unittest discover -s tests -p "test_serve_*.py": 94 OK. web/app: tsc -b, eslint, prettier, npm test clean.

Consumer: axol-pi will put strict_fields=("task_id",) on its recording ops once this is pinned.

Made with Cursor

…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.
@vercel

vercel Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
axol Ready Ready Preview Sep 23, 2026 9:27pm UTC

Request Review

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ 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>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 84c8cba. Configure here.

@shawnpatel
shawnpatel merged commit f3d9bc2 into main Sep 25, 2026
5 checks passed
@shawnpatel
shawnpatel deleted the strict-field-suggestions branch September 25, 2026 20:18

This branch was successfully deployed

1 active deployment
Preview — 84c8cba1 Deployed Sep 23, 2026 by vercel[bot]
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